Skip to content

Sync eng/common directory with azure-sdk-tools for PR 15357#48980

Open
azure-sdk wants to merge 6 commits intomainfrom
sync-eng/common-prepare-pipelines-transition-15357
Open

Sync eng/common directory with azure-sdk-tools for PR 15357#48980
azure-sdk wants to merge 6 commits intomainfrom
sync-eng/common-prepare-pipelines-transition-15357

Conversation

@azure-sdk
Copy link
Copy Markdown
Collaborator

Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#15357 See eng/common workflow

Copilot AI review requested due to automatic review settings April 29, 2026 18:54
@azure-sdk azure-sdk requested a review from a team as a code owner April 29, 2026 18:54
@azure-sdk azure-sdk requested a review from scbedd April 29, 2026 18:54
@azure-sdk azure-sdk added EngSys This issue is impacting the engineering system. Central-EngSys This issue is owned by the Engineering System team. labels Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Syncs eng/common Azure Pipelines templates with the corresponding updates from azure-sdk-tools PR 15357, focusing on moving GitHub authentication from a static PAT to GitHub App installation tokens (via login-to-github.yml).

Changes:

  • Added conditional GitHub App login in prepare-pipelines.yml for *-pr repositories and switched sparse-checkout auth to use $(GH_TOKEN).
  • Added GitHub App login steps in the TypeSpec emitter archetype and switched PR creation auth from $(azuresdk-github-pat) to $(GH_TOKEN_Azure).

Reviewed changes

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

File Description
eng/common/pipelines/templates/jobs/prepare-pipelines.yml Uses GitHub App token (GH_TOKEN) for sparse-checkout auth when operating on *-pr repos.
eng/common/pipelines/templates/archetype-typespec-emitter.yml Introduces GitHub App login steps and changes PR creation to use a GH token variable instead of a PAT.

Comment on lines 551 to 555
-BaseBranch '$(pullRequestTargetBranch)'
-PROwner 'azure-sdk'
-PRBranch '$(branchName)'
-AuthToken '$(azuresdk-github-pat)'
-AuthToken '$(GH_TOKEN_Azure)'
-PRTitle '$(PullRequestTitle)'
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

Create pull request is now hard-coded to use $(GH_TOKEN_Azure), but this template derives RepoOwner at runtime from Build.Repository.Name and can be azure-sdk (or something else) depending on which repo consumes this archetype. In those cases the GH_TOKEN_Azure installation token will not have permissions on the target org, and PR creation will fail with 401/403. Consider selecting the token variable based on $(RepoOwner) (e.g., set an AuthTokenForPR variable in the preceding PowerShell step by reading the appropriate GH_TOKEN* env var) and pass that into Submit-PullRequest.ps1 instead of always using GH_TOKEN_Azure.

Copilot uses AI. Check for mistakes.
Comment on lines +308 to 312
- template: /eng/common/pipelines/templates/steps/login-to-github.yml
parameters:
TokenOwners:
- azure-sdk

Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

This added login-to-github.yml step doesn't appear to be used anywhere later in the Initialize job (there are no references to GH_TOKEN* in this job). Since login-to-github.ps1 mints a GitHub App token via Key Vault signing, running it unnecessarily adds time and an external dependency for every pipeline run. Please remove it, or wire the minted token into a later step that actually requires GitHub auth in this job.

Suggested change
- template: /eng/common/pipelines/templates/steps/login-to-github.yml
parameters:
TokenOwners:
- azure-sdk

Copilot uses AI. Check for mistakes.
Comment on lines +403 to +407
- template: /eng/common/pipelines/templates/steps/login-to-github.yml
parameters:
TokenOwners:
- azure-sdk

Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

This added login-to-github.yml step doesn't appear to be used anywhere later in the Generate job (the job doesn't reference GH_TOKEN*, and pushes are performed via git-push-changes.yml which currently uses $(azuresdk-github-pat)). Running GitHub App login per matrix job can be expensive (Key Vault signing + extra REST calls) and increases the chance of transient failures. Please remove it until it is needed, or update the subsequent GitHub-authenticated operations to actually use the minted token.

Suggested change
- template: /eng/common/pipelines/templates/steps/login-to-github.yml
parameters:
TokenOwners:
- azure-sdk

Copilot uses AI. Check for mistakes.
@azure-sdk azure-sdk force-pushed the sync-eng/common-prepare-pipelines-transition-15357 branch 2 times, most recently from 9a67b6f to 082f1c6 Compare May 6, 2026 16:54
@azure-sdk azure-sdk force-pushed the sync-eng/common-prepare-pipelines-transition-15357 branch from 082f1c6 to cfda3ee Compare May 6, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Central-EngSys This issue is owned by the Engineering System team. EngSys This issue is impacting the engineering system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants