fix(safe-outputs): reject cross-organization repos in create-pull-request - #1935
Draft
jamesadevine with Copilot wants to merge 2 commits into
Draft
fix(safe-outputs): reject cross-organization repos in create-pull-request#1935jamesadevine with Copilot wants to merge 2 commits into
jamesadevine with Copilot wants to merge 2 commits into
Conversation
|
Azure Pipelines: 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
2 tasks
…uest Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix create-pull-request targeting issue with Azure DevOps
fix(safe-outputs): reject cross-organization repos in create-pull-request
Aug 17, 2026
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.
Summary
create-pull-requestcomposes every Azure DevOps Git REST call from the pipeline's own organization/project, so arepos:alias checked out from a different organization via anendpoint:service connection resolves against the wrong org and fails with a confusing 404 — invisible under--dry-run, which skips the API call entirely.Changes
FrontMatter::checkout_cross_organization_repo_aliases()flags checked-outrepos:aliases that aretype: gitwithendpoint:set — the existing documented signal for a cross-organization repository.create-pull-requestis enabled alongside a cross-organization alias, surfacing the mismatch before the pipeline ever runs.ExecutionContextgainscross_organization_repositories, threaded through both execution paths (--sourcefront-matter and compiled--resolved-config).create-pull-request's executor now rejects a cross-organization target with a clear, actionable error before the dry-run short-circuit, so--dry-runreports the real failure instead of a false "would execute" success.docs/safe-outputs.mdanddocs/front-matter.mddocument the limitation.This does not implement full cross-organization support (composing the request against the alias's own organization via its
endpoint:credential) — resolving a credential for another Azure DevOps organization at Stage 3 is a larger follow-up. This change turns a silent, delayed failure into an immediate, actionable one.Compiling this now warns, and targeting
nc-api-testingat runtime (or under--dry-run) fails with an explicit "cross-organization" error instead of a wrong-org 404.Test plan
cargo test --bin ado-awandcargo test --test compiler_testscargo clippy --all-targetsrepos:shape, confirming the warning fires and compilation still succeedscreate-pull-requestcannot target a repository from another Azure DevOps organisation #1934