Skip to content

Conversation

cdoern
Copy link
Contributor

@cdoern cdoern commented Aug 26, 2025

What does this PR do?

this test runs on each PR and uses a new conformance workflow to compare the base (main) branch openapi spec to the one on this PR if one of our "stable" APIs change, the test will fail.

this workflow uses oasdiff to identify breaking changes for paths we want to ensure comptability for.

specifically this is using oasdiff breaking with --match-path which only checks breaking changes for the specified paths.

As a follow up to this, we can add an optional way to make it so that it is OK to make these change if properly documented or in a changelog or something. or by using a label on the PR to override the failing test.

related to #3237

Test Plan

conformance test should pass given there are no changes

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 26, 2025
@cdoern
Copy link
Contributor Author

cdoern commented Aug 26, 2025

need to write my own GH action for the openapi check, the action I am referencing is kind of out of date.

@cdoern cdoern force-pushed the conformance branch 13 times, most recently from 32608b9 to 0e1913d Compare August 27, 2025 22:34
@cdoern cdoern marked this pull request as ready for review August 27, 2025 22:38
@raghotham
Copy link
Contributor

raghotham commented Aug 27, 2025

is there a need for docker here? maybe we can a more lightweight approach like oasdiff in python and we can have a script that can also do path filtering instead of using command line tools directly?

Also, if its lightweight enough, we can maybe make it be part of pre-commit?

@cdoern
Copy link
Contributor Author

cdoern commented Aug 27, 2025

is there a need for docker here? maybe we can a more lightweight approach like oasdiff in python and we can have a script that can also do path filtering instead of using command line tools directly?

Sure! I can try using oasdiff. The custom containerfile element kind of snuck in due to the yq weirdness, I agree avoiding spinning up a container might be better.

I'll see if I can rework this.

ref: ${{ github.event.pull_request.base.ref }}
path: 'base'

# Build a custom container that includes both openapi-diff and yq tools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there is no longer a container?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry @raghotham , need to push one or two more changes to cleanup and change the description!

run: |
oasdiff breaking --fail-on ERR base/docs/_static/llama-stack-spec.yaml docs/_static/llama-stack-spec.yaml --match-path '^/v1/openai/v1' \
--match-path '^/v1/vector-io' \
--match-path '^/v1/vector-dbs'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the recourse when there is a legitimate breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking maintainers could apply a label that would override the failing test. Makes it such that these changes need to be very purposeful

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this likely should be a different PR made by a maintainer so it can be tested and such, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking something like combine with #3260 where if the PR that is breaking compatibility has a PR title prefix. Having a prefix would turn the oasdiff to just warning rather than failing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, lets merge #3260 first perhaps and then I can adapt it to run this as well? or vice-versa, either way is fine with me

@reluctantfuturist reluctantfuturist mentioned this pull request Aug 22, 2025
40 tasks
this test runs on each PR and uses a new conformance workflow to compare the base (main) branch openapi spec to the one on this PR
if one of our "stable" APIs change, the test will fail.

this workflow uses `oasdiff` to identify breaking changes for paths we want to ensure comptability for.

specifically this is using `oasdiff breaking` with `--match-path` which only checks breaking changes for the specified paths.

As a follow up to this, we can add an optional way to make it so that it is OK to make these change if properly documented or in a changelog or something.

related to llamastack#3237

Signed-off-by: Charlie Doern <[email protected]>
@raghotham raghotham merged commit ecd9d8d into llamastack:main Sep 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants