Skip to content

feat(ci): add Azure Pipelines npm publisher and Otto release trigger - #9744

Merged
Krrish Mittal (takyyon) merged 4 commits into
mainfrom
takyyon/ado-npm-publish-pipeline
Nov 25, 2026
Merged

Krrish Mittal (takyyon) merged 4 commits into
mainfrom
takyyon/ado-npm-publish-pipeline

Conversation

@takyyon

@takyyon Krrish Mittal (takyyon) commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

Justification: Plain CI/npm publishing automation only — zero client, designer, or shipped product/runtime code is modified, and no repo-governance write permissions are added (publish-npm uses contents: read). Full GitHub -> Otto -> ADO -> npm feed flow is already verified end-to-end._

What & Why

This doesn't make any user impact so ideally risk is low across. It updates the npm publishing steps only. Adds an Azure Pipelines 1ES Official release pipeline (.azure-pipelines/npm-publish.yml) and publisher script (scripts/ado-npm-publisher.cjs) to build and publish the 9 LogicAppsUX npm packages to the Azure Artifacts npm feed using Workload Identity Federation (WIF), and wires .github/workflows/version-release.yml to trigger it automatically through the Otto trigger-npm-publish workflow on the triggering branch after a GitHub Release is created.

Files Changed

  • .azure-pipelines/npm-publish.yml: Single-stage (Publish), single-job (BuildAndPublish) 1ES Official pipeline (v1/1ES.Official.PipelineTemplate.yml@1esPipelines at refs/tags/release, pool Azure-Pipelines-1ESPT-ExDShared, sdl.componentgovernance.useAgentBuildDirectory: true).
    • Gated to refs/heads/main and refs/heads/hotfix/v* via and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/v'))).
    • Authenticates to https://pkgs.dev.azure.com/msazure/One/_packaging/microsoft-logic-apps/npm/registry/ using npmAuthenticate@0 with WIF service connection 21d5a1d8-11d3-425c-8d3a-e7f088725481.
  • .github/workflows/version-release.yml:
    • Adds a publish-npm job (needs: create-release, environment: E2ETesting, permissions: { contents: read }) that invokes ${{ secrets.OTTO_NPM_PUBLISH_WORKFLOW_URL }} with { releaseVersion, tagName, sourceBranch, repository, githubRunUrl, dryRun: false }, accepts HTTP 200 (skipped) or 202 (queued), and writes the ADO build ID and URL to $GITHUB_STEP_SUMMARY.
    • Removes the legacy Generate NPMRC and Publish to NPM steps from build-and-publish, and guards Azure login with if: ${{ github.event.inputs.enable_blob_upload == 'true' }} so blob upload remains unchanged when enabled without blocking releases when disabled.
  • scripts/ado-npm-publisher.cjs: Self-contained Node script with build and publish commands:
    • Validates releaseVersion (e.g. 5.1025.0), resolves refs/tags/v<releaseVersion> locally, and checks it out into a clean detached worktree retained under Agent.BuildDirectory for Component Governance.
    • Bootstraps pnpm from the 1ES npm mirror using the exact packageManager version in package.json.
    • Runs pnpm install --recursive --frozen-lockfile --strict-peer-dependencies, node scripts/update-versions.js <releaseVersion>, pnpm run build:lib, and pnpm pack for all 9 publishable packages.
    • Iterates the 9 packages in dependency order, skipping any <name>@<releaseVersion> already present in the feed (npm view), resolving the dist-tag via resolvePublishDistTag + compareSemver (--tag latest when version >= currentLatest or package not yet in feed, --tag hotfix when version < currentLatest so older hotfixes never downgrade latest, failing loudly on non-404 feed errors), and running npm publish <tarball> --tag <distTag>.
  • scripts/ado-npm-publisher.test.cjs: Unit and YAML invariant tests covering version parsing, SemVer comparison, dist-tag resolution (latest vs hotfix, 404, prerelease, non-404 error handling), tag resolution, 1ES-mirror pnpm bootstrap, build/pack + worktree retention, feed lookup states, idempotent skip/publish behavior, .azure-pipelines/npm-publish.yml, and .github/workflows/version-release.yml.

Impact of Change

  • Users: No runtime or product UI changes; downstream npm package consumers receive releases published through Azure Pipelines, with dist-tags.latest protected against older hotfix downgrades.
  • Developers: Engineers continue queueing releases from GitHub Version and Release; after GitHub creates the tag and release, publish-npm invokes Otto (laux-prs/trigger-npm-publish) to queue ADO pipeline 489908 automatically on the same triggering branch (refs/heads/main or refs/heads/hotfix/v*).
  • System: Moves npm publishing from GitHub Actions onto ADO 1ES Official pipeline 489908 with WIF (npmAuthenticate@0) and Branch Control; uses E2ETesting environment secret OTTO_NPM_PUBLISH_WORKFLOW_URL (restricted to main, hotfix/*, krmitta/e2e-test-api).

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in: Local Node / Biome + Live Full-Chain GitHub Actions -> Otto (laux-prs) -> Hosted ADO Pipeline 489908 -> microsoft-logic-apps npm feed

Validation Results

  • npx biome check scripts/ado-npm-publisher.cjs scripts/ado-npm-publisher.test.cjs — passed (0 errors)
  • node --test scripts/ado-npm-publisher.test.cjs — passed (15/15 tests)
  • ruby -ryaml -e "YAML.load_file('.azure-pipelines/npm-publish.yml'); YAML.load_file('.github/workflows/version-release.yml')" — passed (YAML OK)
  • Extracted publish-npm shell step syntax (bash -n) and 7 stubbed-curl smoke cases — all passed
  • Full-Chain Live E2E Run (GitHub -> Otto -> ADO -> npm feed):
    • GitHub Actions run 45554317494 on temporary hotfix/v2.9999 (release_type=patch, enable_blob_upload=false): all 4 jobs succeeded (validation, create-release -> v2.9999.1, publish-npm -> Otto HTTP 202 queued, build-and-publish).
    • ADO Pipeline 489908 / Build 193144804 on refs/heads/hotfix/v2.9999: completed/succeeded (Build and publish npm packages, Component Governance, SDLSources, and Agentless Tag all succeeded); published all 9/9 packages at 2.9999.1 under --tag hotfix; verified all 9 packages on microsoft-logic-apps preserved dist-tags.latest = 5.1025.0. Temporary release v2.9999.1, tag, and hotfix/v2.9999 branch cleaned up.
  • Hosted ADO latest Publish E2E Run: Pipeline 489908 / Build 193120731 — succeeded; built from v5.1025.0, published all 9/9 packages at 5.1025.0 (dist-tags.latest = 5.1025.0), and passed Component Governance.
  • Live Otto Bridge Checks: Verified invalid semver (400), disallowed sourceBranch (400), missing release (404), idempotent skip on 5.1025.0 (200), live queue (202), and MSI rotate-connection-keys (Succeeded).

Contributors

Krrish Mittal (@takyyon)

Screenshots/Videos

N/A (CI pipeline, Otto webhook trigger, and release script only)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 03:34
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

✅ PR Title

  • Current: feat(ci): add Azure Pipelines npm publisher and Otto release trigger
  • Issue: The title is specific, follows a conventional format, and accurately describes the CI and release automation changes.
  • Recommendation: No changes required.

✅ Commit Type

  • Properly selected (feature).
  • Only one commit type is selected. The addition of a new npm publishing pipeline and automated release trigger qualifies as new functionality.

✅ Risk Level

  • The selected Medium risk level matches the risk:medium label.
  • The advised risk level is medium, based on the introduction of release automation that builds and publishes nine npm packages, invokes an external Otto workflow, and uses an Azure DevOps workload identity connection. The scope is limited to CI/release infrastructure and does not modify runtime product behavior, so High is not necessary.
  • Recommendation: Clarify the apparent inconsistency between the statement that the risk is “ideally low” and the selected Medium risk. Explain that the risk is medium because publishing and release-flow failures could affect downstream package consumers, even though there are no client or runtime changes.

✅ What & Why

  • Current: The section explains the new Azure Pipelines publisher, Otto trigger, package build/publish flow, branch restrictions, dist-tag behavior, authentication, and the files changed.
  • Issue: The content is comprehensive and clearly describes the motivation and implementation. The opening sentence suggesting that the risk should be low is slightly inconsistent with the selected Medium risk.
  • Recommendation: Replace the opening with wording such as: This changes release infrastructure only, with no runtime or UI impact. The risk is medium because the workflow controls automated publication of nine npm packages and integrates GitHub, Otto, Azure DevOps, and Azure Artifacts.

✅ Impact of Change

  • The Users, Developers, and System impacts are all documented and are consistent with the changes.
  • Recommendation:
    • Users: No runtime or UI impact is expected; note that downstream npm consumers are affected by package availability and dist-tag assignment.
    • Developers: The release process now queues publishing through Otto and Azure Pipelines instead of GitHub Actions.
    • System: The PR introduces an Azure DevOps 1ES pipeline, WIF authentication, branch gating, and an environment-scoped Otto webhook secret. These details are appropriately documented.

✅ Test Plan

  • Unit tests are checked and are backed by scripts/ado-npm-publisher.test.cjs in the diff. The test coverage includes version handling, tag resolution, feed behavior, publishing behavior, and YAML invariants.
  • Manual testing is also checked and includes clear validation results and live GitHub Actions → Otto → Azure DevOps → npm feed verification. E2E testing does not need to be checked separately because unit tests are present and live full-chain validation is documented.

⚠️ Contributors

  • The contributor section identifies @takyyon.
  • Recommendation: Consider crediting any PMs, designers, reviewers, or infrastructure owners who contributed ideas or approvals. This is optional and does not block approval.

✅ Screenshots/Videos

  • The section states N/A and correctly explains that the changes are limited to CI pipelines, webhook triggering, and release scripts. Screenshots or videos are not applicable.

Summary Table

Section Status Recommendation
Title ✅ No changes required.
Commit Type ✅ feature is selected correctly and only once.
Risk Level ✅ risk:medium matches the selected Medium level; clarify why the risk is Medium rather than Low.
What & Why ✅ Content is complete; revise the low-risk wording for consistency.
Impact of Change ✅ Users, Developers, and System impacts are documented.
Test Plan ✅ Unit tests are present in the diff and live validation is documented.
Contributors ⚠️ Optionally credit additional contributors and reviewers.
Screenshots/Videos ✅ Correctly marked not applicable.

✅ The PR title and body pass review. Before merging, consider clarifying the Medium-risk justification so it does not conflict with the statement that the risk is ideally Low.


Powered by: Logic App (fallback) | Last updated: Wed, 25 Nov 2026 14:47:30 GMT

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage Check

No source files changed in this PR.

@takyyon Krrish Mittal (takyyon) added the risk:medium Medium risk change with potential impact label Nov 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The publisher can execute and publish tags from unmerged feature branches without ancestry validation, while publishing older releases with --tag latest can downgrade default installs and leave library tags inconsistent.

2 open issues
What changed in this PR

Adds a manual Azure Pipelines release path for publishing nine LogicAppsUX npm packages to Azure Artifacts. Existing GitHub versioning and release workflows remain unchanged.

Changes:

  • Adds a branch-gated 1ES pipeline with Workload Identity Federation authentication.
  • Builds release tags in detached worktrees, bootstraps pinned pnpm, and publishes missing package versions.
  • Adds unit tests for build/publish behavior, error handling, and pipeline configuration.
File Description
scripts/​ado-npm-publisher.test.cjs Tests release helpers, publishing behavior, and pipeline invariants.
scripts/​ado-npm-publisher.cjs Implements tagged builds, package packing, and feed publishing.
.azure-pipelines/​npm-publish.yml Defines the manual authenticated build-and-publish pipeline.

Review effort: Balanced

Comment thread scripts/ado-npm-publisher.cjs Resolved
Comment thread scripts/ado-npm-publisher.cjs Resolved
@takyyon Krrish Mittal (takyyon) added risk:high High risk change requiring careful review and removed risk:medium Medium risk change with potential impact labels Nov 25, 2026
Replace legacy direct npm publishing in version-release.yml with a
publish-npm job that invokes the Otto trigger-npm-publish workflow via
the E2ETesting environment secret, guard Azure login on blob upload,
and add workflow invariant tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@takyyon Krrish Mittal (takyyon) changed the title feat(ci): add Azure Pipelines npm release publisher feat(ci): add Azure Pipelines npm publisher and Otto release trigger Nov 25, 2026
Add compareSemver and resolvePublishDistTag in ado-npm-publisher.cjs so
publishing a version lower than the feed's dist-tags.latest uses --tag
hotfix instead of downgrading latest, while failing fast on non-404 feed
errors.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@takyyon Krrish Mittal (takyyon) added risk:low Low risk change with minimal impact and removed risk:high High risk change requiring careful review labels Nov 25, 2026
@takyyon Krrish Mittal (takyyon) added risk:medium Medium risk change with potential impact and removed risk:low Low risk change with minimal impact needs-pr-update labels Nov 25, 2026
Set top-level `name` in `.azure-pipelines/npm-publish.yml` to
`${{ coalesce(trim(parameters.releaseVersion), 'unversioned') }}-$(Date:yyyyMMdd)$(Rev:.r)`
so each ADO publish run captures the package version being published at queue time.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@takyyon
Krrish Mittal (takyyon) merged commit cdc30d4 into main Nov 25, 2026
22 checks passed
@takyyon
Krrish Mittal (takyyon) deleted the takyyon/ado-npm-publish-pipeline branch November 25, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:medium Medium risk change with potential impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants