-
Notifications
You must be signed in to change notification settings - Fork 601
Delivery Process
- Overview Open Liberty Development
This page details a step by step, developer focused view of the code delivery process for Open Liberty.
To do delivery work, you need to complete the following:
- Complete all of the Open Liberty Development setup instructions.
- Ensure that you have read the Contributor Guidelines
- Sign and submit the Contributor License Agreement
Follow these steps to deliver to the open-liberty repository:
- Step 1 : Development
- Step 2 : Pull Request
- Step 3 : Code Review
- Step 4 : Clean-up
NOTE: All git commands in the remainder of these steps are executed from a Git-Bash command window. Ensure that you've started your SSH agent:
eval "$(ssh-agent -s)"
-
Open a new GitHub issue in open-liberty that represents the change you need to make to the source code.
-
Sync to get the latest changes for open-liberty.
cd <your dev path>/libertyGit/open-liberty
git checkout release
git pull
-
Create a new feature branch to contain your code.
git checkout -b <issue_number>-<short_name>
git push --set-upstream
-
Make your development code changes and then re-build
cd dev
./gradlew cnf:initialize
Initialize to the new branch./gradlew releaseNeeded
(After you have been doing this successfully for a while try ./gradlew --parallel releaseNeeded
which speeds up certain common scenarios.)
-
To run test buckets in open-liberty:
./gradlew test
Runs all the tests in the repo./gradlew --no-daemon <package name>:test -debug
Runs only the specified package in debug mode
Also see here for more information on running FAT Test buckets.
-
Once happy with your changes and they build successfully on your local machine, you must commit the changes to your local branch.
git add <the file you changed goes here>
git commit
<Enter your commit message>
By default this opens up the vi editor. Hit 'i' to go into insert mode and type up your issue description. When completed with your changes, hit the Esc button and then':wq' to write and quit.See Git usage guidelines for some guidance on what your commit message should look like
-
At this point, you will want to ensure your branch has "caught up to release" to ensure you will merge cleanly. The first step is to fetch all the new stuff that's been delivered to
origin
.git fetch origin
-
Now you have the choice of doing a rebase or merging
release
into your branch. (Let's do a rebase.)git rebase origin/release
This could result in conflicts which you must resolve in order to continue the rebase. If you don't encounter any merge conflicts, then jump to Task 12 below else continue on to Task 9 if you have conflicts.
-
Once you have modified the conflicting files, you must re-stage those files to resolve the conflict.
git add <path to files with resolved conflicts>
- This will add each of the files you had to modify to the staging area.
- This is how you tell Git that you have resolved the conflict.
-
Once you have resolved the conflict, the following will allow the rebase to continue:
git rebase --continue
-
If your branch has multiple commits you may hit another conflict in a later commit. At this point you repeat the commands to resolve the conflict and keep running
rebase --continue
until it has finished successfully. Here is a good article on merge conflicts -
Lastly, you must push the local branch to your fork (using the
-f
option to force the rewritten commits to be pushed - this will be necessary if you already pushed some commits to this branch on your fork before you did the rebase) via this command:git push -f
-
Create a pull request against open-liberty/integration branch.
-
Add the following to the your pull request's top level comment, but instead of 123, use the GIT issue number that this pull request is fixing:
fixes #123
-
Note that adding the above comment will cause the issue to close when the PR is merged.
-
In some cases this may be undesirable (either you want to close the issue yourself, or there are multiple PRs that need to be merged before the issue is resolved), in which case at least add a comment explaining that this PR is related to the issue, similar to:
for #123
- Your PR should be automatically sent to @Open-Liberty/reviewers.
- Make any changes that are needed, re-build and re-test to ensure you didnt break anything.
- Once the review is approved, one of the @Open-Liberty team will merge the PR into open-liberty/integration.
After your pull request has been merged to release you should perform the following steps. If your code changes have only made it into the integration branch, DO NOT perform these steps yet!:
-
Close out the Git Issue.
-
(optional) Delete your local branch. (Use 'git branch -a' to see all branches if needed)
cd /<your respective repo>/
git branch -d <branch name>
git push my_fork :<branch name>
git branch -a
(ensure the branch is deleted)
NOTE: The push command for deleting the branch uses the colon (:) to indicate the branch should be deleted on the fork. Now you can create a new feature branch to work on something new.
- Overview Open Liberty Development