CMCC Model Changes Using Pull Requests - CMCC-Foundation/CMCC-CM GitHub Wiki
This page contains the standard workflow for development and/or bug fixes for CMCC-CM and its component models using Pull Requests (PRs) on GitHub. To apply these instructions to a component repo, substitute that repo for CMCC-CM below.
-
Make sure there is an open issue on the model repository page that describes the need for the changes.
-
Open a Pull Request (PR)
- Go to your fork's GitHub page, and select the "Pull requests" tab:
workflow_images/CMCC_CM_PR_tab.png
- Create a new pull request using the "new pull request" button:
workflow_images/new_PR_button.png
- Set the "base repository" to "CMCC-Foundation/CMCC-CM", and the "base" to your branch to be modified (likely "cmcc-cm")
workflow_images/CMCC_PR_option_base.png
- Set the "head repository" to your CAM fork repo, and the "compare" to your newly created branch:
workflow_images/CMCC_PR_option_head.png
- If the phrase "Able to merge" is present, then select "create pull request":
workflow_images/create_PR_button.png
- Add a title for your request, along with a description of what your pull request is doing. Fill out all fields in the template while removing any template comments. Be sure to list the issue(s) which are addressed by this pull request, taking care to use the correct syntax.
- Select the appropriate labels for this PR (e.g., "bug fix", "enhancement")
-
If you are able to select a reviewer, please select someone with the background and time to do this. If a reviewer asks for changes to your PR, follow these steps:
- Make the requested changes on your branch
- Re-run the test(s) you used to verify your work
- Commit the changes to your branch
- Push the commit(s) back to your GitHub CMCC-CM fork
- Ask your reviewer(s) to re-review the PR. To do this, click the "Re-request review" icon (two circular arrows) to the right of each reviewer's GitHub ID in the "Reviewers" list in the upper-right of the PR page. This notifies each reviewer to re-review the code.
- Repeat these steps until there are no more change requests.
-
Once the changes are complete, your PR is ready to be merged.
-
If you have write access to the repository:
- Merge your branch up to the head of the destination branch
git fetch --tags CMCC
git merge CMCC/CMCC-CM
(substitute base branch for CMCC-CM)
- Run tests one more time. If you find any problems, you probably need to go back to step 5.
- Apply the merge by hitting the green "Merge pull request" button:
workflow_images/Merge_pull_request_button.png
- Enter a commit message (suggestion; copy and paste the description box at the top of the PR), and hit the green "Confirm merge" button:
- Merge your branch up to the head of the destination branch
-
If you do not have write access to the repository, assign someone who does.
-
-
Once the merge is complete, you may safely delete the branch from your fork.
-
After the merge is complete, you should update any clones you have using
git fetch CMCC
.