Skip to content

[release/10.0] Remove OneLoc PAT dependencies - #17456

Merged
missymessa merged 12 commits into
dotnet:release/10.0from
missymessa:missymessa/oneloc-pat-fallback-cleanup-release-10.0
Sep 9, 2026
Merged

missymessa merged 12 commits into
dotnet:release/10.0from
missymessa:missymessa/oneloc-pat-fallback-cleanup-release-10.0

Conversation

@missymessa

@missymessa missymessa commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • backport complete removal of the OneLocBuildVariables variable group to release/10.0
  • remove the Ceapex and GitHub PAT parameters and all fallback paths
  • require short-lived Ceapex WIF and GitHub App tokens in the provisioned projects
  • update the OneLoc authentication documentation

Backport of the main cleanup for AB#10151 and AB#12331.

Import the legacy variable group only when the Ceapex or GitHub PAT fallback can be selected.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: bc4e1c74-f3b4-4965-932e-5e63cff7e877
@missymessa
missymessa requested review from mmitche and a lite review from Copilot August 31, 2026 16:11

Copilot AI 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.

🟢 Approval recommended

Pull request overview

This PR backports an update to the OneLocBuild job template on release/10.0 to avoid hydrating the legacy OneLoc variable group (and its PAT secrets) when neither the Ceapex PAT nor GitHub PAT fallback can be used.

Changes:

  • Conditionally attaches the OneLocBuildVariables variable group only when Ceapex PAT or GitHub PAT fallback authentication may be selected.
  • Skips legacy PAT hydration when the job is configured to use both the Ceapex service-connection (Entra/WIF) flow and GitHub App authentication.
File summaries
File Description
eng/common/core-templates/job/onelocbuild.yml Adds a compile-time conditional to only include the legacy variable group when one of the PAT fallback paths is possible.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings August 31, 2026 23:55

Copilot AI 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.

🟢 Approval recommended

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 1, 2026 13:30
@missymessa
missymessa enabled auto-merge (squash) September 1, 2026 13:31

Copilot AI 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.

🟢 Approval recommended

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@mmitche mmitche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The condition looks far too complex. See the PR to main. Wait on changes here until main is resolved.

Copilot AI review requested due to automatic review settings September 3, 2026 19:35

Copilot AI 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.

🟢 Approval recommended

The change is narrowly scoped to conditional variable-group inclusion and aligns with the existing fallback-selection logic already used later in the same template.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 3, 2026 20:04
@missymessa missymessa changed the title [release/10.0] Avoid downloading unused OneLoc PATs [release/10.0] Remove OneLoc PAT dependencies Sep 3, 2026

Copilot AI 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.

🟡 Changes recommended

The template should fail fast with a clear validation error when RepoType: gitHub but GitHubAppServiceConnection is empty, and the main OneLocBuild docs should explicitly note the newly enforced project support limitation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread Documentation/OneLocBuild.md Resolved
Copilot AI review requested due to automatic review settings September 3, 2026 20:08

Copilot AI 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.

🔵 Needs a closer look

The template currently mints/passes GitHub App credentials based only on RepoType, which can force GitHub App installation/token dependencies even when CreatePr: false, potentially breaking documented onboarding flows and adding avoidable failure modes.

Review details

Suppressed comments (3)

Previously missed (1) — in code that hasn't changed since the last review.

eng/common/core-templates/job/onelocbuild.yml:94

  • The GitHub App token is minted whenever RepoType is gitHub, even when CreatePr is false. This adds a Key Vault/service-connection dependency (and potential failure) to runs that may not need to open a PR; consider gating token minting on CreatePr as well.

This issue also appears on line 124 of the same file.

eng/common/core-templates/job/onelocbuild.yml:75

  • The template now requires GitHub App auth for GitHub repos, but it does not validate that GitHubAppServiceConnection is non-empty. If a caller overrides it to '', the failure will likely occur later (Key Vault/service connection) with a less actionable error message; consider failing fast like CeapexServiceConnection.
    - ${{ if notIn(variables['System.TeamProject'], 'internal', 'DevDiv') }}:
      - 'OneLocBuild is supported only in dnceng/internal and DevDiv/DevDiv.': error
    - ${{ if eq(parameters.CeapexServiceConnection, '') }}:
      - 'CeapexServiceConnection must identify a WIF service connection.': error

eng/common/core-templates/job/onelocbuild.yml:126

  • gitHubPatVariable is supplied for GitHub repos even when CreatePr is false, which can force GitHub authentication work (and potential failures) even though no PR is requested. Consider only supplying gitHubPatVariable when CreatePr is true (while still setting repoType).
        ${{ if eq(parameters.RepoType, 'gitHub') }}:
          repoType: ${{ parameters.RepoType }}
          gitHubPatVariable: "$(GitHubAppInstallationToken)"
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 3, 2026 20:18

Copilot AI 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.

🟡 Changes recommended

The new project-scope guard uses a notIn(...) expression that may not be supported by Azure Pipelines template expressions and could break template compilation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

@missymessa
missymessa requested a review from mmitche September 3, 2026 20:22
Copilot AI review requested due to automatic review settings September 8, 2026 16:19

Copilot AI 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.

🔵 Needs a closer look

It changes authentication and enforcement behavior in a shared core pipeline template on a release branch, so a human should validate downstream impact across consuming pipelines/projects.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 375a50b8-9bfd-48a8-86d2-2ca6a3f51369
Copilot AI review requested due to automatic review settings September 8, 2026 16:26
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 375a50b8-9bfd-48a8-86d2-2ca6a3f51369
@missymessa

Copy link
Copy Markdown
Member Author

Main PR #17455 is merged. I carried its final GitHub App installation guidance into this backport and removed the legacy dotnet-bot/First Responders instructions. I also updated the onboarding examples to limit OneLocBuild to the supported dnceng/internal and DevDiv/DevDiv projects, matching the template enforcement.

@mmitche, the prior request to wait for main is now satisfied; please re-review when ready.

Copilot AI 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.

🔵 Needs a closer look

The new notIn(...) template expression is inconsistent with existing repo usage and may break template expansion, preventing the intended early validation from running.

Review details

Suppressed comments (1)

eng/common/core-templates/job/onelocbuild.yml:72

  • The template condition uses notIn(...), but the repo consistently uses notin(...)/ne(...)-based template expression functions elsewhere. If notIn is not recognized (or is case-sensitive), this will fail template expansion before the intended error step runs. Use a condition expressed with ne(...) to avoid relying on an unproven function name/signature.
    - ${{ if notIn(variables['System.TeamProject'], 'internal', 'DevDiv') }}:
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 8, 2026 16:29

Copilot AI 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.

🟢 Approval recommended

The changes consistently remove PAT/variable-group dependencies, add clear early validation for required inputs, and update docs to match the enforced supported-project/authentication behavior.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 8, 2026 17:02

Copilot AI 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.

🟡 Changes recommended

Documentation still contains a later example that suggests OneLocBuild works in any non-public project and the parameter table should explicitly mark the now-required service-connection inputs as non-empty.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

Documentation/OneLocBuild.md:206

  • The template now errors if CeapexServiceConnection is empty (and if GitHubAppServiceConnection is empty when RepoType is gitHub). The parameter table should call out that these are required/non-empty, so consumers don’t try to override them to '' and then hit the template validation error.
| `CeapexServiceConnection` | `'dnceng-onelocbuild-ceapex'` | The project-scoped WIF service connection used to acquire a short-lived token for the Ceapex feeds. OneLocBuild supports only `dnceng/internal` and `DevDiv/DevDiv`; pipelines must be authorized to use the connection. |
| `GitHubAppServiceConnection` | `'dnceng-oneloc-githubapp'` | The dnceng/internal WIF service connection used to sign the App JWT. When the value remains the default, Arcade automatically uses `devdiv-oneloc-githubapp` in `DevDiv/DevDiv`. |
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread Documentation/OneLocBuild.md Resolved
Copilot AI review requested due to automatic review settings September 8, 2026 17:07

Copilot AI 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.

🔵 Needs a closer look

It changes core pipeline authentication behavior in widely-consumed templates, so a final human review is recommended to validate rollout/compatibility expectations.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@missymessa
missymessa merged commit cc18d35 into dotnet:release/10.0 Sep 9, 2026
12 checks passed
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.

3 participants