Skip to content

fix(ci): build the CLI before the upgrade workflows' consistency check - #544

Merged
theCodeDrift merged 1 commit into
mainfrom
fix/upgrade-workflows-build-cli
Oct 20, 2026
Merged

theCodeDrift merged 1 commit into
mainfrom
fix/upgrade-workflows-build-cli

Conversation

@theCodeDrift

Copy link
Copy Markdown
Member

Upgrade Vale and Upgrade ast-grep stopped opening pull requests. Both detect the new version (Vale 3.23.0 → 3.24.0, ast-grep 0.45.3 → 0.51.0), then fail at Check the bump is self-consistent, so vendor-pr.cjs never runs:

No test files found, exiting with code 1
Error: dist/index.js does not exist. … run `pnpm build` first.

The step's comment said engine-version-consistency "needs no build", which was true until d244640 (2026-10-01) added test/support/distribution-snapshot.ts as a globalSetup for the whole cli vitest project. That setup snapshots dist/ on every run and throws before selecting a test file when there is none. Vale has been red since the 3.24.0 publish on 2026-10-05, ast-grep since 2026-10-12. Earlier runs were green only because there was nothing to upgrade.

This adds a Build the CLI step after the regenerate step in both workflows, so the bundle carries the new vocabulary or schema, and corrects the comment. The Vale contract-suite report step had the same failure hidden behind continue-on-error and is covered by the same build. dist/ is not pushed: vendor-pr.cjs gets an explicit path list.

Verified locally: without a build the test fails with the error above; after pnpm --filter @taskless/cli build it passes 8/8. pnpm test:scripts passes. Not exercised end to end; after merge, dispatch both workflows to open the pending upgrades.

No changeset: CI-only, nothing ships to a consumer.

The cli vitest project's globalSetup snapshots dist/ and throws when it is
missing, so since 2026-10-01 every Vale and ast-grep upgrade run that found a
new version failed before selecting a test and proposed no pull request.
@theCodeDrift

Copy link
Copy Markdown
Member Author

@claude /review

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @theCodeDrift's task in 1m 43s —— View job


Review mode: incremental — read 1 prior review thread(s) before reviewing.

.prior-review.json contained no review threads and no prior review bodies — only the trigger comment itself (@claude /review). This is therefore the first review of this PR; everything below is assessed fresh against the whole diff.

  • Read .prior-review.json
  • Fetch PR diff and metadata (gh pr diff, gh pr view)
  • Read both full workflow files for context the diff hunks don't show
  • Read test/support/distribution-snapshot.ts and engine-version-consistency.test.ts to verify the stated root cause
  • Read vendor-pr.cjs to verify dist/ can't leak into the pushed commit
  • Check AGENTS.md for the changeset policy
  • Post findings

Assessment

The diagnosis checks out. test/support/distribution-snapshot.ts's setup() only checks for dist/index.js's existence (via existsSync) before throwing "dist/index.js does not exist... run pnpm build first" — it does no content comparison against a stored snapshot, so simply building before the cli vitest project runs is a complete fix, not a partial workaround. engine-version-consistency.test.ts itself only imports source (../src/rules/capabilities, etc.) and never touches dist/, confirming the failure is entirely in the shared globalSetup, exactly as the PR body states.

The new Build the CLI step is placed correctly in both workflows: after Install (so node_modules exists) and after the schema/vocabulary regeneration steps (generate:ast-grep-schema / generate:vale-schema, both plain tsx scripts unrelated to the vitest project, so ordering relative to them doesn't matter), and before Check the bump is self-consistent. In vale-upgrade.yml it also lands before Run the Vale contract suites, so the second failure described in the PR body (masked by continue-on-error) is fixed by the same step — confirmed by reading that step, which runs under --project cli and therefore hits the same globalSetup.

dist/ staying out of the pushed commit is already guaranteed independently of this PR: vendor-pr.cjs stages only the explicit path list passed after -- (git add -- <paths>), and that list in both workflows' Propose the … steps was not changed by this diff. So the PR body's "vendor-pr.cjs gets an explicit path list" is describing existing, unmodified behavior rather than a new guard — accurate, just worth noting it's not this diff's doing.

The corrected step comments read consistently with the surrounding file's documentation style, the if: steps.detect.outputs.update == 'true' gating matches the pattern used by every other conditional step, and the "No changeset" framing matches AGENTS.md's policy (changesets are for consumer-visible release notes; this only touches .github/workflows/*.yml).

No correctness, security, or test-adequacy issues found. The diff is minimal, directly targets the documented root cause, and the accompanying comment edits remove the now-false "needs no build" claim without introducing new ones.

@theCodeDrift

Copy link
Copy Markdown
Member Author

Re: @github-actions — "Claude finished @theCodeDrift's task in 1m 43s…"
#544 (comment)

Thanks: no findings to act on. Agreed on the note that the explicit path list in vendor-pr.cjs is existing behavior this diff relies on, not a new guard.

— AI Coding Agent

@theCodeDrift
theCodeDrift merged commit 933301a into main Oct 20, 2026
8 checks passed
@theCodeDrift
theCodeDrift deleted the fix/upgrade-workflows-build-cli branch October 20, 2026 20:10
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