feat(vulnerability): regenerate client from latest openapi spec#507
Conversation
Need to check if it's a breaking change
There was a problem hiding this comment.
@Siasurai Looks like the regenerated client includes breaking changes and therefore technically requires a major version bump, which can be achieved by appending an exclamation mark after the conventional commit type eg. feat(vulnerability)!.... More info available here https://www.conventionalcommits.org/en/v1.0.0/
These are some of the breaking changes:
- Removed exported interfaces — consumers using these get compile errors:
-BusinessRiskListOutData,BusinessRiskListOutMeta
-CveDetailOutData,CveDetailOutDataAttributes
-StatusListOutData,StatusListOutMeta
-SystemDetailsOutData,SystemDetailsOutDataTags
-DashboardCvesBySeverity,DashboardRecentRules - Changed property types in existing interfaces:
-AffectedSystemsIdsOut.links: Links→InlineResponse2003Links
-AffectedSystemsIdsOut.meta: MetaAffectedSystems→object(loses type safety) - Function return type changes:
-getAffectedSystemsIdsByCve(): Returns InlineResponse2004instead ofAffectedSystemsIdsOut
I wonder if the vulnerability API itself is versioned and if so, does it adhere to semantic versioning?
e91e45c to
1cb35da
Compare
|
@charlesmulder I updated the commit message to I also asked our backend developer about API versioning. He said the service uses semantic versioning, but the API is still v1 and there should not be any breaking changes (not since the last client generation) New changes should only be added endpoints and attributes. So the breaking changes in this PR are probably from the generator producing different TypeScript structures (maybe a different generator version), not from real breaking API changes |
|
Thank you for finding out @Siasurai. I have approved the PR. In my opinion, from a javascript-clients point of view, the updated client contains breaking changes, even though the API does not, so using the new API endpoints will require a major version update of the client. |
|
Hi @Siasurai Please update the commit message scope to include the full package name ie. |
|
@charlesmulder thanks for noticing, I'll ofc update the message FYI: I’ve also moved this PR to draft so backend can check why the API schemas are sent without $ref |
|
@charlesmulder Hi Could you please take another look at the review when you have a moment? Thanks a lot in advance! |
|
Hi @Siasurai Thank you for spending time on this. Still a breaking change requiring adding an
Before: interface CvesWithoutErrataOut {
updated: CvesWithoutErrataOutUpdated;
meta: MetaPermissions;
}After: interface CvesWithoutErrataOut {
cves_without_errata: CvesWithoutErrataOutCvesWithoutErrata;
}
Replaced old nested structure with: interface CvesWithoutErrataOutCvesWithoutErrata {
enabled?: boolean;
}
getCvesWithoutErrata() // New method |
|
@charlesmulder thank you for review! And done 😊 |
Description
regenerate API client for vulnerability from latest openapi spec
https://redhat.atlassian.net/browse/RHINENG-26655