Versions Compared

Key

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

...

Submitting for Review

  • Attach a patch, pull request url URL or branch name (see instructions at Workflow)
  • (OPTIONAL) create an Upsource review: Review With Upsource
  • Add comment describing what has been implemented.
  • Move ticket to PATCH AVAILABLE state.

...

Instructions on how to build source and binary releases can be found at DEVNOTES.txt. Please see "Ignite Release Instructions" section. On how to make official release please refer to Release Process.

Workflow

There are 3 way several ways how you can make contribution

  1. GitHub pull-request
  2. Patch-file
  3. Ticket Branch (only committers)

...

Create GitHub pull-request


 +------------+             +---------------+            +-----------------+

...

  1. Checks that you don't have any uncommitted changes.
  2. Checks you are one master branch and master branch is up-to-date.
  3. Updates local master from Apache git repo.
  4. Fetches pull request to a local branch:
    • git fetch upstream pull/<id>/head:pull-<id>-head

  5. Saves an author and a comment of the last commit at pull-<id>-head.
  6. Merges from the new branch to master:
    • git merge --squash pull-<id>-head
  7. Ask you about custom comment or using the saved comment.
  8. Commit to local master. The script automatically sign-off a commit and add "Fixes #<id>." suffix to comment (It will close the pull request, see https://help.github.com/articles/closing-issues-via-commit-messages/):
    • git commit --author=“<saved_author>" -s -m “<comment> - Fixes #<id>.”

Now, you will have one commit at master with all changes from pull-request. Changes can be reviewed again. If you accept all changes and want to push it, do next:

  •  git push apache master

2. Create a Patch-file

Creation

You can start by cloning the Ignite GIT repo.

Info
titleClone the repo
git clone https://gitbox.apache.org/repos/asf/ignite.git 

We use git as our version control system. To streamline the process of giving proper credit to the contributors when committing patches, we encourage contributors to submit patches generated using "git format-patch" command. This has many benefits:

  • Committers will not forget to give proper credit to a contributor
  • Contributor's name and email address show up in the git log

Long story short, it makes both the contributors' and committers' lives easier, so please generate your patches using git format-patch.

We have the following requirements for patches:

  • patch can be applied to the HEAD of 'master' branch by "git am <patch-file>" without conflicts.
  • patch has to have all changes in one commit with comment like "ignite-xxx: Implemented."
  • patch-file has to have 'patch', 'txt' or 'diff' extension

Patch Creation Process

We prefer that you use the following step-by-step instructions when developing with Ignite.

For example, if you are starting working on the feature IGNITE-9999.

Code Block
## Get the repo
git clone https://github.com/apache/ignite.git
## Some development here with many commits at ignite-9999.
git commit -a -m 'ignite-9999: Intermediate commit 1';
...
git commit -a -m 'ignite-9999: Intermediate commit 100';


## Commit the last changes.
git commit -a -m 'ignite-9999: Implemented.';


## Making patch.
## There are a lot of changes at ignite-sprint-999 and we need to get it, resolve conflicts (if exists), rerun tests for ignite-9999. 
git checkout master 
git pull  
git checkout ignite-9999 
git merge master

## Run script to make patch. Patch will have all changes as one commit.
<ignite_home>/scripts/git-format-patch.sh

Note: it is strongly recommended to merge 'master' branch to your development branch, for example, every day (or after each commit).

Patch Validation

Created patch-file should be attached to a JIRA ticket and the ticket status should be changed on Patch Available.

If you do everything correctly, then all necessary TeamCity test builds will be triggered automatically in 3 minutes period, and a comment with triggered build information (test package names, TeamCity build links) will be added to the JIRA.

Once tests are passed, the patch can be reviewed and merged by a committer.

Requirements (to auto triggering the test builds):

  • patch-file has to have 'patch', 'txt' or 'diff' extension
  • patch-file has to be attached by JIRA user with contributor role.
Info
iconfalse
titleRun All for patch (manually)

 Note: All TeamCity test builds can be triggered manually via "Ignite/ -> Run All for patch" (by 'Jira number'). A comment will be added to the jira with all new triggered builds.

Applying

Contributor patches have to be applied by next command.

git am -s <patch-file>

This command apply a patch file generated by 'git format-patch', stores information who created a patch and who applied a patch. So, it gives proper credit to the contributor and store an information who decide to take these changes.

If patch file has been created by scripts/git-format-patch.sh then a name of a patch-file contains a short hash revision of master branch revision against which patch has been created. Patch file template is 

master_<hash>_ignite-<ticket-number>.patch

For example

master_b001525_ignite-9999.patch

So, in case, if a patch can't be applied without conflicts on the HEAD of master and the patch has been created by scripts/git-format-patch.sh then a commiter can apply the patch to master by a revision hash, review changes and resolve the conflicts by yourself.

...

Create a Ticket Branch (only committers)

Creation & Applying

Whenever working on bigger features, committers can also create 'ready to be reviewed' branch ignite-XXXX, where XXXX is the number of the JIRA ticket.

...