Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on spec update, breakage in types used only by preview routes (and types unused by any routes) should be ignored for semver purposes #111

Open
wfraser opened this issue Oct 21, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@wfraser
Copy link
Member

wfraser commented Oct 21, 2022

Why is this feature valuable to you? Does it solve a problem you're having?
On spec update, we run the tests for the current version against code generated for the new version, and if tests fail, we assume the update is semver-incompatible.

This is mostly correct, however there are "preview" routes which are not covered under our stability guarantee, and breakage to these routes shouldn't necessitate a semver-incompatible version bump. Also occasionally types for routes which have not yet been published will end up in the spec, and these "unreachable" types shouldn't be considered breakage either.

Describe the solution you'd like
The difficulty lies in the fact that only routes are tagged as preview, but the tests mostly cover types. What we should do is build a dependency tree and extend the unstable feature to any types which are only referred to by preview routes. This will improve documentation as well. Then when doing the spec update build, we can disable the unstable feature and these tests will not be run.

Similarly, the dependency tree can find "unreachable" types, and their tests should be marked with #[ignore] since their correctness mostly doesn't matter: no routes use the types anyway.

Describe alternatives you've considered
Currently I do this with manual review, which is tedious, but this edge case happens fairly infrequently, so the cost is fairly low.

Additional context
For a real example, the 2022-10-11 spec update makes incompatible changes to the openid namespace, which only has preview routes.

Also prior to the 2022-10-01 spec update the openid namespace had unreachable types due to not having any routes.

@wfraser wfraser added the enhancement New feature or request label Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant