Table of Contents generated with DocToc
Rule of thumb: We keep all IBM related commits on top of the upstream code using rebase and/or cherry-pick.
-
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
-
Rebase IBM changes on top of upstream code
-
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
-
(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 titleApply IBM specific changes
. It's not encouraged to use commit hash to identify the change since the commit hash would change during rebase process.
-
-
Push change to GHE
git push origin pick-upstream
-
Create pull requset and ask team mate to review
- Create pull request based on
pick-upstream
branch - Invite team mates to review
- Get an approval from team mates
- Create pull request based on
-
Repo admin force push reviewed change to
master
- 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. - Repo admin turns off protected branch for
master
- Repo admin force push with
git push origin pick-upstream:master -f
- Repo admin turns protected branch back on. Make sure
Travis
anddetect-secrets
checks are required.
- 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
-
(Optional) Create a new release
Format: <upstream-version>-ibm.<minor>.<fix>
, for example 0.12.0-ibm.3
- When adding new IBM specific feature, increase
<minor>
- When fixing IBM specific bugs, increase
<fix>
- When rebase from upstream, update
<upstream-version>
to the rebased upstream version. We do not reset the<minor>
and<fix>
when bumping upstream version. - Version number also needs to be updated in
__init__.py
- Update the version number (value of
rev
) inuser-config/.pre-commit-config.yaml
Release should be made when we bump to a new version.
- 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