5.2. Contribution ProcedureΒΆ
Make a new feature branch for your changes
- Suggestion: name the branch after the issue (e.g., ‘SIMP-999’)
Make your changes!
- SIMP contributions should observe the Puppet Language Style Guide conventions where feasible
- Contributions should ideally include relevant spec and/or acceptance tests
Save your changes in a single commit
Use the following commit message conventions:
(SIMP-999) Fix the broken thing [50 chars max] Discussion about the fix (if needed) [each line: 72 chars max] SIMP-998 #comment Comment on a related issue [72 chars max] SIMP-999 #close
The commit message should be the following format:
- First line:
- Start with the Issue name in parentheses [e.g.,
SIMP-999], followed by a summary of the change - No longer than 50 characters
- Followed by a line of white space
- Start with the Issue name in parentheses [e.g.,
- Subsequent lines:
- Each line should be no longer than 72 characters
- Issue references:
- JIRA issues can be referenced at the end of the commit message
- It is recommended to only use the commands
#commentand#close - Avoid
#resolveand#timeas it will not update JIRA until after the issue is merged
- First line:
Push your changes up to your forked repo on GitHub
Create a pull request (“PR”) on GitHub using your new branch
- The pull request should contain a single new commit
- Use
git rebase -ito squash commits (usegit rebase -i HEAD~nto go backncommits)
- Use
- The pull request should contain a single new commit
Travis-CI will notice the pull request and run CI tests
- Travis-CI will run tests based on the .travis.yml file in the repository’s top-level directory
- Travis-CI results can be seen in the PR on GitHub and are posted to the project’s HipChat channel
After passing Travis-CI tests, the GitHub pull request must be picked up in GerritHub for code review
- NOTE: Currently, this is a manual process and requires a project administrator
Pull requests are code reviewed on GerritHub
- If you need to update an existing pull request, amend the pull
request’s commit using the following commands:
git addordelete(this stages the build with the relevant changes;add --allwill add all the new changes, otherwiseaddordeleteto tailor your changeset)git commit --amend(this amends the previous commit)- NOTE: The final line of the amended commit message must include
the Gerrit review’s Change-ID
(example:
Change-Id: Ie536768505a1baff45d6ad3ae4de9e7501ffb53c) git push --force(this sends back to themasterbranch)
- NOTE: The final line of the amended commit message must include
the Gerrit review’s Change-ID
(example:
- If you prefer to amend your change in Gerrithub, you can use the
git-review package to make submitting patch sets easier
- Install the
git-reviewpackage - Add the remote:
git remote add gerrit <url> - Run:
git-review -r gerrit
- Install the
- If you need to update an existing pull request, amend the pull
request’s commit using the following commands:
After the GerritHub review is approved, the changes will be automatically merged into the original GitHub repository