Enrich spec-changes manifest + changelog preview for dashboard#39
Merged
Conversation
Extend the spec-changes producer the SDK bot consumes so the redesigned dashboard can show changed endpoints, the originating commit/PR, and an editable changelog before generation: - build-spec-changes.mjs: emit per-service changedEndpoints (method/path/breaking resolved from the IR, post-mount attributed) and the manifest's commitMessage/prNumber/prUrl. The lean buildSpecChanges rollup the bot's pending logic depends on is unchanged — enrichment happens only in the CLI, so the existing tests stay green. - spec-changes.yml: pass the commit subject + originating PR number through. - changelog-preview.yml + render-changelog-preview.mjs: on-demand workflow that renders the changelog scoped to a staged service set with the canonical renderChangelogMarkdown logic and POSTs it to the bot (HMAC-signed) for the "Generate staged" preview. - sdk-release-metadata.mjs: export publicScopeFromService + renderChangelogMarkdown and guard the CLI behind a direct-invocation check so they're importable. - generate-prs.yml: changelog_override input writes the operator-edited changelog into the .changelog-pending fragment instead of the computed bullets. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR enriches spec-change metadata and adds a dashboard changelog preview path. The main changes are:
Confidence Score: 5/5The changes appear merge-safe based on the reviewed workflow and script updates. No blocking correctness issues were identified in the changed manifest enrichment, changelog preview, helper exports, or override handling.
What T-Rex did
|
Address Greptile review on #39: - render-changelog-preview.mjs: map staged post-mount service names to changelog scopes through mountRules, not publicScopeFromService alone. ClientApi's scope is `client` (IR `Client` mounts to `ClientApi`), so a ClientApi-only preview was filtering on `client_api` and rendering blank. scopesForStaged is exported and unit-tested; changelog-preview.yml now builds dist/policy.mjs for the rules. - changelog-preview.yml: report baseSha as `git rev-parse "$BASE_REF"` (the ref actually rendered) instead of github.sha, so the bot's "spec advanced since preview" check compares like-for-like. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scopesForStaged only followed service-level mountRules, so per-operation mountOn hints (e.g. the audit-log-retention ops live under /organizations but mount on AuditLogs) were dropped: an AuditLogs-only preview rendered blank for those staged entries. Expand the scope set with each mountOn hint whose target is staged, deriving the operation's source scope from its path head through the same publicScopeFromService the producer uses. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
changedEndpoints(method/path/breaking, resolved from the IR after mount-time attribution) plus the originatingcommitMessage/prNumber/prUrlon the manifest.buildSpecChangesrollup the bot's pending logic depends on unchanged — enrichment lives only in the CLI path, so existing tests stay green.changelog-preview.ymlworkflow +render-changelog-preview.mjsthat renders the changelog scoped to a staged service set using the canonicalrenderChangelogMarkdownlogic and POSTs it (HMAC-signed) to the bot for the "Generate staged" preview.publicScopeFromService+renderChangelogMarkdownfromsdk-release-metadata.mjsand guard the CLI behind a direct-invocation check so they're importable.spec-changes.yml: thread the commit subject + originating PR number through.generate-prs.yml: achangelog_overrideinput writes the operator-edited changelog into the.changelog-pendingfragment instead of the computed bullets.Test plan
node --test scripts/__tests__/build-spec-changes.spec.mjspasses (existing rollup unchanged)changedEndpoints+ commit/PR metadata; module import does not run the CLIchangelog_overridewrites the edited changelog into.changelog-pending🤖 Generated with Claude Code