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

Migrate API server specification from Swagger 2.0 to OpenAPI 3.1 #4763

Closed
wants to merge 8 commits into from

Conversation

kanpov
Copy link
Contributor

@kanpov kanpov commented Aug 31, 2024

Changes

Migrate the specification from Swagger 2.0 to OpenAPI 3.1, name the directory with the specification openapi instead of swagger.

  • 2.0 => 3.0
  • 3.0 => 3.1
  • swagger => openapi

Reason

Resolves #4751, see discussion about this change there.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@kanpov
Copy link
Contributor Author

kanpov commented Aug 31, 2024

OAS 3.1 spec is rendered without any deprecation or other warnings on https://editor-next.swagger.io/ (mainline version has no OAS 3.1 support, only 3.0).

@kanpov kanpov marked this pull request as ready for review August 31, 2024 11:53
Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.34%. Comparing base (87a03c7) to head (35fa600).
Report is 3 commits behind head on main.

Current head 35fa600 differs from pull request most recent head 0e547b4

Please upload reports for the commit 0e547b4 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4763      +/-   ##
==========================================
+ Coverage   84.31%   84.34%   +0.02%     
==========================================
  Files         249      249              
  Lines       27522    27460      -62     
==========================================
- Hits        23206    23160      -46     
+ Misses       4316     4300      -16     
Flag Coverage Δ
5.10-c5n.metal 84.56% <ø> (+0.02%) ⬆️
5.10-m5n.metal 84.55% <ø> (+0.03%) ⬆️
5.10-m6a.metal 83.83% <ø> (+0.01%) ⬆️
5.10-m6g.metal 80.91% <ø> (+0.01%) ⬆️
5.10-m6i.metal 84.54% <ø> (+0.01%) ⬆️
5.10-m7g.metal 80.91% <ø> (+0.01%) ⬆️
6.1-c5n.metal 84.56% <ø> (+0.02%) ⬆️
6.1-m5n.metal 84.54% <ø> (+0.01%) ⬆️
6.1-m6a.metal 83.83% <ø> (+0.02%) ⬆️
6.1-m6g.metal 80.91% <ø> (+0.01%) ⬆️
6.1-m6i.metal 84.54% <ø> (+0.02%) ⬆️
6.1-m7g.metal 80.90% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@pb8o pb8o left a comment

Choose a reason for hiding this comment

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

Ho @kanpov, thanks for your contribution! I think this is already pretty complete, it just needs some minimal changes regarding style and a small fix.

@@ -18,5 +18,5 @@ def test_firecracker_swagger():
"""
Test that Firecracker swagger specification is valid.
"""
swagger_spec = Path("../src/firecracker/swagger/firecracker.yaml")
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we could also rename the file

tools/functions Outdated Show resolved Hide resolved
CHANGELOG.md Outdated
@@ -20,6 +20,8 @@ and this project adheres to
[#4741](https://github.com/firecracker-microvm/firecracker/pull/4741),
[#4746](https://github.com/firecracker-microvm/firecracker/pull/4746): Added
official support for 6.1 microVM guest kernels.
- [#4763](https://github.com/firecracker-microvm/firecracker/pull/4763): Migrated
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you run tools/devtool checkstyle, I think mdformat wants to format this differently.

Also, our development practices require some description of the commit in the git commit body. See https://buildkite.com/firecracker/firecracker-pr/builds/10907#0191b1ca-d4ec-47be-965a-f79d5d483664/62-182

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My build directory got corrupted somehow and made mdformat crash, after which I had to delete it entirely and then it ran.

Description of the commit I don't understand though. At the end of the day, all of this can just be squashed before merge with a detailed description, or am I wrong?

@kanpov
Copy link
Contributor Author

kanpov commented Sep 8, 2024

I guess this is also blocked by this? #4751 (comment)

@kanpov
Copy link
Contributor Author

kanpov commented Sep 10, 2024

This PR will be succeeded by another one that applies these changes in a backwards-compatible manner, i.e. keeps the OAS2 definition as deprecated.

@kanpov kanpov closed this Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Move to OpenAPI / OAS 3.1
2 participants