-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Enable pre-merge packaging via a manual promotion #10626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable pre-merge packaging via a manual promotion #10626
Conversation
Sometimes we want to test a change in our Calico/OpenStack ST (`calico-test`) before merging it. But the Calico/OpenStack ST is driven by packaged code, so this means we need to package the pre-merge code. The changes in this PR enable that, as follows: 1. Push the relevant code to a branch of github.com/projectcalico/calico. It must be that repo, not a fork, because the process needs secrets that we don't share with forks. 2. Create a PR from that branch. 3. Create a PPA at https://launchpad.net/~project-calico named `pr-<N>`, where `<N>` is the number of the PR. (If that PPA doesn't already exist.) 4. Click the "Publish openstack packages" promotion. That should result in packages with the pre-merge code being uploaded to the `pr-<N>` PPA. When those have been built and published, you can push a branch to github.com/tigera/calico-test with, for example: modified build_and_run_fv.sh @@ -23,7 +23,7 @@ CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD` : ${BUILD_NUMBER:=0} : ${WORKSPACE:="$(pwd)"} : ${PKG_SRC_STEM:='master'} -: ${INSTALL_SOURCE:=""} +: ${INSTALL_SOURCE:="ppa:project-calico/pr-10610"} # PKG_SRC_STEM is only used if INSTALL_SOURCE is not set. : ${TEST_BRANCH:=${CURRENT_BRANCH}} : ${TEST_REQ:='smoke'} and that will kick off an ST run using that PPA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables manual pre-merge packaging for Calico/OpenStack ST by recognizing PR branches and exposing a CI promotion for them.
- Support
pr-<N>
version pattern in the packaging script to setREPO_NAME
for pre-merge PPAs. - Update Semaphore CI to show the "Publish openstack packages" button on PRs and publish to
pr-<PR_NUMBER>
PPA.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
release/packaging/utils/create-update-packages.sh | Added pr-<number> pattern to require_version for PR branches |
.semaphore/push-images/packaging.yaml | Enabled packaging promotion on PRs and conditional PPA publish |
Comments suppressed due to low confidence (4)
release/packaging/utils/create-update-packages.sh:69
- [nitpick] Consider adding a brief comment above this
elif
explaining that it handles pre-merge PR packaging withpr-<PR_NUMBER>
, to improve clarity for future maintainers.
elif [[ $VERSION =~ ^pr-[0-9]+$ ]]; then
.semaphore/push-images/packaging.yaml:39
- [nitpick] This comment block is indented two spaces but the surrounding comments use four spaces. Align comment indentation with the YAML block for readability.
# branches, and PRs, it is available but not automatic. This means a
.semaphore/push-images/packaging.yaml:56
- Quote the constructed VERSION string to prevent word-splitting or globbing (e.g.,
VERSION="pr-${SEMAPHORE_GIT_PR_NUMBER}"
).
- if [ -n "${SEMAPHORE_GIT_PR_NUMBER}" ]; then make -C release/packaging release-publish VERSION=pr-$SEMAPHORE_GIT_PR_NUMBER; fi
release/packaging/utils/create-update-packages.sh:69
- [nitpick] Indentation appears mixed (spaces vs. tabs) between this line and the following assignment. Please standardize on spaces for consistent script formatting.
elif [[ $VERSION =~ ^pr-[0-9]+$ ]]; then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if there was a way to automate creation of PPAs, or re-use PPAs for multiple builds but this seems like a step in the right direction, even with extra manual steps needed.
Indeed, I will take another look at that. I think I looked at the time of originating the packaging code, and it wasn't possible at that time, but maybe I was wrong, or things have changed. |
(In future work, I mean. Will bank this PR now.) |
Sometimes we want to test a change in our Calico/OpenStack ST (
calico-test
) before merging it. But the Calico/OpenStack ST is driven by packaged code, so this means we need to package the pre-merge code. The changes in this PR enable that, as follows:Push the relevant code to a branch of github.com/projectcalico/calico. It must be that repo, not a fork, because the process needs secrets that we don't share with forks.
Create a PR from that branch.
Create a PPA at https://launchpad.net/~project-calico named
pr-<N>
, where<N>
is the number of the PR. (If that PPA doesn't already exist.)Click the "Publish openstack packages" promotion.
That should result in packages with the pre-merge code being uploaded to the
pr-<N>
PPA. When those have been built and published, you can push a branch to github.com/tigera/calico-test with, for example:and that will kick off an ST run using that PPA.