openshift-kni/scheduler-plugins is based on upstream kubernetes-sigs/scheduler-plugins. With every release of kubernetes-sigs/scheduler-plugins, it is necessary to incorporate the upstream changes while ensuring that our downstream customizations are maintained.
Nonetheless, we have the freedom to choose if we want this changes at all, because there are times when the upstream changes are not relevant for our work.
Clone from a personal fork of openshift-kni/scheduler-plugins via a pushable (ssh) url:
git clone git@github.com:openshift-kni/scheduler-plugins.git
Add a remote for upstream and fetch its branches:
git remote add --fetch upstream https://github.com/kubernetes-sigs/scheduler-plugins
Branch the target openshift-kni/scheduler master branch to a new resync local branch
git checkout master
git checkout -b "resync-$(date +%Y%m%d)"
git merge upstream/master
fix conflicts introduced by kni-local changes and send PR for review
Every commit that is openshift-kni/scheduler-plugins specific should have a prefix of [KNI] at the beginning of the commit message.
For the sake of transparency, for every resync process we should update the table in RESYNC.log.md
. The newest resync should appear in the first row.
- Ensure that all the upstream features/updates related to NUMA resource topology scheduler plugin including test updates are backported to both release-4.10 and release-4.11 branches.
- As much as possible, keep the base image and golang version intact (go version 1.16 in release-4.10 and go version 1.18 in release-4.11). This is to ensure changes for Z versions are minimal.
- Commit history and authorship MUST be preserved when code is synched with upstream irrespective of whether it is full resync or a few PRs are cherry picked. One way of achieving this is to use
git cherry-pick -x <commit>
as it allows preservation of original commit reference within the cherry-picked commit.
Clone from a personal fork of openshift-kni/scheduler-plugins via a pushable (ssh) url:
git clone git@github.com:openshift-kni/scheduler-plugins.git
Add a remote for upstream and fetch its branches:
git remote add --fetch upstream https://github.com/kubernetes-sigs/scheduler-plugins
Branch the target openshift-kni/scheduler master branch to a new resync local branch
git checkout <release branch>
e.g. git checkout release-4.10
git checkout -b "update-$(git symbolic-ref --short HEAD)-$(date +%Y%m%d)"
e.g. git checkout -b update-release-4.10-20220707
Go to the upstream PR you are trying to cherrypick and identify the commit hashes.
git cherry-pick -x <start-commit-hash>^..<end-commit-hash>
NOTE: -x flag above is used to preserve original commit reference
Fix conflicts introduced by kni-local changes and send PR for review.
Make sure to run go mod tidy
and go mod vendor
to ensure that the repo is in consistent state.
Every commit that is openshift-kni/scheduler-plugins specific should have a prefix of [KNI]
at the beginning of the commit message.
There are cases on which we cannot resync with upstream using the preferred merge approach described above. Even though upstream is usually slower and deliberate consuming k8s libraries, there are cases on which we may want to pull features or fixes in stable branches, and upstream just moved too far.
In these cases we do upstream carries
.
A upstream carry
is the target backport of one or more individual commits cherry-picked from upstream PRs
and repacked in a new PR. upstream carries
are special-purpose in nature, so we can't have strict
guidelines like for merge
s. Nevertheless, all the following guidelines apply.
- The
upstream-carry
PR MUST include the tag[upstream-carry]
in its title - The
upstream-carry
PR MUST have theupstream-carry
label - The cherry-picked commits MUST keep all the authorship information (see
Cherry Pick changes from PRs
and always usegit cherry-pick -x ...
) - The
upstream carry
PR MAY include one or more cherry-picked commits - The
upstream carry
PR MAY reference on its github cover letter the upstream PRs from which it takes commits