Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TypeSpec] Pin all emitter packages in all language repos #6349

Closed
mikeharder opened this issue Jun 15, 2023 · 0 comments · Fixed by Azure/azure-sdk-for-java#38883, Azure/azure-sdk-for-python#34419 or #7655
Assignees
Labels
Central-EngSys This issue is owned by the Engineering System team. TypeSpec Issues or feature requests for tooling to support TypeSpec (Cadl)

Comments

@mikeharder
Copy link
Member

For repeatable builds, I think we should be pinning all emitter packages in the language repos using a package-lock.json file. Changes required:

  • Pin all top-level packages we care about in eng/emitter-package.json
  • Ensure the name property is set in emitter-package.json, so it will be copied to the lockfile and remains stable for all developers.
  • Generate and commit a lockfile at eng/emitter-package-lock.json
  • Update eng/common/scripts/TypeSpec-Project-Generate.ps1 to copy the lockfile and install using npm ci rather than npm install --no-lock-file.
    • $replacementPackageJson = Join-Path $PSScriptRoot "../../emitter-package.json"
      if (Test-Path "Function:$GetEmitterPackageJsonPathFn") {
      $replacementPackageJson = &$GetEmitterPackageJsonPathFn
      }
      Write-Host("Copying package.json from $replacementPackageJson")
      Copy-Item -Path $replacementPackageJson -Destination "package.json" -Force
      $useAlphaNpmRegistry = (Get-Content $replacementPackageJson -Raw).Contains("-alpha.")
      if($useAlphaNpmRegistry) {
      Write-Host "Package.json contains '-alpha.' in the version, Creating .npmrc using public/azure-sdk-for-js-test-autorest feed."
      "registry=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/ `n`nalways-auth=true" | Out-File '.npmrc'
      }
      npm install --no-lock-file

This issue came up in this PR to the JS repo:

Azure/azure-sdk-for-js#26200 (review)

@mikeharder mikeharder added Central-EngSys This issue is owned by the Engineering System team. TypeSpec Issues or feature requests for tooling to support TypeSpec (Cadl) labels Jun 15, 2023
@mikeharder mikeharder self-assigned this Jun 15, 2023
@mikeharder mikeharder moved this from 🤔 Triage to 🐝 Dev in Azure SDK EngSys 🚢🎉 Jun 15, 2023
@mikeharder mikeharder assigned hallipr and unassigned mikeharder Aug 1, 2023
@hallipr hallipr moved this from 🐝 Dev to 🔬 Dev in PR in Azure SDK EngSys 🚢🎉 Feb 22, 2024
@hallipr hallipr linked a pull request Feb 22, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from 🔬 Dev in PR to 🎊 Closed in Azure SDK EngSys 🚢🎉 Feb 27, 2024
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. TypeSpec Issues or feature requests for tooling to support TypeSpec (Cadl)
Projects
Archived in project
2 participants