Skip to content

[release/10.0.1xx] Generate baseline-update PRs for internal branches - #7240

Merged
ellahathaway merged 9 commits into
release/10.0.1xxfrom
backport/pr-7051-to-release-10.0.1xx
Jun 16, 2026
Merged

ellahathaway merged 9 commits into
release/10.0.1xxfrom
backport/pr-7051-to-release-10.0.1xx

Conversation

@ellahathaway

@ellahathaway ellahathaway commented Jun 15, 2026 •

Copy link
Copy Markdown
Member

Backport of #7051 to release/10.0.1xx.

cc @mthalman

mthalman and others added 6 commits June 15, 2026 11:09
The baseline-update PR tool previously only knew how to push to GitHub, so `internal/release` builds silently skipped PR creation entirely. The tool now targets the AzDO repo when running on `internal/release/*` branches, while public branches (`main`, `release/*`) continue to use GitHub.

- Replace Octokit with DarcLib's `IRemoteGitRepo` abstraction.

- Use a deterministic head branch name (`pr-baseline-{pipeline}-{sanitized-target}-{hash}`) so PR lookup can work via DarcLib's branch-only `SearchPullRequestsAsync` (DarcLib doesn't expose search-by-title).

- Pipeline YAML: two-level template (wrapper handles branch routing + token selection; runner invokes the tool with a single `GIT_TOKEN` env var). Public branches use `BotAccount-dotnet-sb-bot-pat`; `internal/release` uses a federated-identity-backed AzDO token. The two paths are gated by mutually-exclusive branch conditions so the wrong-provider secret is never in env scope.

- Provider: GitHub-only -> GitHub + AzDO.

- Head branch name: timestamp-based (new branch per run) -> deterministic per pipeline + target branch. Means existing open baseline PRs created by the prior tool will NOT be matched by the new branch-based lookup -- see "Deploy step" below.

- Pre-push merge: the Octokit tool merged target into the PR branch before pushing. DarcLib's `IRemoteGitRepo` abstraction doesn't expose a server-side merge primitive, and adding per-provider escapes for it isn't justified for this use case. Consequence: a long-lived baseline PR may show "behind target" in the PR UI.
Switch the token validation from IsNullOrEmpty to IsNullOrWhiteSpace so a token consisting solely of whitespace (e.g. an unexpanded variable that expanded to spaces) is rejected with the explicit ArgumentException at startup instead of producing a confusing auth failure later.

Co-authored-by: Copilot <[email protected]>
Make the prefix-stripping StartsWith check explicit about its intent by passing StringComparison.Ordinal. File paths are case-sensitive byte sequences (especially on Linux/macOS where the tool actually runs) and should never participate in culture-sensitive collation.

Co-authored-by: Copilot <[email protected]>
The baseline key (e.g. a NuGet id or file name fragment) is matched against repository-relative paths, which are exact byte sequences. Add StringComparison.Ordinal so the lookup is unambiguously culture-insensitive and slightly faster.

Co-authored-by: Copilot <[email protected]>
UpdateFile() locates the existing tree entry by file-name fragment. Path matching here should be culture-insensitive, so make the StringComparison explicit with Ordinal.

Co-authored-by: Copilot <[email protected]>
The try/catch around DeleteBranchAsync swallowed errors and continued, but the subsequent CreateBranchAsync no-ops on an existing ref (both GitHub's POST git/refs and DarcLib's AzDO client treat an existing ref as success). The post-create DoesBranchExistAsync probe then passed against the stale branch and the next CommitFilesWithNoCloningAsync committed on top of leftover content from the previous PR. Drop the catch so deletion failures surface as a pipeline failure instead of producing a quietly-incorrect PR.

Co-authored-by: Copilot <[email protected]>
@ellahathaway
ellahathaway requested review from a team as code owners June 15, 2026 18:12
@ellahathaway
ellahathaway requested a review from mthalman June 16, 2026 18:11
@ellahathaway
ellahathaway enabled auto-merge (squash) June 16, 2026 18:11
@ellahathaway
ellahathaway merged commit 78bac42 into release/10.0.1xx Jun 16, 2026
11 checks passed
@ellahathaway
ellahathaway deleted the backport/pr-7051-to-release-10.0.1xx branch June 16, 2026 19:02
@ellahathaway

Copy link
Copy Markdown
Member Author

/backport to release/10.0.3xx

@ellahathaway

Copy link
Copy Markdown
Member Author

/backport to release/10.0.4xx

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.3xx (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.4xx (link to workflow run)

joeloff pushed a commit to joeloff/dotnet that referenced this pull request Jul 27, 2026
#### AI description  (iteration 1)
#### PR Classification
Integration merge from public release/10.0.1xx branch to internal branch, updating dependency versions and refactoring baseline PR creation tool.

#### PR Summary
This PR merges the public release/10.0.1xx branch into the internal branch, primarily updating package dependency versions across the SDK and refactoring the baseline PR creation tool to use DarcLib instead of Octokit.

- `eng/Version.Details.xml`: Updated all dependency versions (Microsoft.Build, Microsoft.CodeAnalysis, NuGet.*, Microsoft.AspNetCore.*, etc.) from build SHA `fe7283f2bc56523c765bc050be87a97543db180a` to `47c73391bfb8274e379c74c19694ccabff33bc3e`
- `eng/tools/CreateBaselineUpdatePR/PRCreator.cs`: Replaced Octokit-based GitHub API client with DarcLib's IRemoteGitRepo abstraction for cross-provider (GitHub/AzDO) support, changed tree/commit operations to use GitFile-based changesets, and introduced deterministic head branch naming
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->


Related work items: dotnet#7237, dotnet#7238, dotnet#7239, dotnet#7240, dotnet#7244, dotnet#7254, dotnet#7267, dotnet#7268, dotnet#7269, dotnet#7275, dotnet#7304, dotnet#7321, dotnet#7325, dotnet#7332, dotnet#7334, dotnet#7346, dotnet#7358
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.

2 participants