Skip to content

fix: stabilize CI — timing tolerance + TS release OIDC#6

Merged
dougborg merged 1 commit into
mainfrom
fix/ci-reliability-and-ts-release
Apr 20, 2026
Merged

fix: stabilize CI — timing tolerance + TS release OIDC#6
dougborg merged 1 commit into
mainfrom
fix/ci-reliability-and-ts-release

Conversation

@dougborg

Copy link
Copy Markdown
Owner

Summary

  • Timing test: bump upper bound 100ms → 500ms. CI scheduling jitter was causing sporadic failures (last run: 109ms on a 50ms-sleep test).
  • TS release: split @semantic-release/npm (now npmPublish: false) from the actual publish step. Added explicit pnpm publish --provenance that uses OIDC, no NPM_TOKEN needed.

Test plan

  • Local uv run poe check green
  • CI green on this PR
  • Next main push: Release TS Client workflow reaches the publish step (will fail until npm Trusted Publisher is configured — that's expected, final blocker is registry-side config)

Two independent fixes rolled into one branch since both are small
CI-reliability issues:

1. test_observe_service_timing_accuracy: upper-bound tolerance was 100ms
   on a test that sleeps for 50ms. CI runners occasionally add 50-100ms
   of scheduling jitter (last failure was at 109ms). Bumped to 500ms;
   still proves the decorator is measuring something in the right
   ballpark without being brittle on shared runners.

2. Release TS Client workflow failed on EINVALIDNPMTOKEN because
   @semantic-release/npm unconditionally auths when its `publish` step
   is enabled. Since we want OIDC Trusted Publishing (no NPM_TOKEN),
   split the flow:
     - @semantic-release/npm runs with npmPublish: false → handles
       analyzeCommits + version bump + tag (npm auth check is skipped
       when publish is disabled).
     - New "Publish to npm via OIDC Trusted Publisher" step runs
       `pnpm publish --provenance` after semantic-release succeeds.
       Requires Trusted Publisher config on npmjs.com (still pending).
Copilot AI review requested due to automatic review settings April 20, 2026 21:50
@dougborg dougborg merged commit ad1dded into main Apr 20, 2026
11 checks passed
@dougborg dougborg deleted the fix/ci-reliability-and-ts-release branch April 20, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Stabilizes CI by reducing timing-related test flakiness and updates the TS release pipeline to prepare releases via semantic-release while publishing to npm via OIDC Trusted Publishing (no NPM token).

Changes:

  • Relaxed the upper-bound assertion in an observability timing test to tolerate CI scheduling jitter.
  • Disabled npm publishing in @semantic-release/npm to decouple release creation from npm publish.
  • Added an explicit pnpm publish step in the TS release workflow with provenance enabled for OIDC-based publishing.

Reviewed changes

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

File Description
statuspro_mcp_server/tests/test_observability_decorators.py Increases timing tolerance to reduce flaky CI failures.
packages/statuspro-client/.releaserc.json Configures semantic-release npm plugin to skip publishing to npm.
.github/workflows/release-ts.yml Splits semantic-release (tag/version/changelog) from npm publishing via OIDC.

fi

- name: Publish to npm via OIDC Trusted Publisher
if: steps.release.outputs.new_release_published == 'true'

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

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

The new publish step only runs when steps.release.outputs.new_release_published == 'true', so workflow_dispatch with inputs.force_publish: true still won’t publish if semantic-release decides “no release” (e.g., tag already exists or no release-type commits). Update the condition/logic so force_publish can trigger pnpm publish independently (or set new_release_published=true when forced).

Suggested change
if: steps.release.outputs.new_release_published == 'true'
if: steps.release.outputs.new_release_published == 'true' || inputs.force_publish == true

Copilot uses AI. Check for mistakes.
Comment on lines +104 to 114
- name: Semantic release (tag + version bump + changelog, skip npm publish)
id: release
if: steps.check.outputs.has_changes == 'true' || inputs.force_publish == true
working-directory: packages/statuspro-client
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
NPM_CONFIG_PROVENANCE: "true"
run: |
# Capture semantic-release output so callers can read outputs.
# @semantic-release/npm is configured with npmPublish: false, so this
# step only runs analyzeCommits → version bump → tag → GitHub release.
# The actual npm publish happens in the next step via OIDC.
OUTPUT=$(npx semantic-release 2>&1) || {

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

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

Because npm publish is now a separate step after semantic-release, a failure in pnpm publish can leave a ts-v* tag + GitHub release created but no npm package published; rerunning the workflow may then skip semantic-release and never reach the publish step. Consider running the publish command inside semantic-release’s publish lifecycle (e.g., via an exec plugin) or otherwise ensuring the workflow can retry the npm publish for an already-tagged release.

Copilot uses AI. Check for mistakes.
Comment on lines +134 to +136
# Uses GitHub Actions OIDC — no NPM_TOKEN required.
# Requires Trusted Publisher configured on npmjs.com for this package + workflow.
pnpm publish --no-git-checks --access public

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

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

PR description mentions pnpm publish --provenance, but the workflow runs pnpm publish without the flag. If provenance is required for Trusted Publishing, add the explicit flag (or update the PR description to reflect that provenance is driven via publishConfig.provenance / NPM_CONFIG_PROVENANCE).

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants