Skip to content

fix(ci): declare the image-tag output that seven e2e jobs already consume - #6593

Merged
robfrank merged 1 commit into
mainfrom
fix/4894-declare-image-tag-output
Aug 22, 2026
Merged

robfrank merged 1 commit into
mainfrom
fix/4894-declare-image-tag-output

Conversation

@robfrank

Copy link
Copy Markdown
Collaborator

build-and-package never declared an outputs: block, yet seven jobs pass needs.build-and-package.outputs.image-tag as ARCADEDB_DOCKER_IMAGE. All seven have been receiving an empty string.

Found by the M2 client smoke job (#6585) on its first run: it failed in 42 seconds with (HTTP code 400) unexpected - invalid reference format, because Docker was handed an empty image reference.

Why nobody noticed

Every existing consumer is defensive in a way that hides it:

  • e2e-go/fixtures_test.go:101 guards strings.TrimSpace(os.Getenv(...)) != ""
  • e2e-js/src/js-bolt-conformance.test.js:36 uses process.env.ARCADEDB_DOCKER_IMAGE || "arcadedata/arcadedb:latest"
  • e2e-js/src/js-pg-e2e.test.js and js-bolt-e2e.test.js hardcode arcadedata/arcadedb:latest and ignore the variable entirely

And because Save docker image saves only the :latest tag, those fallbacks happen to land on the freshly built image. The suites have been testing the right thing by luck rather than by instruction.

The documented intent has never actually held. e2e-go/README.md:53-54 says "In CI the branch-built image is docker loaded under the tag passed via ARCADEDB_DOCKER_IMAGE" - it is loaded, but the tag passed is "".

The fix

Declare the output. arcadedata/arcadedb:latest is the correct value rather than the project version, because the artifact carries no other tag: after docker load in a consuming job, :latest is the only reference that resolves.

This is a no-op for the four suites that already fall back to :latest. It makes the seven references honest, and it makes the intent enforceable rather than accidental.

Also adds a guard to the client-smoke-test job: it now refuses to run on an empty ARCADEDB_DOCKER_IMAGE instead of letting the client's e2e suite fall back to its published pin. That fallback is correct in the clients repository's own CI and wrong here - a smoke test that quietly tests a released server would report green while telling us nothing about the commit under review. That is precisely how the first run failed, and a loud refusal is better than a green lie.

Verification

The workflow parses; build-and-package now exposes image-tag, and all seven consumers still resolve. The real verification is this pull request's own run: client-smoke-test should now print Smoke-testing the client against arcadedata/arcadedb:latest and complete the suite rather than dying on an invalid reference.

Worth noting what this says about the smoke job itself: its first run found a latent defect in the CI harness rather than in the OpenAPI contract. Not the class of bug it was built for, but it did exactly what a smoke test is supposed to do, and it surfaced something four existing suites had been papering over.

@mergify

mergify Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@codacy-production

codacy-production Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Coverage ∅ diff coverage · -6.53% coverage variation

Metric Results
Coverage variation ✅ -6.53% coverage variation
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (b6cfc6e) 164679 131743 80.00%
Head commit (fa4b030) 197066 (+32387) 144786 (+13043) 73.47% (-6.53%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6593) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@claude

claude Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review

Small, well-scoped CI fix. Verified against the full mvn-test.yml (not just the diff):

Correctness — confirmed

  • build-and-package genuinely had no outputs: block while 7 downstream jobs (java-e2e-tests, js-e2e-tests, client-smoke-test, studio-e2e-tests, python-e2e-tests, csharp-e2e-tests, go-e2e-tests) reference needs.build-and-package.outputs.image-tag — an undeclared output silently resolves to "" in GitHub Actions, which matches the reported invalid reference format failure exactly.
  • All 7 consuming jobs already list build-and-package in needs:, so the new output will actually resolve for each of them — no job is missing the dependency edge.
  • The hardcoded literal arcadedata/arcadedb:latest (rather than deriving it from steps.get-version.outputs.version or similar) is correct given the existing, unmodified Save docker image step: docker save arcadedata/arcadedb:latest > /tmp/arcadedb-image.tar only packs the :latest tag into the tar, even though package/pom.xml builds the image under both latest and ${project.version} tags locally. Since only :latest survives into the artifact that downstream jobs docker load, that's the only reference guaranteed to resolve after load — the PR description's reasoning checks out against the actual plugin config.

Guard in client-smoke-test

  • The added if [ -z "$ARCADEDB_DOCKER_IMAGE" ]; then ... exit 1; fi is a reasonable regression guard: it turns "silently test a published image and report green" into a loud, explicit failure. Since the job already has continue-on-error: true, this won't newly block PRs — it just makes the failure mode legible in logs/summary instead of a confusing Docker error.
  • Minor: this guard is now effectively dead code given the output is always populated going forward, but that's exactly the point — it's cheap insurance against the same class of regression (someone editing build-and-package again and dropping the output) recurring silently.

Scope

  • Diff is minimal (25 additions, 0 deletions, one file) and matches the PR description precisely — no unrelated changes.
  • The four other pre-existing defensive fallbacks (e2e-go's != "" guard, js-bolt-conformance's || fallback, and the two hardcoded e2e-js suites) are correctly left alone since they already degrade to the right image by luck; fixing the root cause makes that luck unnecessary without having to touch those files.

Nit / follow-up idea (non-blocking)

  • check-workflow-artifact-deps.py catches artifact-download-before-upload races but wouldn't have caught this class of bug (a needs.<job>.outputs.<x> reference to an output the job never declares). Since GitHub Actions accepts that reference as valid YAML and just silently yields "", it might be worth a small follow-up lint script that resolves every needs.*.outputs.* expression against the referenced job's declared outputs: block, the same way the artifact-deps script resolves upload/download pairs. Not a blocker for this PR — just noting it since this exact failure mode (valid-looking YAML, silently wrong at runtime) is precisely what that earlier script was built to prevent for artifacts.

No code correctness, security, or performance concerns — this is a CI-workflow-only change and the fix is verifiably consistent with the rest of the file.

@robfrank

Copy link
Copy Markdown
Collaborator Author

Confirmed the two things you verified that I had asserted without checking: all seven consumers do already carry the needs: build-and-package edge, and package/pom.xml tags both latest and ${project.version} locally while Save docker image packs only :latest into the tar. That second one is what makes the hardcoded literal correct rather than lazy, so it is worth having independently confirmed.

On the guard being dead code once the output is populated: agreed, and that is the intent. It costs one shell test and converts the same class of regression from a confusing invalid reference format into a named failure. The first run of this job died exactly that way, and the error pointed at Docker rather than at the missing output.

On the lint idea: taking it, as a separate PR rather than here. check-workflow-artifact-deps.py already exists and already runs in setup, so a sibling check that resolves every needs.<job>.outputs.<name> against the referenced job's declared outputs: block has an obvious home and needs no new wiring. It is also real code that deserves its own review rather than riding along on a 25-line workflow fix.

Worth recording why this bug survived: it is not that nobody looked, it is that four separate consumers were each defensive enough to hide it. e2e-go guards != "", js-bolt-conformance uses ||, and two e2e-js suites hardcode :latest outright. Every one of those fallbacks lands on the right image because the artifact only carries :latest, so the suites were correct by luck. The only consumer strict enough to fail was a new one using ??, which does not treat "" as absent. A lint that checks the reference rather than the runtime behaviour is the right shape of fix precisely because the runtime behaviour was indistinguishable from working.

@robfrank
robfrank merged commit cd29d8a into main Aug 22, 2026
28 of 29 checks passed
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.31%. Comparing base (b6cfc6e) to head (fa4b030).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6593      +/-   ##
==========================================
- Coverage   71.31%   71.31%   -0.01%     
==========================================
  Files        1868     1868              
  Lines      164679   164679              
  Branches    34806    34806              
==========================================
- Hits       117447   117442       -5     
- Misses      32977    32979       +2     
- Partials    14255    14258       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@robfrank
robfrank deleted the fix/4894-declare-image-tag-output branch August 26, 2026 09:09
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.

1 participant