ci migrate: stop rewriting .github/ references to .depot/ - #554
Closed
robstolarz wants to merge 1 commit into
Closed
ci migrate: stop rewriting .github/ references to .depot/#554robstolarz wants to merge 1 commit into
robstolarz wants to merge 1 commit into
Conversation
`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>
Contributor
Author
|
Closing without merging (DEP-5812). The premise doesn't hold up. This PR stops 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. |
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.


Closes DEP-5812.
depot ci migraterewrote every local.github/reference it found in a migrated workflow to.depot/— actionuses:paths, reusable workflow calls, sparse-checkout inputs, and.github/-looking strings insiderun: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:.github/actions/, not the whole directory. A rewritten path pointing at a sibling file that was never copied resolves to nothing..github/path inside a regex, asedexpression, or a longer string got rewritten as if it were a filesystem reference.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 inrun:, 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 migrateno longer rewrites local.github/paths to.depot/in migrated workflows or copied action files.TransformWorkflowdrops the path-rewrite step, themigratedWorkflowsparameter, andChangePathRewritten; 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.