Skip to content

Avoid fallback download of artifacts when not on develop #18785

Merged
maurelian merged 5 commits intoproposal/op-contracts/v6.0.0from
jm/fix-artifact-dl
Jan 19, 2026
Merged

Avoid fallback download of artifacts when not on develop #18785
maurelian merged 5 commits intoproposal/op-contracts/v6.0.0from
jm/fix-artifact-dl

Conversation

@maurelian
Copy link
Contributor

@maurelian maurelian commented Jan 14, 2026

This is a cherry pick onto the v6 proposal branch of #18788.

Summary

Avoids the fallback download of artifacts when not on develop.

This is achieved by refactoring the get-target-branch logic from CircleCI config into a reusable script that can be sourced by the use-latest-fallback script

Changes

  • Created scripts/ops/get-target-branch.sh containing the target branch detection logic
  • Updated scripts/ops/use-latest-fallback.sh to source the new script
  • Updated scripts/checks/check-semver-diff.sh to source the new script
  • Updated .circleci/config.yml to use the new script

Benefits

  • Scripts are now self-contained and determine TARGET_BRANCH themselves
  • Can be tested locally without CircleCI environment variables
  • Single source of truth for target branch logic
  • Less duplication in CircleCI config

@maurelian maurelian requested review from a team as code owners January 14, 2026 20:06
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.59%. Comparing base (018f5ae) to head (b2e704b).
⚠️ Report is 2 commits behind head on proposal/op-contracts/v6.0.0.

Additional details and impacted files
@@                       Coverage Diff                        @@
##           proposal/op-contracts/v6.0.0   #18785      +/-   ##
================================================================
- Coverage                         71.34%   68.59%   -2.76%     
================================================================
  Files                               185      185              
  Lines                             10914    10914              
================================================================
- Hits                               7787     7486     -301     
- Misses                             2983     3284     +301     
  Partials                            144      144              
Flag Coverage Δ
cannon-go-tests-64 66.58% <ø> (ø)
contracts-bedrock-tests 69.76% <ø> (-4.38%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maurelian maurelian force-pushed the jm/fix-artifact-dl branch 2 times, most recently from 883e125 to be71a3f Compare January 14, 2026 21:22
@maurelian maurelian changed the title fix: do not use fallback artifacts on PRs branches other than develop Avoid fallback download of artifacts when not on develop Jan 14, 2026
Comment on lines 59 to 63
if [ "$USE_FALLBACK" = "true" ]; then
bash scripts/ops/pull-artifacts.sh --fallback-to-latest

j bash scripts/ops/pull-artifacts.sh --fallback-to-latest
else
bash scripts/ops/pull-artifacts.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low Severity severity

Denial of Service (DoS): CI script fails artifact pull in use-latest-fallback.sh

use-latest-fallback.sh contains a stray j before the bash invocation, which will trigger command not found and (due to set -euo pipefail) abort the script, preventing artifact pulling and potentially failing the entire CI job.

Remove the stray j and ensure the fallback path executes bash scripts/ops/pull-artifacts.sh --fallback-to-latest as intended.

Suggested change
if [ "$USE_FALLBACK" = "true" ]; then
bash scripts/ops/pull-artifacts.sh --fallback-to-latest
j bash scripts/ops/pull-artifacts.sh --fallback-to-latest
else
bash scripts/ops/pull-artifacts.sh
if [ "$USE_FALLBACK" = "true" ]; then
bash scripts/ops/pull-artifacts.sh --fallback-to-latest
else
bash scripts/ops/pull-artifacts.sh

Don't like this finding? Reply "dismiss" and it won't appear again in future scans.

If it's acknowledged or addressed, reply "resolve" to mark it resolved.

@maurelian maurelian merged commit 817b35d into proposal/op-contracts/v6.0.0 Jan 19, 2026
79 checks passed
@maurelian maurelian deleted the jm/fix-artifact-dl branch January 19, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants