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

Add OpenAPI compatibility checker #5106

Merged

Conversation

simonnepomuk
Copy link
Contributor

@simonnepomuk simonnepomuk commented Aug 31, 2024

Hi guys,

this would be useful for many projects I'm facing with enterprise customers. Would be happy if someone would be able to review.

This should close #15

@apicurio-bot
Copy link

apicurio-bot bot commented Aug 31, 2024

Thank you for creating a pull request!

Pinging @jsenko to respond or triage.

@EricWittmann
Copy link
Member

Thanks @simonnepomuk - we'll have a look at this asap and discuss. Using the diff as the basis for the compatibility check makes sense, and this could be a nice first step for OpenAPI compatibility.

The problem with full OpenAPI compatibility checking is that there are lots of ways the API definition could change, and it's actually pretty hard to determine which of those changes are incompatible. I'll give you an example:

If you add a new required property to a schema type, is that a compatible change? It probably depends on whether that schema type is used as an input to an operation (INCOMPATIBLE) or an output (COMPATIBLE).

This is the kind of thing that has made us hesitate to implement the feature. That said, it could be argued that having at least some compatibility checking is better than none!

@EricWittmann
Copy link
Member

Quick note to @simonnepomuk : could you please run mvn spotless:apply and then push the resulting changes? That should retrigger all of the CI tests.

@simonnepomuk
Copy link
Contributor Author

simonnepomuk commented Sep 3, 2024

@EricWittmann I've tried to apply the codestyles, hopefully the CI will run now :)

Regarding your general concerns: I get your hesitation, thats why I delegated the "hard" work to the library provided through OpenAPI which also comes with compatibility checks. I'm not sure wether the tricky situations you described are picked up through the library or not, I would argue that the best way to go about it would be to resolve them over there though. Glancing through the library code gave me a solid impression though.

If you have a list of hard to determine compatibility issues, I'd be happy to assist in analysing the OpenAPI diff library.

Still, I would also agree with your last argument, that some checks are better than none. That should be noted in the documentation though, so people don't put too much trust in the compatibility checking mechanism.

@simonnepomuk
Copy link
Contributor Author

@EricWittmann Could you maybe retrigger the failed integration test workflow? Looks like some CI issue to me.

I would need help in addressing the native image build errors as I have no clue whats going on there.

@EricWittmann
Copy link
Member

Yeah we are having some issues with inconsistent CI results. We are working on that.

As for the native image issues, I'll have @carlesarnal take a look. 😁

@simonnepomuk simonnepomuk force-pushed the add-openapi-compatibility-checker branch 2 times, most recently from 84c1cfc to 41603fd Compare September 5, 2024 17:47
@simonnepomuk
Copy link
Contributor Author

@carlesarnal Could you rerun the workflows? I think I fixed the native build issue, at least it runs on my machine now.

@simonnepomuk simonnepomuk force-pushed the add-openapi-compatibility-checker branch from 41603fd to b18b370 Compare September 6, 2024 16:23
@simonnepomuk
Copy link
Contributor Author

Sorry, formatting was off again. Maybe we could add a pre-commit hook to run mvn spotless:apply?

@EricWittmann
Copy link
Member

Sorry, formatting was off again. Maybe we could add a pre-commit hook to run mvn spotless:apply?

I was thinking the same thing recently actually. @andreaTP wdyt?

@EricWittmann
Copy link
Member

@simonnepomuk Update: CI is failing for a new reason. Give us a day or two more, we're actively working on fixing CI. Once we do you can Update branch and the workflows should all run properly.

@simonnepomuk simonnepomuk force-pushed the add-openapi-compatibility-checker branch from 3c0043c to 93f0e32 Compare September 9, 2024 14:15
@carlesarnal
Copy link
Member

@simonnepomuk CI should be more reliable now, I recommend rebasing main (and I will approve the execution).

@simonnepomuk simonnepomuk force-pushed the add-openapi-compatibility-checker branch from 93f0e32 to 37dc916 Compare September 9, 2024 15:31
@simonnepomuk
Copy link
Contributor Author

@simonnepomuk CI should be more reliable now, I recommend rebasing main (and I will approve the execution).

Done :)

@EricWittmann
Copy link
Member

All green. Noice.

@jsenko Any concerns?

@EricWittmann EricWittmann merged commit c5acb15 into Apicurio:main Sep 10, 2024
19 checks passed
@EricWittmann
Copy link
Member

Thanks for the contribution @simonnepomuk - apologies it took so long to get merged. :)

@simonnepomuk simonnepomuk deleted the add-openapi-compatibility-checker branch September 15, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compatibility Rule: OpenAPI
3 participants