-
Notifications
You must be signed in to change notification settings - Fork 128
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
ci(rh-shield-operator): enhance operator release pipeline #2068
base: main
Are you sure you want to change the base?
ci(rh-shield-operator): enhance operator release pipeline #2068
Conversation
The old pipeline would simply build and push the operator and bundle images. This was a start, but left numerous manual steps to get the Operator itself certified. The changes in this PR add the following enhancements to the pipeline. 1. Generate the Bundle content in the pipeline a. Run the 'make bundle' command in the pipeline as opposed to requiring it be run beforehand. b. Since the pipeline guarantees the operator image itself will be built and pushed before the bundle is generated, we can set USE_IMAGE_DIGESTS=true when running 'make bundle' to include the image checksums in the bundle. This is a requirement for certification. c. The newly generated bundle content will be 'massaged' to include the annotations required for certification that are not created by the operator-sdk. 2. Trigger preflight certification 2. Decouple the various builds and certification steps that aren't related
14a837b
to
88562ce
Compare
echo "Waiting for PR ${{ steps.open-pr.outputs.pull-request-url }} to be merged..." | ||
|
||
PR_STATUS=$(gh pr view ${{ steps.open-pr.outputs.pull-request-number }} --json state -q .state) | ||
|
||
timeout 2h bash -c 'until [[ "$PR_STATUS" == "MERGED" ]]; do | ||
echo "PR not merged yet, waiting 10s..." | ||
sleep 10 | ||
PR_STATUS="$(gh pr view ${{ steps.open-pr.outputs.pull-request-number }} --json state -q .state)" | ||
done' | ||
|
||
if [[ "$PR_STATUS" != "MERGED" ]]; then | ||
echo "PR was not merged in time. Check ${{ steps.open-pr.outputs.pull-request-url }} for more information." | ||
exit 1 | ||
else | ||
echo "PR was merged!" | ||
fi |
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.
What about using:
gh pr checks --watch --json state ${{ steps.open-pr.outputs.pull-request-url }}
sleep 10
PR_STATUS="$(gh pr view ${{ steps.open-pr.outputs.pull-request-number }} --json state -q .state)"
echo "pr_status=$PR_STATUS" >> "$GITHUB_OUTPUT"
and then use other if
condition in other steps to decide what is expected to happne?
steps:
- name: validate PR
id: validate-pr
# ...
- name: Build and Push Bundle Image
if: ${{ contains(steps.validate-pr.outputs.pr_status, 'MERGED') }}
# ...
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.
Maybe I'm not understanding correctly (😅), but the gh pr checks
command seems to return as soon as the PR checks have completed and not when the PR is merged. The need here is to wait until the merge has been completed so we do not build and push a bundle image that is based on content that hasn't actually been committed yet.
* migrate custom script to use Wandalen/wretry.action action * correct pathing in the yq step for the bundle * remove the requirement to specify the operator version
What this PR does / why we need it:
The old pipeline would simply build and push the operator and bundle images. This was a start, but left numerous manual steps to get the Operator itself certified. The changes in this PR add the following enhancements to the pipeline.
make bundle
in the pipeline as opposed to requiring it be run beforehand.USE_IMAGE_DIGESTS=true
when runningmake bundle
to include the image checksums in the bundle. This is a requirement for certification.operator-sdk
.preflight
certificationChecklist
feat(agent,node-analyzer,sysdig-deploy):
)