Repository navigation
[release/10.0] Remove OneLoc PAT dependencies - #17456
missymessa merged 12 commits into
Conversation
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
There was a problem hiding this comment.
🟢 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
OneLocBuildVariablesvariable 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.
mmitche
left a comment
There was a problem hiding this comment.
The condition looks far too complex. See the PR to main. Wait on changes here until main is resolved.
There was a problem hiding this comment.
🟢 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
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🔵 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
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
🔵 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
Co-authored-by: Copilot <[email protected]> Copilot-Session: 375a50b8-9bfd-48a8-86d2-2ca6a3f51369
|
Main PR #17455 is merged. I carried its final GitHub App installation guidance into this backport and removed the legacy @mmitche, the prior request to wait for main is now satisfied; please re-review when ready. |
There was a problem hiding this comment.
🔵 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 usesnotin(...)/ne(...)-based template expression functions elsewhere. IfnotInis not recognized (or is case-sensitive), this will fail template expansion before the intended error step runs. Use a condition expressed withne(...)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
There was a problem hiding this comment.
🟢 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
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 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
CeapexServiceConnectionis empty (and ifGitHubAppServiceConnectionis empty whenRepoTypeisgitHub). 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
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🔵 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
Summary
OneLocBuildVariablesvariable group torelease/10.0Backport of the main cleanup for AB#10151 and AB#12331.