Skip to content

fix(ci): keep other repositories' checkouts when applying local changes (DEP-8894) - #709

Merged
121watts merged 5 commits into
mainfrom
watts/dep-8894-depot-ci-run-with-local-changes-replaces-the
Nov 19, 2026
Merged

121watts merged 5 commits into
mainfrom
watts/dep-8894-depot-ci-run-with-local-changes-replaces-the

Conversation

@121watts

@121watts 121watts commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

depot ci run stops pointing someone else's repository at our commit. 🎯

What was happening

With local changes, the CLI pinned the first actions/checkout to our merge base, even when that step checks out another repository, so checkout failed with not our ref.

What happens now

The patch goes after the first checkout of the workflow's own repository, and --ssh-after-step follows that same checkout. A literal repository naming another repo (case-insensitive; Entire compared as owner/name) is left alone. If no checkout of the workflow repo exists, the job runs unpatched and warns. Depot Code keeps patching the first checkout, since it only checks out its own repo.

Anything else

Not addressed: a workflow-repo checkout with with.path still gets the patch applied in the workspace root.
Also not addressed: a GitHub repo renamed since it was cloned has a stale name locally, so its own literal checkout runs unpatched with a warning.

🤖 Generated with Claude Code

Catch up on this pull request in Depot


Note

Medium Risk
Changes workflow mutation for every patched depot ci run, but behavior is narrowly scoped to checkout matching with broad test coverage; wrong matching could still skip patches or pin the wrong step.

Overview
Fixes depot ci run local-change injection so it no longer rewrites the first actions/checkout when that step checks out a different repository (which could pin an invalid ref and fail the job).

Patch application and merge-base pinning now target the first checkout that matches the workflow repository via new workflowCheckoutIndex and runRepository.checkoutName() (Entire owner/name, Depot Code empty so the first checkout still qualifies). ${{ github.repository }}, case-insensitive literals, and default checkouts match; explicit checkouts of other repos or non-workflow expressions are left alone. injectTmateStep uses the same index when adjusting step offsets after a patch is injected. Jobs with no matching workflow checkout run without a patch and emit a stderr warning.

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

…es (DEP-8894)

`depot ci run` with local changes pinned the first actions/checkout step to the
merge base, even when that step checks out another repository. Pick the first
checkout of the workflow repository instead, for both the patch step and the
--ssh-after-step offset, and skip the patch with a message when there is none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

DEP-8894

@121watts
121watts marked this pull request as ready for review November 19, 2026 14:59

@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. Cursor Bugbot completed successfully with no findings that need human review, so this change is approved. The CI checkout-selection fix is bounded and covered by tests.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment thread pkg/cmd/ci/run.go Resolved
Comment thread pkg/cmd/ci/run.go Resolved
@121watts

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T15:13:57.355785Z 4af5600 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49eb46b818

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkg/cmd/ci/run.go Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

@121watts

Copy link
Copy Markdown
Contributor Author

@codex review

@121watts

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 3c3c037569

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5328c8daa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkg/cmd/ci/run.go Resolved
@121watts

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 4af5600194

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No new blocking issues. 1 optional suggestion (a nit or a note on pre-existing code) was found and not posted. Nothing in this review needs a push before merging.

@121watts
121watts merged commit b3ff43f into main Nov 19, 2026
13 checks passed
@121watts
121watts deleted the watts/dep-8894-depot-ci-run-with-local-changes-replaces-the branch November 19, 2026 20:08
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