Skip to content

Sync eng/common directory with azure-sdk-tools for PR 15278#4272

Open
azure-sdk wants to merge 3 commits intomainfrom
sync-eng/common-add-playground-bundle-template-15278
Open

Sync eng/common directory with azure-sdk-tools for PR 15278#4272
azure-sdk wants to merge 3 commits intomainfrom
sync-eng/common-add-playground-bundle-template-15278

Conversation

@azure-sdk
Copy link
Copy Markdown
Collaborator

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

JoshLove-msft and others added 3 commits April 24, 2026 00:50
Adds an opt-in capability to the shared TypeSpec emitter pipeline template that bundles an emitter package and uploads it to the typespec playground blob storage. The uploaded <pkgName>/latest.json import map is consumed by in-browser playgrounds (e.g. https://azure.github.io/typespec-azure) via their additionalPlaygroundPackages mechanism.

Self-contained tooling lives in eng/common/playground-bundle/ and mirrors @typespec/bundle-uploader from microsoft/typespec (which is private and cannot be installed from npm).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 00:55
@azure-sdk azure-sdk requested a review from a team as a code owner April 24, 2026 00:55
@azure-sdk azure-sdk requested a review from JoshLove-msft April 24, 2026 00:55
@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 24, 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

This PR syncs eng/common changes from azure-sdk-tools PR 15278 by introducing a self-contained TypeSpec emitter bundling + upload utility and wiring it into the shared archetype-typespec-emitter.yml pipeline template.

Changes:

  • Added eng/common/playground-bundle/ Node-based tool to bundle a TypeSpec emitter and upload it to the TypeSpec playground blob storage.
  • Added documentation for the new bundler/uploader utility.
  • Updated archetype-typespec-emitter.yml to optionally run the bundle+upload flow (internal, non-PR builds only).

Reviewed changes

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

Show a summary per file
File Description
eng/common/playground-bundle/upload.mjs New Node script that bundles an emitter and uploads JS + manifest + updates latest.json in blob storage.
eng/common/playground-bundle/package.json Defines pinned dependencies and Node engine requirement for the uploader tool.
eng/common/playground-bundle/package-lock.json Locks transitive dependencies for reproducible installs in pipelines.
eng/common/playground-bundle/README.md Documents purpose and pipeline invocation details for the uploader tool.
eng/common/pipelines/templates/archetype-typespec-emitter.yml Adds UploadPlaygroundBundle parameter and pipeline steps to install/run the uploader.
Files not reviewed (1)
  • eng/common/playground-bundle/package-lock.json: Language not supported

Comment on lines +69 to +73
const content = JSON.stringify(manifest);
await blob.upload(content, content.length, {
blobHTTPHeaders: { blobContentType: "application/json; charset=utf-8" },
conditions: { ifNoneMatch: "*" },
});
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

BlockBlobClient.upload expects contentLength in bytes, but content.length is UTF-16 code unit count and can be wrong for non-ASCII JSON. Use Buffer.byteLength(content, "utf8") (or switch to uploadData(Buffer.from(content))) to ensure the Content-Length matches the actual payload.

Copilot uses AI. Check for mistakes.
async function updatePackageLatest(container, pkgName, index) {
const blob = container.getBlockBlobClient(normalizePath(joinUnix(pkgName, "latest.json")));
const content = JSON.stringify(index);
await blob.upload(content, content.length, {
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

Same issue as above: content.length is not a reliable byte length for UTF-8 JSON when calling BlockBlobClient.upload. Use Buffer.byteLength(...) or uploadData(Buffer.from(content)) for latest.json uploads.

Suggested change
await blob.upload(content, content.length, {
await blob.uploadData(Buffer.from(content, "utf8"), {

Copilot uses AI. Check for mistakes.
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