fix(ci): watch mount-rules.ts in the spec-changes path filter - #120
Merged
Conversation
The producer resolves every changed symbol to its post-mount service via `mountRules`, so a mount-rules edit re-partitions already-published endpoints — renaming a service, or moving endpoints between services — and changes the SDK surface without touching spec/**. Under the `spec/**`-only filter such a merge did not even start a run. Surfaced by #112, which added a FlagTargetTypes rule and never triggered one. That PR was harmless on its own (its endpoints are still ApiExcludeController, so the diff would have been empty anyway), but a rule touching live endpoints would have skipped the bot the same way. This is the prerequisite, not the whole fix: `changedServices` is derived from an old-spec-vs-new-spec `oagen diff`, which is empty when only the rules moved, so the run still ends at the "No service changes" check. Surfacing a re-partition additionally needs a partition diff (old rules vs new rules over the same spec), which this job does not compute — left for a follow-up rather than smuggled into a path-filter change. Scoped to just this file rather than src/policy/**: build-spec-changes.mjs reads `mountRules` and nothing else out of dist/policy.mjs.
gjtorikian
force-pushed
the
chore/spec-changes-watch-mount-rules
branch
from
August 26, 2026 16:34
78908ea to
a7d9c36
Compare
Greptile SummaryThis PR expands the
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "Update spec-changes.yml" | Re-trigger Greptile |
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
Record spec changesonly fires onpaths: spec/**. But the producer resolves every changed symbol to its post-mount service viamountRules(scripts/build-spec-changes.mjs), so editing the rules re-partitions already-published endpoints — a service rename, or moving endpoints between services — and changes the SDK surface without touchingspec/**. Today such a merge doesn't even start a run.Scope — this is the prerequisite, not the whole fix
Worth being explicit, since the title reads like a complete fix and isn't:
changedServicesis built by iteratingreport.changesfrom an old-spec-vs-new-specoagen diff. When only the rules moved, both sides of that diff are the same spec, the report is empty, and the run falls through to theNo service changes; nothing to pushcheck at line ~133 and exits 0.So this PR makes the run happen, which is necessary for any future detection, but on its own it will not surface a re-partition. Doing that needs a partition diff — resolving the same spec under the old rules and the new rules and comparing the resulting service→endpoint mapping. That's a real change to
build-spec-changes.mjs, so I've left it out rather than smuggling it into a path-filter edit. Happy to open a follow-up if you want it.How it surfaced
#112 added a
FeatureFlagsTargetTypes: 'FlagTargetTypes'rule, and no run exists for its merge commit (882f139, merged 08-24 19:14Z; that day's runs were 15:22, 17:20, 23:20). That PR was harmless either way — its endpoints are still@ApiExcludeController(), so the spec diff would have been empty — but a rule touching live endpoints would have skipped the bot identically.Why only
mount-rules.tsand notsrc/policy/**build-spec-changes.mjsreadsmountRulesand nothing else out ofdist/policy.mjs(seeloadPolicy()), sonaming.ts/transforms.ts/operation-hints.tsdon't affect this manifest.Test plan
pathsparses as["spec/**", "src/policy/mount-rules.ts"].spec/**merges — this only widens what starts a run; the job body is untouched.