Skip to content

Conversation

@blva
Copy link
Collaborator

@blva blva commented Mar 10, 2025

Proposed changes

_Jira ticket:_CLOUDP-302671

Context: The OAS stored under v2.yaml and v2.json is the same used for the preview link in our repo. However, that OAS was not being filtered, containing extra extensions such as x-xgen-hidden-env, x-xgen-owner-team, IPA extensions and others. Given that this is the upper OAS in the repo, which is public, we have decided to filter out this APIx specific extensions out of them. However, we still find it very important to keep one raw, unfiltered OAS where we can see and track the full history of how extensions have changed. Furthermore, some tools will still leverage those extensions. To account for that, we opted for keeping an unfiltered raw file in a more hidden folder, to discourage external users to use it but still allow our tools and integrations to use an unfiltered file.

Changes:

  • Applies and stores the filtered version of the OAS in v2.yaml/v2.json automation
  • Moves the unfiltered FOAS into .raw/v2.yaml|json
  • Points all spectral linting tools to lint on .raw/v2.yaml|json since both IPA and versioning linting is performed in the extensions

Closes #[issue number]

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works

Changes to Spectral

  • I have read the README file for Spectral Updates

Further comments

@wtrocki
Copy link
Member

wtrocki commented Mar 10, 2025

LGTM for Approach! Thank you

@blva blva marked this pull request as ready for review March 10, 2025 14:24
@blva blva requested a review from a team as a code owner March 10, 2025 14:24
Copy link
Collaborator

@yelizhenden-mdb yelizhenden-mdb left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!


echo "Generate the versions.json file for private preview APIs"
foascli versions --spec ./openapi/v2.json --stability-level PRIVATE-PREVIEW -o ./openapi/v2/private/versions.json --env "${target_env:?}"
foascli versions --spec ./openapi/.raw/v2.json --stability-level PRIVATE-PREVIEW -o ./openapi/v2/private/versions.json --env "${target_env:?}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you filter out from the branded preview the v2 spec and the v2 in the .raw?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not sure I follow, but for the branded preview, I made it use the filtered version, since it would hide the hidden contents

Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a step in the release process where we create the branded preview (branded_preview.sh), and I see that right now https://htmlpreview.github.io/?https://github.com/mongodb/openapi/blob/main/openapi/branded-preview.html we list v2.json and v2.yaml. I am wondering if with these changes we will start to see also the spec in .raw 🤔 This can also be a follow up ticket. Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ohhh got it! good point, not sure and I hope not :D If we see it I'll remove in a follow-up


const config = {
defaultOasFilePath: path.join(rootDir, 'openapi', 'v2.json'),
defaultOasFilePath: path.join(rootDir, 'openapi', '.raw', 'v2.json'),
Copy link
Member

Choose a reason for hiding this comment

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

❤️

@blva blva merged commit 4611756 into main Mar 11, 2025
14 checks passed
@blva blva deleted the CLOUDP-302671-3 branch March 11, 2025 14:10
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.

4 participants