Bump pricing4ts to ^0.11.1 so Pricing2Yaml 3.1 can be registered - #58
Merged
Merged
Conversation
0.10.3 stops one version short of the current specification: 0.10.3: PRICING2YAML_VERSIONS = ["1.0","1.1","2.0","2.1","3.0"] 0.11.1: PRICING2YAML_VERSIONS = ["1.0","1.1","2.0","2.1","3.0","3.1"] so registering a pricing written against 3.1 is refused with "Unsupported version: 3.1", and the only way to register anything is to declare 3.0 and stay a version behind. No source change was needed: the imports SPACE uses - retrievePricingFromPath, retrievePricingFromText, and the Pricing/Plan/Feature/UsageLimit types - kept their signatures across the two releases. tsc passes and the API suite passes against a local MongoDB and Redis.
Contributor
Author
|
The red Integration Tests Run check on this PR is not caused by the change. The job reads its Mongo port and database name from the The workflow has never passed on a fork PR — every green run in its history came from a branch inside the repository. #62 fixes it, and its own check is green, which is the fix running on a fork PR. Once that lands this check should go green here too. |
Alex-GF
approved these changes
Jul 31, 2026
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.
What this changes
api/package.json:pricing4ts^0.10.3→^0.11.1.One line, plus the lockfile. No source file changes.
Why
0.10.3 stops one version short of the current specification:
So a service registering a pricing written against Pricing2Yaml 3.1 is refused
by a running SPACE:
The only way to register anything today is to declare
syntaxVersion: '3.0'and stay a version behind — which is what our own pricing has been carrying,
with a comment explaining why.
Verification
The parser. Same document, same call, both versions:
The build.
pnpm run build(tsc) passes. SPACE importsretrievePricingFromPath,retrievePricingFromTextand thePricing/Plan/Feature/UsageLimittypes; none of their signatures changedbetween the two releases.
The tests, run per file against a local MongoDB and Redis:
main(0.10.3)service.test.tscontract.test.tsSo the bump also clears a test that fails on
maintoday.Correction to an earlier version of this description. I first wrote here
that the whole suite produced extra failures in
contract.test.tson bothbranches, and guessed at state shared through the one database. That was wrong,
and the fault was mine: I had been pointing the tests at throwaway containers on
non-default ports while the machine was also building an unrelated project. With
Mongo 7.0.16 on 27017, Redis 7 on 6379 and the machine otherwise idle, the full
suite is clean:
701 tests across 12 files, on
mainand with this PR. The residual failures Isaw were 5000 ms timeouts under load, plus one test that draws a random pricing
file per run.
run-tests.shruns each file in its own vitest process, so thereis no cross-file state to worry about.
run-tests.shcallsvitestdirectly, which is not onPATHafter a plainpnpm install; I ran it withnpx vitestlocally and have left that change outof this PR.
Note on
syntaxVersionThe v3.1 specification page documents
syntaxVersionwith "Supported value:3.0", which looks like a documentation error rather than an intendedconstraint —
pricing4ts0.11.1 accepts3.1and lists it as the latest.Flagging in case it is worth correcting on the docs side too.