mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-27 12:13:20 -04:00
Only autorebase when there is anything to rebase
In an optimistic future, security-* branches will become empty, at least intermittently. When that happens, there will be nothing left to rebase on those branches, so when something gets merged into their base branches, an autorebase will effectively be a fast-forward. While the existing autorebase logic would handle such a case perfectly fine, it is prudent to avoid creating a test pipeline after pushing such a fast-forward update as the code revision getting pushed will have already been tested by other pipelines. However, the push should still happen as non-empty downstream autorebased branches may exist and those will still need to be rebased. Achieve both of these objectives by checking early whether there is anything to rebase and pushing the fast-forwarded version of the branch without setting the AUTOREBASE CI variable if there is not.
This commit is contained in:
parent
5cd870053e
commit
497f771ae3
1 changed files with 3 additions and 0 deletions
|
|
@ -2615,6 +2615,9 @@ merged-metadata:
|
|||
- git remote get-url origin | sed -e "s/gitlab-ci-token:${CI_JOB_TOKEN}/oauth2:${BIND_TEAM_WRITE_TOKEN}/" | xargs git remote set-url --push origin
|
||||
- git remote add base-project "${CI_SERVER_URL}/${BASE_PROJECT}.git"
|
||||
- git fetch --depth="${GIT_DEPTH}" base-project "${BASE_COMMIT}"
|
||||
# If this branch has no changes compared to its base branch yet, there is nothing to rebase;
|
||||
# push the new revision anyway to trigger any potential downstream autorebases.
|
||||
- if [ -z "$(git log --max-count=1 "${BASE_COMMIT}..")" ]; then git push origin "${BASE_COMMIT}:${CI_COMMIT_REF_NAME}"; exit 0; fi
|
||||
- *git_clone_bind9-qa
|
||||
- >
|
||||
"$CI_PROJECT_DIR"/bind9-qa/releng/rebase.py ${REWRITE_CHERRY_PICKS_FROM:+--rewrite-cherry-picks-from ${REWRITE_CHERRY_PICKS_FROM}} --base-project "${BASE_PROJECT}" "${BASE_COMMIT}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue