Skip to content

fix(auto-publish): compose URL from STARSTATS_API_URL instead of a separate secret#133

Merged
ntatschner merged 1 commit into
nextfrom
fix/auto-publish-compose-url
May 28, 2026
Merged

fix(auto-publish): compose URL from STARSTATS_API_URL instead of a separate secret#133
ntatschner merged 1 commit into
nextfrom
fix/auto-publish-compose-url

Conversation

@ntatschner
Copy link
Copy Markdown
Collaborator

Summary

  • scripts/auto-publish-changelog.mjs now reads STARSTATS_API_URL (existing secret) and composes the publish endpoint path itself.
  • ROADMAP_PUBLISH_URL plumbing dropped from script + workflow.
  • Trailing-slash tolerance on the base URL.

Why

PR #128 mirrored the ROADMAP_EVENTS_URL pattern (full URL per endpoint as a separate secret), but that was over-engineered here. STARSTATS_API_URL was already provisioned for the earlier JWT-based admin publish script (PR #113), and the publish endpoint URL is fully derivable from it. One secret instead of two — and after this PR ramps, the auto-publish path activates on the next live release with no additional operator step.

Surfaced empirically: today's tray-v1.8.10 live release ran the auto-publish job to green status, but the log showed [auto-publish] no-op: ROADMAP_PUBLISH_URL not set (pipeline not configured) — the secret just wasn't there. Rather than provision a redundant secret, drop the redundancy.

Test plan

  • node -c scripts/auto-publish-changelog.mjs syntax clean
  • No-env smoke: soft-skips with [auto-publish] no-op: ROADMAP_CI_EVENT_HMAC_KEY not set
  • API_URL-only smoke: soft-skips on HMAC_KEY missing (correct precedence)
  • YAML parses, job env keys: ROADMAP_ITEM_SLUG, CHANNEL, ROADMAP_CI_EVENT_HMAC_KEY, STARSTATS_API_URL
  • After merge: next live release fires the auto-publish job; log shows it actually called the endpoint instead of no-op'ing

What does NOT change

  • roadmap-emit-event.mjs still uses ROADMAP_EVENTS_URL (its own full-URL secret). Working, shipped, no value in bundling a parallel refactor.
  • The admin JWT-based path (publish-roadmap-drafts.mjs) still uses STARSTATS_API_URL — no change there.

Should land + ramp through alpha→beta→rc→live cycle. Once on Live, the next subsequent release auto-activates the HMAC publish path with zero operator action.

…parate secret

PR #128 introduced a `ROADMAP_PUBLISH_URL` env var holding the full
URL of the publish endpoint. Followed the same pattern as
`ROADMAP_EVENTS_URL`, but it was wrong here: STARSTATS_API_URL
already exists as a secret (set up for the earlier JWT-based admin
publish script in PR #113), and the publish endpoint is just
`${STARSTATS_API_URL}/v1/internal/roadmap/changelog/publish` — one
path, one composition rule, no second secret to provision.

Switch the script to compose from STARSTATS_API_URL, drop the
ROADMAP_PUBLISH_URL plumbing entirely. The release.yml job now
reads only `secrets.STARSTATS_API_URL` (already provisioned, set
to `https://api.starstats.app`), so the auto-publish path activates
on the next live release without any additional operator action.

Trailing-slash tolerance: `replace(/\/+$/, "")` on the base so
`https://api.starstats.app` and `https://api.starstats.app/` both
resolve identically.

Surfaced post-merge of #128: today's tray-v1.8.10 live release ran
the auto-publish job successfully but no-op'd with
`ROADMAP_PUBLISH_URL not set (pipeline not configured)`. After this
PR ramps + merges, the next live release exercises the HMAC path
for real with no secret-provisioning step in between.

Not harmonizing `ROADMAP_EVENTS_URL` in the same PR — that's a
separate refactor on a stable existing path, low value to bundle.
@ntatschner ntatschner merged commit 6bced0b into next May 28, 2026
9 checks passed
@ntatschner ntatschner deleted the fix/auto-publish-compose-url branch May 28, 2026 20:12
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.

1 participant