Repository navigation
Use Secret Manager values for GitHub App tokens - #17528
missymessa merged 8 commits into
Conversation
Add a PEM-backed signing path for composite github-app-secret values and migrate OneLoc defaults while retaining the legacy Key Vault-key path for staged consumer rollout. Co-authored-by: Copilot <[email protected]> Copilot-Session: cb83d078-4ba7-4f9f-86e5-7840b221515c
There was a problem hiding this comment.
🟡 Changes recommended
The legacy (Key Vault signing) branch in get-github-app-token.yml should add template-time validation to prevent empty required inputs from failing later with less actionable task errors.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates Arcade’s GitHub App installation-token minting flow to support Secret Manager–provided GitHub App credentials (App ID + PEM private key) while retaining the legacy Azure Key Vault RSA-key signing path for migration, and updates OneLocBuild defaults/documentation accordingly.
Changes:
- Add a PEM-backed JWT signing path in
Get-GitHubAppToken.ps1driven by environment-provided App ID/private key, with guardrails for empty/unresolved pipeline variables. - Update the
get-github-app-token.ymlstep template to optionally run viaPowerShell@2(Secret Manager path) orAzureCLI@2(legacy Key Vault signing path). - Migrate OneLocBuild defaults and documentation to Secret Manager variable-group–backed values.
File summaries
| File | Description |
|---|---|
| eng/common/Get-GitHubAppToken.ps1 | Adds Secret Manager (env var) PEM signing path and preserves Key Vault signing fallback. |
| eng/common/core-templates/steps/get-github-app-token.yml | Adds parameters and conditional step selection between Secret Manager and Key Vault signing. |
| eng/common/core-templates/job/onelocbuild.yml | Switches OneLocBuild defaults to Secret Manager-backed GitHub App credentials and passes them into the token-mint step. |
| Documentation/OneLocBuildGitHubApp.md | Updates OneLoc GitHub App onboarding docs to the variable-group + Secret Manager model. |
| Documentation/OneLocBuild.md | Updates template parameter documentation to the new GitHub App credential defaults. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Keep the Secret Manager signing contract fixed instead of making the environment variable names configurable. Co-authored-by: Copilot <[email protected]> Copilot-Session: cb83d078-4ba7-4f9f-86e5-7840b221515c
There was a problem hiding this comment.
🟡 Changes recommended
There are confirmed correctness and compatibility/documentation gaps in the new Secret Manager/legacy selection and legacy-default behavior that can lead to confusing failures or broken opt-out flows.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
Documentation/OneLocBuild.md:208
- This row references "legacy Key Vault-key parameters" but the document no longer identifies which parameters must be supplied when UseGitHubAppSecretManagerValues=false.
Documentation/OneLocBuildGitHubApp.md:92 - This row mentions switching to the legacy Key Vault-key parameters, but the doc no longer states which parameters those are. As written, it’s unclear what a caller must set when UseGitHubAppSecretManagerValues=false.
- Files reviewed: 5/5 changed files
- Comments generated: 3
- Review effort level: Lite
Require github-app-secret App ID and private-key values throughout the token helper and OneLoc templates. Keep only the manifest key declarations until consumer rollout validation completes. Co-authored-by: Copilot <[email protected]> Copilot-Session: cb83d078-4ba7-4f9f-86e5-7840b221515c
There was a problem hiding this comment.
🟡 Changes recommended
There’s a small but concrete script defect (duplicate $ErrorActionPreference) and the template parameter surface change is a breaking change that should be explicitly handled/mitigated per Arcade’s breaking-change policy.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
Co-authored-by: Copilot <[email protected]> Copilot-Session: cb83d078-4ba7-4f9f-86e5-7840b221515c
|
The removal of the legacy parameters is intentional for AB#12467: retaining them would preserve the RSA-key path this work is retiring. GitHub code search shows the legacy key names only in Arcade's temporary manifest declarations, generated OneLoc template copies, and dotnet-monitor's release pipeline. The dnceng/internal and DevDiv/DevDiv OneLocBuildVariables groups already contain the composite App ID/private-key projections; dotnet-monitor's Release-Pipeline group does as well. Rollout is staged: merge and flow this change, migrate dotnet-monitor in the dependency update PR, validate both production paths, then remove the manifest declarations and Key Vault keys. I also removed the duplicate ErrorActionPreference assignment from the latest review. |
There was a problem hiding this comment.
🟡 Changes recommended
The updated token-minting path still appears to use a placeholder Authorization header in GitHub API calls, and the template parameter removals should provide a clearer/non-breaking migration experience per Arcade breaking-change policy.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (3)
Previously missed (2) — in code that hasn't changed since the last review.
eng/common/core-templates/job/onelocbuild.yml:101
- If the deprecated Key Vault signing parameters are kept for compatibility, they should fail fast with an actionable error instead of being silently ignored. Add an explicit error step when any of the legacy GitHubApp* Key Vault parameters are set.
eng/common/core-templates/steps/get-github-app-token.yml:49 - If deprecated Key Vault parameters are reintroduced for compatibility, add a template-time guard step that fails with an actionable message when any of them are provided, so callers don’t mistakenly think Key Vault signing is still supported.
eng/common/core-templates/job/onelocbuild.yml:16
- This removes the legacy GitHub App Key Vault signing parameters from the OneLocBuild job template surface. Any pipelines still passing the old parameters will now fail at template expansion with an "Unexpected parameter" error; Arcade policy discourages breaking changes within a major version (Documentation/Policy/ChangesPolicy.md). Consider keeping the old parameter names as deprecated placeholders (defaulting to empty) so callers get a clearer migration error at runtime instead of a compile-time failure.
# GitHub App authentication for the OneLoc check-in PR. These values come
# from the Key Vault-backed OneLocBuildVariables variable group.
GitHubAppId: $(oneloc-localization-app-app-id)
GitHubAppPrivateKey: $(oneloc-localization-app-app-private-key)
SourcesDirectory: $(System.DefaultWorkingDirectory)
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
Document the required move from Key Vault RSA parameters to the github-app-secret App ID and private key without retaining the legacy signing path. Co-authored-by: Copilot <[email protected]> Copilot-Session: cb83d078-4ba7-4f9f-86e5-7840b221515c
There was a problem hiding this comment.
🟢 Approval recommended
The functional migration to Secret Manager-provided GitHub App credentials is consistent across script/templates/docs, with only minor message-text nits noted.
Review details
Suppressed comments (3)
eng/common/Get-GitHubAppToken.ps1:41
- Similarly, the “unresolved pipeline variable” error message hardcodes “Key Vault-backed variable group”. The script can’t know the source, so the message should refer generically to the variable group/secret variables supplying the values.
Write-PipelineTelemetryError -Category 'Build' -Message "The GitHub App ID or private key is an unresolved pipeline variable. Verify the pipeline includes and is authorized to use its Key Vault-backed variable group."
eng/common/Get-GitHubAppToken.ps1:70
- The host message says “Secret Manager private key”, but the script only depends on the environment variable content. Using more generic wording keeps the script reusable for other consumers and avoids implying a specific secret source.
Write-Host 'Signing JWT with the Secret Manager private key...'
eng/common/Get-GitHubAppToken.ps1:81
- The signing failure message hardcodes “Secret Manager private key”, but the key source is just the environment variable. Consider using generic wording to match the script’s actual contract.
Write-PipelineTelemetryError -Category 'Build' -Message "Failed to sign the GitHub App JWT with the Secret Manager private key: $_"
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
Describe the environment-variable contract without assuming the pipeline's secret delivery mechanism. Co-authored-by: Copilot <[email protected]> Copilot-Session: cb83d078-4ba7-4f9f-86e5-7840b221515c
There was a problem hiding this comment.
🔵 Needs a closer look
It changes a shared authentication mechanism and secret-handling path in core templates, which warrants final human review despite no specific defects found in this diff.
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
It modifies shared pipeline authentication primitives (JWT signing/token minting) and removes legacy parameters in core templates, which warrants final human review given the broad downstream impact.
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
It changes a security-sensitive authentication flow (GitHub App token minting) in shared build infrastructure, and warrants final human verification of end-to-end behavior across consuming pipelines.
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Production regression confirmed after merge: arcade-official-ci builds 3072623, 3072891, and 3072937 failed because the shared OneLoc job did not import OneLocBuildVariables, leaving the new GitHub App variables unresolved. Corrective PR: #17541 |
Co-authored-by: Copilot <[email protected]> Copilot-Session: cb83d078-4ba7-4f9f-86e5-7840b221515c
Summary
github-app-secrettypeoneloc-localization-app-app-idandoneloc-localization-app-app-private-keyValidation
The old RSA key declarations remain only as rollout safeguards. After this shared refactor merges, its Arcade dependency flow into dotnet-monitor will be combined with the dotnet-monitor consumer update. After both production paths validate, a cleanup PR will remove the declarations and the Key Vault keys will be deleted.
AB#12467