Fix cache key in nx-integration-tests using undefined inputs.ref#379
Merged
rhoerr merged 1 commit intoMay 27, 2026
Merged
Conversation
The integration-tests job restored the project cache with:
key: ${{ runner.os }}-project-${{ inputs.ref }}
But `inputs.ref` is not a defined input for this workflow — the
declared inputs are `repository`, `pr_head`, and `pr_base`. The
expression resolved to an empty string, producing the key
`Linux-project-` on every run, which never matched the entry saved
by the nx-project-setup job (which used `inputs.pr_head` as the
ref throughout).
The result was a guaranteed cache miss on any fresh PR run: the
`./main` directory was empty when the integration-tests job started,
the PHPUnit bootstrap fell back to running `setup:install` against
a `tmp-mysql` container that had never been initialised, and the
entire suite crashed at bootstrap before a single test executed.
Fix: replace `inputs.ref` with `inputs.pr_head`, consistent with
every other place in this workflow that references the head SHA.
4 tasks
rhoerr
approved these changes
May 27, 2026
Contributor
rhoerr
left a comment
There was a problem hiding this comment.
Thank you @thebraziliandeveloper
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The
integration-testsjob innx-integration-tests.ymlrestores the project cache with:But
inputs.refis not a defined input for this workflow — the declared inputs arerepository,pr_head, andpr_base. The expression resolves to an empty string on every run, producing the cache keyLinux-project-, which never matches the entry saved by thenx-project-setupjob (which correctly usesinputs.pr_headas the ref throughout).Effect: guaranteed cache miss on any fresh PR run. The
./maindirectory is empty when theintegration-testsjob starts, the PHPUnit bootstrap falls back to runningsetup:installagainst atmp-mysqlcontainer that was never initialised, and the entire suite crashes at bootstrap before a single test executes. The failure looks like a code or infrastructure problem but is purely a missing cache hit.This explains why integration tests pass when a warm cache happens to be present on the runner (the key
Linux-project-accidentally matches a stale entry) but fail consistently on new or retargeted PRs.Fix
Replace
inputs.refwithinputs.pr_head, consistent with every other place in this workflow that references the head SHA.Test plan
mageos-magento2— integration-tests job should now find the cache saved bynx-project-setupand proceed past bootstrap