Skip to content

Sync eng/common directory with azure-sdk-tools for PR 14353#37470

Merged
chidozieononiwu merged 2 commits intomainfrom
sync-eng/common-AllowNpmJSAccess-14353
Mar 5, 2026
Merged

Sync eng/common directory with azure-sdk-tools for PR 14353#37470
chidozieononiwu merged 2 commits intomainfrom
sync-eng/common-AllowNpmJSAccess-14353

Conversation

@azure-sdk
Copy link
Collaborator

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

Copilot AI review requested due to automatic review settings March 5, 2026 01:19
@azure-sdk azure-sdk requested a review from a team as a code owner March 5, 2026 01:19
@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 Mar 5, 2026
Copy link
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 pipeline templates with upstream azure-sdk-tools changes by replacing the “delete repo .npmrc” approach with a reusable step template that sets the npm project registry.

Changes:

  • Add a new reset-npmrc.yml steps template to set the npm project registry via npm config.
  • Update npm-publish.yml to use the new template when publishing to https://registry.npmjs.org/ instead of deleting the repo .npmrc.

Reviewed changes

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

File Description
eng/common/pipelines/templates/steps/reset-npmrc.yml New reusable step template that sets the npm project registry.
eng/common/pipelines/templates/jobs/npm-publish.yml Switch npmjs publishing path to use the new reset-npmrc template.

Write-Host "No repo .npmrc found at $npmrcPath."
}
pwsh: true
- template: /eng/common/pipelines/templates/steps/reset-npmrc.yml
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

This reset-npmrc step now runs even when SkipPublishing is set to true (e.g., when no packages are found and publishing is skipped). Previously the registry-change step was conditioned on ne(variables['SkipPublishing'], 'true'). Consider applying the same condition to this template call (or adding a CustomCondition parameter to the template) so the job doesn’t mutate npm config unnecessarily when publishing is skipped.

Suggested change
- template: /eng/common/pipelines/templates/steps/reset-npmrc.yml
- template: /eng/common/pipelines/templates/steps/reset-npmrc.yml
condition: and(succeeded(), ne(variables['SkipPublishing'], 'true'))

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +8

steps:
- task: PowerShell@2
displayName: 'Set project npm registry'
inputs:
targetType: inline
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

This template uses npm config ... --location=project, which writes to the .npmrc in the current working directory. Since the task doesn’t set workingDirectory, the update could end up in an unexpected folder (and not affect later npm commands that run elsewhere). Consider adding a WorkingDirectory parameter (or otherwise setting workingDirectory on the PowerShell task) so the project .npmrc is updated deterministically.

Suggested change
steps:
- task: PowerShell@2
displayName: 'Set project npm registry'
inputs:
targetType: inline
WorkingDirectory: '$(System.DefaultWorkingDirectory)'
steps:
- task: PowerShell@2
displayName: 'Set project npm registry'
inputs:
targetType: inline
workingDirectory: ${{ parameters.WorkingDirectory }}

Copilot uses AI. Check for mistakes.
@chidozieononiwu chidozieononiwu merged commit c758463 into main Mar 5, 2026
16 of 22 checks passed
@chidozieononiwu chidozieononiwu deleted the sync-eng/common-AllowNpmJSAccess-14353 branch March 5, 2026 01:26
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