Skip to content

ci migrate: stop rewriting .github/ references to .depot/ - #554

Closed
robstolarz wants to merge 1 commit into
mainfrom
rob/dep-5812-migrate-no-path-rewrite
Closed

ci migrate: stop rewriting .github/ references to .depot/#554
robstolarz wants to merge 1 commit into
mainfrom
rob/dep-5812-migrate-no-path-rewrite

Conversation

@robstolarz

@robstolarz robstolarz commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Closes DEP-5812.

depot ci migrate rewrote every local .github/ reference it found in a migrated workflow to .depot/ — action uses: paths, reusable workflow calls, sparse-checkout inputs, and .github/-looking strings inside run: blocks and comments.

It doesn't need to. Depot's IR converter already resolves a local reference wherever it leads: it maps .github/ to the compile-time checkout itself, and accepts either prefix for reusable workflow calls. So the rewrite bought nothing, and it cost three things:

  • It broke references to anything that stayed behind. Migration copies .github/actions/, not the whole directory. A rewritten path pointing at a sibling file that was never copied resolves to nothing.
  • It corrupted paths embedded in shell. A .github/ path inside a regex, a sed expression, or a longer string got rewritten as if it were a filesystem reference.
  • It made the migration diff bigger than the migration. Every reference in the file changed, so the reviewer couldn't see the changes that mattered.

Now the references are left exactly as the author wrote them, and only the actual compatibility corrections show up in the diff.

The copy of .github/actions/ into .depot/actions/ stays: the compile-time checkout is sparse to .depot/, so the actions have to exist there even though the workflow still points at .github/actions/.

Tests

The eleven tests asserting the rewriting behavior are replaced by one that asserts the inverse — every form of local .github/ reference survives migration untouched: action refs (with and without ./), reusable workflow calls, sparse-checkout inputs, script paths in run:, and paths inside comments.

Why this is safe — the resolution path

The api-side converter maps .github/ to .depot/ unconditionally when resolving a local action ref, and accepts either prefix for a reusable workflow call. Existing api compile tests already exercise ./.github/actions/... and ./.github/workflows/... refs end to end and pass, so the CLI-side rewrite was redundant rather than load-bearing.

Compile-time checkout is cone-mode sparse to .depot/; run-time checkout is full. That asymmetry is why the copy is still required and the rewrite is not.


Note

Medium Risk
Behavior change to a core migrate path: workflows and actions may still reference .github/ while files also exist under .depot/, relying on Depot’s resolver instead of rewritten paths.

Overview
depot ci migrate no longer rewrites local .github/ paths to .depot/ in migrated workflows or copied action files. TransformWorkflow drops the path-rewrite step, the migratedWorkflows parameter, and ChangePathRewritten; migrate still copies .github/actions/ into .depot/actions/ but skips post-copy text rewriting.

Migrated YAML keeps action uses:, reusable workflow calls, sparse-checkout lines, run: script paths, and comment strings exactly as written. Depot resolves those references without the CLI rewrite, which avoids broken siblings left under .github/ and shrinks migration diffs to real compatibility edits (runs-on, triggers, disabled jobs).

Tests that expected rewrites are removed and replaced with TestTransformWorkflow_PreservesGitHubPaths, which asserts no .depot/ substitutions across the common reference forms.

Reviewed by Cursor Bugbot for commit b03449f. Bugbot is set up for automated code reviews on this repo. Configure here.

`depot ci migrate` copied `.github/actions/` into `.depot/actions/` and then
rewrote every `.github/(actions|workflows)` reference it could find — in the
workflow YAML, in YAML comments, and in the copied action sources — to point at
`.depot/`.

The rewrite is redundant. Depot resolves a local `.github/` reference wherever
it leads: the IR converter maps `.github/` to `.depot/` when it resolves an
action path, and accepts either prefix when resolving a reusable workflow call.
So the migrated file runs identically whether or not the paths were edited.

It is also actively harmful. Only `.github/actions` and the selected workflows
are copied, so a rewritten reference to anything that stayed behind — a helper
script, a config file, a workflow the user chose not to migrate — dangled after
migration. Rewriting a `sparse-checkout` entry stopped git materializing
`.github/` at all. And a rewrite fires on any textual match, so a regex in an
action's source that deliberately matched the repo's real `.github` directory
silently stopped matching.

Dropping the pass removes all three failure modes and leaves the migrated
workflow reading like the file the author wrote. The copy into `.depot/actions/`
stays: the compile-time checkout is sparse to `.depot/`, so the action
directories do have to exist there.

Refs DEP-5812, DEP-5306.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Aug 14, 2026

Copy link
Copy Markdown

DEP-5812

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: medium. Approved; Cursor Bugbot and Cursor Security Agent completed successfully with no findings that need human review. No reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@robstolarz

Copy link
Copy Markdown
Contributor Author

Closing without merging (DEP-5812).

The premise doesn't hold up. This PR stops ci migrate from rewriting .github/ references to .depot/, on the theory that the rewrite is unnecessary work. On review the rewrite is doing something load-bearing: a migrated workflow that still points at .github/ paths resolves against a directory the migrated layout doesn't populate, so removing the rewrite trades a cosmetic diff for references that silently resolve to nothing.

The narrower YAML-fidelity concern that motivated looking here is handled separately in #555 / #533. Reopen if the reference-resolution question turns out differently than the above.

@robstolarz robstolarz closed this Aug 14, 2026
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