Skip to content

Conversation

@yelizhenden-mdb
Copy link
Collaborator

@yelizhenden-mdb yelizhenden-mdb commented Apr 7, 2025

Proposed changes

Jira ticket: CLOUDP-310538

PR removes the legacy Spectral rules which duplicate the current error-level IPA rules according to this table in the Technical Design document

xgen-schema-properties-camel-case
xgen-description
xgen-request-GET-no-body
xgen-request-DELETE-no-body
no-slash-before-custom-method

Note: xgen-docs-parameter-examples-or-schema legacy rule will be removed after xgen-IPA-117-parameter-has-examples-or-schema rolled out

Note: It is discussed with APIx-2 before, that removal of duplicate legacy rules will not affect any APIx-2 workflow (discussion link)

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

@yelizhenden-mdb yelizhenden-mdb marked this pull request as ready for review April 7, 2025 08:53
@yelizhenden-mdb yelizhenden-mdb requested a review from a team as a code owner April 7, 2025 08:53
- "$.components.schemas[*]..properties[?(@ && @.type)]"

rules:
xgen-schema-properties-camel-case:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you check if there are overrides for these below that can be removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Overrides removed for all the removed legacy Spectral rules 👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note: xgen-docs-parameter-examples-or-schema legacy rule will be removed after xgen-IPA-117-parameter-has-examples-or-schema rolled out

Do we have a ticket for this? Or is it covered in one of the existing tickets?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created the ticket for the last rollout, and included this one there. Let me know how it sounds

Copy link
Collaborator

@lovisaberggren lovisaberggren left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Remember to also update the sha ref and overrides in mms

then:
function: pattern # casing?
functionOptions:
match: "/^[a-z$_]{1}[A-Z09$_]*/" # type: camel ?
Copy link
Member

Choose a reason for hiding this comment

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

[To ensure] Is that regexp exactly the same that the one we have or it is least restrictive?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are using Spectral's camel casing rule, such as
[CasingType.camel]: '[a-z][a-z{__DIGITS__}]*(?:[A-Z{__DIGITS__}](?:[a-z{__DIGITS__}]+|$))*',
Only difference I can see is that Spectral one does not allow underscores

@yelizhenden-mdb yelizhenden-mdb merged commit bbf23a7 into main Apr 7, 2025
8 checks passed
@yelizhenden-mdb yelizhenden-mdb deleted the CLOUDP-310538 branch April 7, 2025 13:20
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.

3 participants