Skip to content

Delivery Process

Adam Anderson edited this page Sep 28, 2023 · 13 revisions

Welcome to the Open Liberty Delivery Process page!

This page details a step by step, developer focused view of the code delivery process for Open Liberty.


Prerequisite

To do delivery work, you need to complete the following:

Delivery Process

Follow these steps to deliver to the open-liberty repository:

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)"


Step 1 : Development

  1. Open a new GitHub issue in open-liberty that represents the change you need to make to the source code.

  2. Sync to get the latest changes for open-liberty.

    cd <your dev path>/libertyGit/open-liberty

    git checkout release

    git pull

  3. Create a new feature branch to contain your code.

    git checkout -b <issue_number>-<short_name>

    git push --set-upstream

  4. 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.)

  1. 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.

  1. 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

  2. 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

  3. 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.

  1. 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.
  1. Once you have resolved the conflict, the following will allow the rebase to continue:

    git rebase --continue

  2. 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

  3. 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


Step 2 : Pull Request

  1. Create a pull request against open-liberty/integration branch.

  2. 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


Step 3 : Code Review

  1. Your PR should be automatically sent to @Open-Liberty/reviewers.
  2. Make any changes that are needed, re-build and re-test to ensure you didnt break anything.
  3. Once the review is approved, one of the @Open-Liberty team will merge the PR into open-liberty/integration.

Step 4: Clean-up your workspace

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!:

  1. Close out the Git Issue.

  2. (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.