Skip to content

Bypass Packagist for the package under test in module-ci.yml#1060

Merged
mikelittle merged 2 commits into
masterfrom
fix-packagist-replication-lag
May 14, 2026
Merged

Bypass Packagist for the package under test in module-ci.yml#1060
mikelittle merged 2 commits into
masterfrom
fix-packagist-replication-lag

Conversation

@mikelittle
Copy link
Copy Markdown
Contributor

Summary

  • Register the module's GitHub repo as a vcs composer source in module-ci.yml before the existing inject step, so composer require <pkg>:dev-<branch> resolves against the git remote rather than Packagist.
  • Packagist's CDN can lag 30-90s behind a freshly pushed branch, causing Could not find package … with version dev-<branch> failures on PRs whose CI starts immediately after the push. Pulling from GitHub directly always sees the new branch.

Why

Concrete repro: PR #1059 (Dependabot config tweak) — workflow ran ~61s after branch push, Packagist hadn't replicated dev-dependabot-patch-only-non-master yet, composer require failed. A re-run minutes later succeeded with no code changes.

Travis didn't have this race because it pulled directly from a VCS repo. The new GHA workflow goes through Packagist, which is fine for normal use but flaky for "CI immediately after branch push." Most affected: Dependabot PRs, since they always trigger CI within seconds of pushing the branch.

Scope of the change

  • The composer config repositories.<pkg> vcs <url> runs in \$HOME/test-root (the throwaway skeleton clone the workflow creates each run). It mutates only that ephemeral composer.json.
  • No module's own composer.json is touched, no Packagist-side config changes, nothing user-facing.
  • Convention assumed: altis/<name> lives at humanmade/altis-<name>.git. True for every module today.

Follow-up after merge

Module callers pin this workflow by SHA in their own .github/workflows/ci.yml. After merge, run humanmade/altis/scripts/update-module-gha-ref.sh to re-pin the 12 callers — same script used after #1056.

Test plan

  • CI on this PR (the Module CI self-test) passes.
  • After merge + re-pinning, force a re-run on a Dependabot PR that previously hit the lag — should now resolve cleanly.

🤖 Generated with Claude Code

Register the module's GitHub repo as a `vcs` composer source before the
inject step, so `composer require <pkg>:dev-<branch>` resolves against
the git remote rather than Packagist. Packagist's CDN can lag 30-90s
behind a freshly pushed branch, which causes spurious "Could not find
package" failures on PRs whose CI starts immediately after the push
(e.g. altis-dev-tools#1059, where the workflow ran 61s after branch
push and Packagist had not yet replicated the new branch).

The git remote always sees the new branch, so this race is eliminated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/module-ci.yml Outdated
Copy link
Copy Markdown
Contributor

@jerico jerico left a comment

Choose a reason for hiding this comment

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

Aside from verbose comments, it's working as expected. Verified on humanmade/altis-sso#179 by rerunning the CI

@mikelittle mikelittle merged commit e060ae4 into master May 14, 2026
0 of 2 checks passed
@mikelittle mikelittle deleted the fix-packagist-replication-lag branch May 14, 2026 08:19
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.

2 participants