Skip to content

[release/9.0] Enable OneLoc GitHub App authentication by default - #17262

Merged
missymessa merged 5 commits into
release/9.0from
missymessa/backport-oneloc-github-app-release-9.0
Aug 6, 2026
Merged

missymessa merged 5 commits into
release/9.0from
missymessa/backport-oneloc-github-app-release-9.0

Conversation

@missymessa

Copy link
Copy Markdown
Member

Backport of #17219 and #17258 to release/9.0.

  • Adds the OneLocBuild GitHub App installation-token implementation.
  • Enables the App path by default for dnceng/internal GitHub builds.
  • Preserves UseGitHubAppAuthentication: false as the temporary PAT opt-out.
  • Documents that App token/authentication failures do not automatically retry with the PAT.

Conflict resolution preserved the release branch's existing CEINTL documentation URLs.

missymessa and others added 2 commits August 5, 2026 15:08
Co-authored-by: Copilot <[email protected]>
Copilot-Session: a2aa4598-efc5-44f4-a67b-7db19982252d
Copilot-Session: f12710df-91d5-49e4-b327-337932478b0b
Use the centralized dnceng GitHub App path by default for internal GitHub OneLoc builds while preserving explicit opt-out to the PAT path. Document that runtime App failures do not automatically fall back to the PAT.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 8d5c9824-be94-4260-a72c-605d0ce1294d

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.

Pull request overview

This PR backports the OneLocBuild GitHub App authentication work to release/9.0, introducing an Azure Key Vault–signed GitHub App installation-token flow and enabling it by default for dnceng/internal GitHub OneLoc builds while preserving an explicit PAT opt-out.

Changes:

  • Adds Get-GitHubAppToken.ps1 plus pipeline step templates to mint a GitHub App installation token (ghs_*) via Key Vault signing.
  • Updates onelocbuild.yml to use the App token by default for RepoType: gitHub in the internal Azure DevOps project, with UseGitHubAppAuthentication: false as the opt-out.
  • Adds/updates documentation describing access requirements and clarifying there is no automatic PAT fallback if App auth fails.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
eng/common/templates/steps/get-github-app-token.yml Adds non-1ES shim entry point for the new core step template.
eng/common/templates-official/steps/get-github-app-token.yml Adds 1ES shim entry point for the new core step template.
eng/common/Get-GitHubAppToken.ps1 Implements JWT signing via Key Vault and GitHub installation token minting.
eng/common/core-templates/steps/get-github-app-token.yml Introduces the AzureCLI step template wrapper for token minting.
eng/common/core-templates/job/onelocbuild.yml Enables and wires the App-token path by default for dnceng/internal GitHub builds.
Documentation/OneLocBuildGitHubApp.md Adds detailed guidance for enabling/using the GitHub App auth path.
Documentation/OneLocBuild.md Documents the new GitHub App auth option and surfaces the new parameters.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread eng/common/Get-GitHubAppToken.ps1 Resolved
Comment thread eng/common/Get-GitHubAppToken.ps1 Resolved
missymessa and others added 2 commits August 5, 2026 15:20
Address review feedback by reading the Key Vault signature deterministically, paginating installation lookup, preserving 1ES template context, and clarifying installation token scope.

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

Copilot-Session: cf5c9dac-de56-477f-9858-541b9fec0178
Copilot AI review requested due to automatic review settings August 5, 2026 22:30

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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (1)

eng/common/Get-GitHubAppToken.ps1:145

  • When -OutputVariableName is not provided, the script prints the installation token to the log (Write-Host $tokenResponse.token). If this script is ever invoked from an Azure DevOps pipeline without -OutputVariableName, it will leak a live ghs_ token into build logs. Consider failing fast in CI when OutputVariableName is missing, and only allowing stdout output for local/manual runs.
}
else {
    Write-Host $tokenResponse.token -ForegroundColor Green
}

Copilot AI review requested due to automatic review settings August 6, 2026 01:34

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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (2)

eng/common/Get-GitHubAppToken.ps1:142

  • Even with the template currently passing -OutputVariableName, the fallback else { Write-Host $tokenResponse.token } will log the full ghs_ token if the script is ever invoked without it. Once OutputVariableName is mandatory/validated, this branch can be removed so the token is never written to logs.
if ($OutputVariableName) {
    Write-Host "Setting pipeline variable '$OutputVariableName'."
    Write-Host "##vso[task.setvariable variable=$OutputVariableName;issecret=true]$($tokenResponse.token)"
}

eng/common/Get-GitHubAppToken.ps1:40

  • OutputVariableName is optional and the script prints the full installation token to stdout when it’s not provided. That creates an easy foot-gun where a secret ghs_ token can end up in build logs if the script is invoked without -OutputVariableName (or if an empty/whitespace name is passed). Since the template always uses a secret pipeline variable, make OutputVariableName mandatory and validate it’s non-empty.

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

    # Optional Azure DevOps pipeline variable name to set with the installation
    # token (marked as a secret). When not specified, the token is written to
    # stdout instead.
    [Parameter(Mandatory = $false)]
    [string] $OutputVariableName

@akoeplinger akoeplinger 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.

Is anyone even using OneLoc with 9.0 arcade? usually OneLoc only runs on main builds

@missymessa
missymessa merged commit cb8e767 into release/9.0 Aug 6, 2026
11 of 13 checks passed
@missymessa
missymessa deleted the missymessa/backport-oneloc-github-app-release-9.0 branch August 6, 2026 14:39
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