-
Notifications
You must be signed in to change notification settings - Fork 29
Making and Testing Changes in the oci quickstart Repository
This is a brief write-up on how to test changes in the oci-quickstart using a another repo which implements the oci-quickstart action.
This tutorial uses h2o repository as an example testing repo. But any repo with implements the oci-quickstart actions would be suitable.
The intuitive way, but not clean way, to make and test changes in the oci-quickstart repository is to simply make the desired changes, commit/push to master, then make an inconsequential change to a repo that runs the oci-quickstart actions (eg h2o) and see if the workflow passes. Programmatically this would be done similar to as follows:
Make changes in quickstart repo
$> git pull origin master
<make_desired_changes>
$> git commit -am "Updated feature" ; git push origin master
Test changes using h2o repo
$> git pull origin master
$> echo " " >> LICENSE ; git commit -am "Trigger workflow" ; git push
The more complicated way, but cleaner way, is to follow the standard git software development model using pull requests. This involves creating a branch in the quickstart repo, making the desired changes, commit/push branch to origin, followed by pull request:
Make changes in quickstart repo
$> git pull origin master
$> git checkout -b <name_of_branch>
<make_desired_changes>
$> git commit -am "Updated feature" ; git push origin <name_of_branch>
Testing the change should also be done in a separate branch. The only trick here is that we need to change the workflow file in the h2o repo to point to the branch we create above. Here is an example:
Test changes in h2o repo
$> git pull origin master
$> git checkout -b testing_branch
<update_the_marketplace.yml_file>
$> git commit -am "Updated feature" ; git push origin <name_of_branch>
How to update marketplace.yml file...
on:
push:
branches:
- - 'master'
+ - 'testing_branch'
[...]
steps:
- name: Checkout
uses: actions/checkout@master
+ with:
+ ref: testing_branch
- name: Terraform Apply
- uses: "oci-quickstart/oci-quickstart/actions/terraform-apply@master"
+ uses: "oci-quickstart/oci-quickstart/actions/terraform-apply@strict_running_of_scripts"
- name: Build ORM Zip
- uses: "oci-quickstart/oci-quickstart/actions/build-orm-zip@master"
+ uses: "oci-quickstart/oci-quickstart/actions/build-orm-zip@strict_running_of_scripts"
if: success()
- name: Update Listing
- uses: "oci-quickstart/oci-quickstart/actions/update-listing@master"
+ uses: "oci-quickstart/oci-quickstart/actions/update-listing@strict_running_of_scripts"
if: success()
Subsequent changes in the quickstart repo are then tested by making a inconsequential changes to the testing_branch and commiting/pushing them:
$> git pull origin master
$> echo " " >> LICENSE ; git commit -am "Trigger workflow" ; git push
A pull request should be submitted once the changes are done, and the pull request should contain a link to the actions that ran successfully from beginning to end (example pull request)
The development branch should be deleted. The test branch should be deleted.