Skip to content
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

Fix cross-repo race condition #4404

Merged
merged 6 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ default:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab/Dockerfile-*
when: manual
- .gitlab/Dockerfile-* # these are direct dependencies
- .gitlab-ci.yml # list of images is here so it is a dependency too
allow_failure: true
image: $DOCKER_REGISTRY/docker:20.10.13
parallel:
Expand Down Expand Up @@ -54,7 +54,13 @@ build-image-arm64:

promote-image:
stage: manual-images
when: manual
rules: # same as build-image
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "push"
changes:
- .gitlab/Dockerfile-* # these are direct dependencies
- .gitlab-ci.yml # list of images is here so it is a dependency too
when: manual # this one is manual, but it means that install-dependencies may be hitting the wrong <base>:current til this is run
allow_failure: true
tags: ["runner:docker"]
image: $DOCKER_REGISTRY/docker:20.10.13
parallel:
Expand Down Expand Up @@ -162,16 +168,11 @@ deploy_to_reliability_env:
# Due to the constraints of Github workflow dispatch endpoint, it does not return the workflow run id.
# https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event
#
# We fetch the latest workflow run from vaccine after 5 seconds of the dispatch event.
# False positive/negative result can happen when multiple requests are made within the same window.
#
# TODO:
# Replace polling implementation with reporting status to Github with Github App. This will allow us
# to get a deterministic result without mismatched workflow run id.
# We fetch the latest workflow runs from vaccine then match against the run name, polling until we find it.
vaccine:
image: $DOCKER_REGISTRY/docker:20.10.13
tags: [ "arch:amd64" ]
stage: vaccine
needs: [create-multiarch-lib-injection-image]
script: |
.gitlab/scripts/vaccine.sh
.gitlab/scripts/vaccine.sh master "${CI_COMMIT_SHA}" "glci:${CI_PIPELINE_ID}"
Loading
Loading