Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Search for an issue in JIRA that represents the change you would like to make or bug to fix. If one does not exist, create a issue. See the Daffodil Issue Tracker information for creating issues and what information/discussions should take place in JIRA.

     

  2. Assign the issue to your self. You may need to request permissions to modify the bug by sending an email to dev@daffodil.apache.org

  3. Visit the Apache Daffodil GitHub and create a fork by clicking on "Fork" in the top right.
     

  4. Clone your new fork. This will be your origin remote:

    Code Block
    languagebash
    $ git clone https://github.com/<username>/incubator-daffodil.git
    $ cd incubator-daffodil


  5. Add the ASF upstream repository as a new git remote, calling it asf:

    Code Block
    languagebash
    $ git remote add asf https://github.com/apache/incubator-daffodil.git
    $ git fetch asf


  6. Create a new branch off of the asf/master branch named daffodil-XYZ-description, where XYZ is the JIRA bug number and -description is an optional, very short description of the bug making it easier to differentiate between multiple development branches. For example:

    Code Block
    languagebash
    $ git checkout -b daffodil-123-bitorder-feature asf/master


  7. Make changes to the branch, frequently adding new commits. For example, the following process should repeat until your code is ready to be reviewed:

    Code Block
    edit files
    $ git add <files that have chnaged>
    $ git commit

    Code changes should follow the Daffodil Code Style Guidelines and should add appropriate tests using the Test Data Markup Language (TDML) or unit tests. Tests in src/test/scala-debug that are fixed should be moved into src/test/scala

  8. When changes are complete, rebase your commits onto asf/master and verify that all tests pass:

    Code Block
    languagebash
    $ git fetch asf
    $ git rebase asf/master
    $ sbt test

    Note that you should not use git pull or git merge to sync to the asf repo. Always fetch/rebase and avoid merge commits. Pull requests containing merge commits will be rejected.

     

  9. If multiple commits were made in step 7, use git rebase -i asf/master to interactively rebase and squash the commits into the smallest number of logical commits. Most commonly this should be a single commit, but there may be some rare cases where multiple commits make sense.

    Ensure the commit has an appropriate and descriptive commit message. The first line of a commit message should contain a short (~50 characters) description of the changes. The second line should be blank, followed by a longer description of the change, wrapped at 72 characters. This long description should describe what was changed in the commit and, more importantly, why those changes were made. The 'what' can be determined by inspecting the code, but the 'why' is often less obvious. At the end of the commit should be a blank line followed by a reference to the JIRA bug, e.g. DAFFODIL-123. Multiple bugs referenced in a single commit should be separated by a comma on the same line. An example of a commit message is:

    Code Block
    languagetext
    Add support for the dfdl:bitOrder feature
     
    Longer explanation of what changes were made to support the bitOrder
    feature, including a description of why the changes were made. Multiple
    lines are wrapped at 72 characters
     
    DAFFODIL-123


  10. Push your branch to your fork:

    Code Block
    languagebash
    $ git push origin daffodil-123-bitorder-feature


  11. Use the GitHub interface to create a pull request for your new branch.

  12. Wait for review comments. There must be at least two +1's from other committers before the change can be merged. If there are any review comments that require changes or the automated Travis CI build fails, create a new commit on your branch (do not squash your changes yet or use git commit --amend) and push your branch with new to GitHub for furthur review. The process should look like:

    Code Block
    edit files
    $ git add <files that changed>
    $ git commit
    $ git push origin daffodil-123-bitorder-feature

    The pull request will automatically update with your new commit. Continue Repeat this process until step utnil at least two +1's are recieved from comitters. Repeat step 12 until you receive at least two +1's from comitters.
     

  13. Once at least two +1's are received from committers, a committer can accept the pull request. If you made extra commits in step 12, you should now fetch the latest asf, rebase and squash the changes into a single commit  (fixing potential conflicts), and push to origin using the --force option:

    Code Block
    $ git fetch asf
    $ git rebase -i asf/master
    $ git push --force origin daffodil-123-bitorder-feature


  14. A committer can now merge the pull request using the GitHub GUI. This is to be done by clicking the "Merge pull request" drop down and selecting "Rebase and merge". The "Create merge commit" and "Squash and merge" options should not be used.  For new committers, you may need to link your GitHub and ASF accounts by visiting https://gitbox.apache.org before you can merge.
     

  15. The committer that merged the pull request should now mark the JIRA bug as "Resolved" and add a comment with the hash that includes the fix.

  16. If you would like to clean up, you can now delete your development branch, either via the GitHub user interface or:

    Code Block
    languagebash
    $ git push --delete origin daffodil-123-bitorder-feature
    $ git branch -D daffodil-123-bitorder-feature