Skip to content

Build preview-selected packages before pkg-pr-new publish - #11464

Merged
iscai-msft merged 6 commits into
mainfrom
copilot/investigate-packages-published
Jul 30, 2026
Merged

Build preview-selected packages before pkg-pr-new publish#11464
iscai-msft merged 6 commits into
mainfrom
copilot/investigate-packages-published

Conversation

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Preview publishes were selecting the correct packages, but some were published without built artifacts because build and publish package sets diverged after prerelease versioning. This change aligns package preparation with package publication in eng/tsp-core/pkg-pr-new.ts.

  • Problem

    • pkg-pr-new was publishing modified packages detected at publish time, but those packages were not guaranteed to have been built in the same execution path.
  • Change

    • Compute modifiedPackages once from publishable packages + changed files.
    • Build that exact set before publishing:
      • workspace packages via filtered pnpm ... run build
      • standalone packages via per-package npm run build
    • Reuse the same modifiedPaths for pkg-pr-new publish.
  • Resulting behavior

    • Any package selected for preview publication is now built immediately beforehand in the same script flow, preventing missing dist content in published previews.
const modifiedPackages = packages.filter((pkg) => files.some((f) => f.startsWith(pkg.path + "/")));
const modifiedPaths = modifiedPackages.map((pkg) => pkg.path);

// Build exactly what will be published...
runCommand(`pnpm ${filters} run build`, repoRoot);
// ...then publish that same set
runCommand(`pnpx pkg-pr-new publish ${modifiedPaths.map((x) => `'${x}'`).join(" ")} --pnpm`, repoRoot);

Copilot AI and others added 2 commits July 29, 2026 23:40
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Comment thread eng/tsp-core/pkg-pr-new.ts
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Comment thread eng/tsp-core/tpm/cli.ts Outdated
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Jul 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-server-js@11464

commit: 7669fe9

@timotheeguerin

Copy link
Copy Markdown
Member

@copilot this works now can you revert the test change to http-server paackage

Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@copilot this works now can you revert the test change to http-server paackage

Done in b32dd5b2: reverted the dummy packages/http-server-js/README.md test change.

@timotheeguerin
timotheeguerin marked this pull request as ready for review July 30, 2026 14:18
@timotheeguerin
timotheeguerin requested a review from xirzec as a code owner July 30, 2026 14:18
@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@iscai-msft
iscai-msft added this pull request to the merge queue Jul 30, 2026
Merged via the queue into main with commit a9fc1f7 Jul 30, 2026
32 checks passed
@iscai-msft
iscai-msft deleted the copilot/investigate-packages-published branch July 30, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants