Skip to content

Latest commit

 

History

History
83 lines (59 loc) · 4.16 KB

update.md

File metadata and controls

83 lines (59 loc) · 4.16 KB

Versioning and update

Table of Contents generated with DocToc

How do we keep update to date with upstream

Rule of thumb: We keep all IBM related commits on top of the upstream code using rebase and/or cherry-pick.

  1. Clone both upstream and IBM version

    git clone [email protected]:IBM/detect-secrets.git
    cd detect-secrets
    git remote add upstream-github [email protected]:Yelp/detect-secrets.git
    git fetch --all
  2. Rebase IBM changes on top of upstream code

    1. Rebase on top of upstream master branch.

      git checkout -b pick-upstream master
      git rebase upstream-github/master
      # Fix conflicts and make sure tests are passing
    2. (Optional) rearrange IBM related commits with git rebase -i $(git log -n1 upstream-github/master --pretty=format:"%h"). You can move around and squash IBM commits to make the IBM specific commits at a low number. It helps with future rebase. To manually identify the base commit (the commit before first IBM commit), you can search for IBM's first commit with title Apply IBM specific changes. It's not encouraged to use commit hash to identify the change since the commit hash would change during rebase process.

  3. Push change to GHE

    git push origin pick-upstream
  4. Create pull requset and ask team mate to review

    1. Create pull request based on pick-upstream branch
    2. Invite team mates to review
    3. Get an approval from team mates
  5. Repo admin force push reviewed change to master

    1. Since we altered the commit hash during rebase process, it's unlikely pull request can auto merge. Hence we choose to use force push to keep master history cleaner.
    2. Repo admin turns off protected branch for master
    3. Repo admin force push with git push origin pick-upstream:master -f
    4. Repo admin turns protected branch back on. Make sure Travis and detect-secrets checks are required.
  6. (Optional) Create a new release

How do we version this repo

Format: <upstream-version>-ibm.<minor>.<fix>, for example 0.12.0-ibm.3

  1. When adding new IBM specific feature, increase <minor>
  2. When fixing IBM specific bugs, increase <fix>
  3. When rebase from upstream, update <upstream-version> to the rebased upstream version. We do not reset the <minor> and <fix> when bumping upstream version.
  4. Version number also needs to be updated in __init__.py
  5. Update the version number (value of rev) in user-config/.pre-commit-config.yaml

How do we make release

Release should be made when we bump to a new version.

  1. Use hub tool to create new release. You can view the released version at https://github.ibm.com/Whitewater/whitewater-detect-secrets/releases. This process also creates a tag, which triggers Traivs tag build to generate a new version of the docker image labeled with the newly created tag.
# <branch-name>: the latest commit from the branch would be used to create tag.
# <version>: match the version in detect_secrets/__init__.py
$ hub release create -t <branch-name> <version>

# You will be prompt to input a release note. First line would be the title and
# following text would be release content.
#
#   Release title follows format "Release <version>"
#   Release text contains the features, fixes introduced in the new release