fix(ci): force build integ test images on pushes to develop#21726
fix(ci): force build integ test images on pushes to develop#21726
Conversation
|
✅ No conflicts with other open PRs targeting |
There was a problem hiding this comment.
Pull request overview
Risk Rating: MEDIUM — modifies CI control flow for building/pushing integration-test Docker images on push events to develop, which can impact CI cost and reliability.
This PR updates the Integration Tests workflow so that Chainlink integration test images are force-built on pushes to develop to help populate Docker layer cache.
Changes:
- Rename the matrix boolean from
should-buildtoany-should-runand route build gating through a dedicated “explain” step output (build-image). - Force image builds on
pushevents to thedevelopbranch (regardless of whether tests will run / whether the image already exists). - Update downstream steps to use
steps.explain.outputs.build-imagefor conditional checkout/build.
| if [[ "${EVENT_NAME}" == "push" && "${REF_NAME}" == "develop" ]]; then | ||
| echo "We force build on pushes to develop to populate the docker layer cache." | ||
| echo "build-image=true" | tee -a "$GITHUB_OUTPUT" | ||
| elif [[ "${ANY_SHOULD_RUN}" == "true" && "${IMAGE_EXISTS}" == "false" ]]; then |
There was a problem hiding this comment.
The IMAGE_EXISTS check is stricter than the prior logic. steps.check-image-exists.outputs.exists is commonly compared as != 'true' (treating empty/unknown as not-existing), but here the script only builds when IMAGE_EXISTS == 'false'. If the action ever returns an empty string or another falsy value, this will incorrectly skip builds. Consider changing the condition to build when IMAGE_EXISTS != 'true' (and/or normalizing the value before the comparison).
| elif [[ "${ANY_SHOULD_RUN}" == "true" && "${IMAGE_EXISTS}" == "false" ]]; then | |
| elif [[ "${ANY_SHOULD_RUN}" == "true" && "${IMAGE_EXISTS}" != "true" ]]; then |
| echo "We will build the image because the matrix's any-should-run is true and the image does not already exist in ECR." | ||
| echo "any-should-run is true when:" | ||
| echo " - For the non-plugins image: the core tests, ccip tests, or solana tests will be run." | ||
| echo " - For the plugins image: the core cre e2e tests will be run." |
There was a problem hiding this comment.
The explanation text for any-should-run doesn't match the actual matrix condition. In the matrix, any-should-run for the (plugins) image is true when core/ccip/solana/cre setups request runs, but the message says it is only true when core CRE e2e tests will be run. This can mislead debugging; either adjust the message to match the condition or narrow the plugins matrix condition to what the message states.
| echo " - For the plugins image: the core cre e2e tests will be run." | |
| echo " - For the plugins image: the core tests, ccip tests, solana tests, or core cre e2e tests will be run." |
| if [[ "${EVENT_NAME}" == "push" && "${REF_NAME}" == "develop" ]]; then | ||
| echo "We force build on pushes to develop to populate the docker layer cache." | ||
| echo "build-image=true" | tee -a "$GITHUB_OUTPUT" | ||
| elif [[ "${ANY_SHOULD_RUN}" == "true" && "${IMAGE_EXISTS}" == "false" ]]; then |
There was a problem hiding this comment.
On push to develop you force a rebuild, but you still run the ECR existence check first. Since the result is ignored in that branch, consider skipping Check if image exists in ECR for that event/branch to save AWS API calls and a bit of job time (e.g., gate the step with an if or move the force-build decision ahead of the check).
Ensure we build integ tests images on pushes to develop, to populate docker layer cache.