You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: discover development routes in the shared schema suite - #2248
The cross-route suite in api/tests/common-schemas.test.ts ran off literal route lists (seriesRoutes, rangeRoutes, and an integer-summary table). A new endpoint that nobody added to those lists silently skipped the shared granularity wording check, the inclusive-start / exclusive-end bounds check, and the unit check. None of the five batch-2 endpoints (#2247, #2245, #2244, #2243, #2246) is in the lists. Raised by @themarolt on #2243. Adding each route in its own PR would put five edits on the same lines of one shared test, the conflict pattern #2241 removed for route registration.
What
The suite now reads the development routes from the served /v1-alpha/openapi.json:
every development route must take the common range and document the inclusive start and exclusive end
every route with a granularity parameter must mark it required, use the shared enum, and carry Granularity.description
every response property shaped like a period summary (current, previous, percentageChange, changeValue), whatever its name, must state a unit on the three values and keep percentageChange a nullable number. Integer counts must say (count ...); numbers must say (seconds), (percent) or (percentage points). The unit may be followed by a sentence, so nullable notes (merge-lead-time) pass.
a guard asserts at least five routes, at least one series route and at least one summary were discovered
The module side is already pinned by tests/v1-alpha-autoload.test.ts (filename = path leaf), so between the two, a development module cannot be served without being checked.
Verification
On main: 61 tests in the file, full api suite green, lint, tsc-check, format:check green.
Against each open batch-2 branch (test file copied in, run, restored): merge-lead-time 67, review-time-by-pr-size 62, code-review-participants 63, review-comments 64, code-reviews 64, all green. So no open PR goes red when this merges, and each gets the checks it was missing.
Validate discovered route query shape against DateRangeQuery
api/tests/common-schemas.test.ts:481
This verifies the date wording but not the shared query shape, so a discovered route can omit repos or make a date required or non-date while still passing. Assert that repos, startDate, and endDate are present, optional, and use the types and formats from DateRangeQuery.
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
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.
Why
The cross-route suite in
api/tests/common-schemas.test.tsran off literal route lists (seriesRoutes,rangeRoutes, and an integer-summary table). A new endpoint that nobody added to those lists silently skipped the sharedgranularitywording check, the inclusive-start / exclusive-end bounds check, and the unit check. None of the five batch-2 endpoints (#2247, #2245, #2244, #2243, #2246) is in the lists. Raised by @themarolt on #2243. Adding each route in its own PR would put five edits on the same lines of one shared test, the conflict pattern #2241 removed for route registration.What
The suite now reads the development routes from the served
/v1-alpha/openapi.json:granularityparameter must mark it required, use the shared enum, and carryGranularity.descriptioncurrent,previous,percentageChange,changeValue), whatever its name, must state a unit on the three values and keeppercentageChangea nullable number. Integer counts must say(count ...); numbers must say(seconds),(percent)or(percentage points). The unit may be followed by a sentence, so nullable notes (merge-lead-time) pass.The module side is already pinned by
tests/v1-alpha-autoload.test.ts(filename = path leaf), so between the two, a development module cannot be served without being checked.Verification
main: 61 tests in the file, full api suite green, lint, tsc-check, format:check green.Jira: IN-1349