Note: In the below steps, <version_branch>
should be replaced with the version branch of Daffodil you are working on based on the Branch Workflow.
...
Implementor creates a new bug branch
Code Block | ||
---|---|---|
| ||
$ git fetch --prune origin
$ git checkout -b review-sdl-123 --track origin/<version_branch> |
The branch name must use the following naming convention:
review-xxx-YYY-very_short_desc
Part | Description |
---|---|
xxx | implementor initials, in lower case |
YYY | JIRA bug number, with DFDL prefix removed |
desc | a short description (optional) |
Note that the JIRA bug number is mandatory. This means all changes must have an associated JIRA bug.
Also note that the description has been left off in the examples for brevity.
...
Implementor performs all development in bug branch, this includes repeating the following steps many times until you are ready for review:
Code Block | ||
---|---|---|
| ||
$ # edit files
$ git add <files>
$ git commit
$ git fetch --prune origin
$ git rebase origin/<version_branch>
$ sbt test
$ sbt cli # optional step, but should do these tests also
$ git push --force origin review-sdl-123 |
Notice the frequent commits and pushes. This is a great way to ensure we do not accidentally lose commits. But be careful when using the --force option, as that will replace whatever branch is on the server.
Also, please read A Note About Git Commit Messages for the correct commit message format. Please follow those standards, with the additional requirement that the last line should contain only the JIRA bug number preceded by an empty line, e.g. "\nDFDL-123". If there is more than one bug related to the commit, separate them with commas.
Additionally, tests should be created during this process to convince yourself that your changes are correct. These tests should be placed in the "src/test/scala-new" directory.
If this is a bug fix ticket, any tests that were previously failing should be moved from scala-debug to scala-new.
...
When finished developing, implementor ensures changes work with the latest upstream
Code Block | ||
---|---|---|
| ||
$ git fetch --prune origin
$ git rebase origin/<version_branch>
$ sbt test
$ sbt cli # runs CLI tests |
...
Implementor squashes commits into a reasonable patchset.
Code Block | ||
---|---|---|
| ||
$ git rebase -i origin/<version_branch> |
Please pay attention to commit message format
...
Implementor ensures all tests pass
Code Block | ||
---|---|---|
| ||
$ sbt test
$ sbt cli # runs CLI tests |
...
Implementor pushes to ncsa opensource servers for review
Code Block | ||
---|---|---|
| ||
$ git push --force origin review-sdl-123 |
...
Reviewer reviews patchset. If changes are necessary:
...
Implementor ensures changes work with the latest upstream
Code Block | ||
---|---|---|
| ||
$ git checkout review-sdl-123
$ git fetch --prune origin
$ git rebase origin/<version_branch> |
...
Implementor squashes review changes into a reasonable patchset
Code Block | ||
---|---|---|
| ||
$ git rebase -i origin/<version_branch> |
Please pay attention to commit message format
...
Implementor ensures all tests pass
Code Block | ||
---|---|---|
| ||
$ sbt test
$ sbt cli # runs CLI tests |
Implementor sets <version_branch> branch to bug branch and pushes
Code Block | ||
---|---|---|
| ||
$ git checkout <version_branch>
$ git reset --hard review-sdl-123
$ git push origin <version_branch> # do not use the --force option here |
If commit was a bug fix or a test on <version_branch> and a newer version branch exists:
...
Implementor merges the change into the newer version branch, and fixes any conflicts:
Code Block | ||
---|---|---|
| ||
$ git checkout <new_version_branch>
$ git merge <version_branch> |
...
Implementor ensures all tests pass
Code Block | ||
---|---|---|
| ||
$ sbt test
$ sbt cli # runs CLI tests |
If tests fail due to incorrect conflict resolution, changes should be made and amended to the merge commit until tests pass:
Code Block | ||
---|---|---|
| ||
# make changes
$ git add <files>
$ git commit --amend |
Implementor pushes changes
Code Block | ||
---|---|---|
| ||
$ git push origin <new_version_branch> # do not use the --force option here |
...
Implementor deletes bug branch (both remote and local)
Code Block | ||
---|---|---|
| ||
$ git push --delete origin review-sdl-123
$ git branch -D review-sdl-123 |
...