Repository navigation
ci(ci): Build the CI image automatically from a hash of its inputs - #5336
Closed
thomas-lebeau wants to merge 1 commit into
Closed
thomas-lebeau wants to merge 1 commit into
thomas-lebeau wants to merge 1 commit into
Conversation
The CI image tag was a hand-bumped CURRENT_CI_IMAGE integer, and someone had to play the manual ci-image job. The ci-image job now runs first in every pipeline: it computes the tag from a hash of the Dockerfile, .gitlab/ci-image.yml, CHROME_PACKAGE_VERSION and the Playwright version, builds the image only when the tag is missing, and gives CI_IMAGE to the other jobs through a dotenv report.
Bundles Sizes Evolution
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 57f64d2 | Docs | View more details | Give us feedback! |
Collaborator
Author
|
Closing: too complicated for the gain. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
A Node.js, Playwright or Chrome update changes the CI image. Today, someone must:
CURRENT_CI_IMAGEin.gitlab-ci.yml(and stack the PRs when there are several image updates).ci-imagejob.These steps are manual, and the human commit prevents the PR auto-approver from approving these updates.
Refs: SCMGMT-1036
Changes
.gitlab/ci-image.ymldefines theci-imagejob. The job runs in the first stage of every pipeline. It:Dockerfile,.gitlab/ci-image.yml,CHROME_PACKAGE_VERSIONand the root@playwright/testversion.CI_IMAGEto the other jobs through a dotenv report.CURRENT_CI_IMAGEand the globalCI_IMAGEare removed. The jobs keepimage: $CI_IMAGE. GitLab expandsimage:on the runner, where the dotenv variables are available.needs:only gets the dotenv variables of the jobs in itsneeds:, sounit-bsnow needsci-image.ci-imagejob calculates the tag again (the image exists), and every job withneeds:also needsci-image.CHROME_PACKAGE_VERSION.handling-dependency-prsskill no longer stacks image PRs or asks to playci-image.To rebuild the image without changing its inputs (for example to get a newer
commit-headless), change a comment in theDockerfile.Not sure about:
ci-imagejob (about 30 seconds when the image exists) before the other jobs.Follow-ups:
CURRENT_CI_IMAGE+1. It must accept a change ofCHROME_PACKAGE_VERSIONonly.Test instructions
In this PR's pipeline:
ci-imagebuilds the imageregistry.ddbuild.io/ci/browser-sdk:<hash>.ci-image: it skips the build.Checklist