Skip to content

Conversation

yelizhenden-mdb
Copy link
Collaborator

@yelizhenden-mdb yelizhenden-mdb commented Jan 3, 2025

Proposed changes

In scope of Jira ticket: CLOUDP-291457

According to the levels defined in IPA Validations Framework Technical Design document, exceptions can be applied at the Schema or Schema Property level.

Changes in this PR:

  • Enums defined directly within a schema and those defined for a schema property are now evaluated separately.
  • Error messages now identify the schema or schema property responsible for the rule violation, aligning with the level at which exceptions are defined.
  • Example of updated error message:
    Rule Name: xgen-IPA-123-enum-values-must-be-upper-snake-case
    Error Message: enum[0]:bits enum value must be UPPER_SNAKE_CASE. http://go/ipa/123
    Path: components.schemas.HostMetricValue.properties.units

Clarification on Exception Scope:

  • Developers cannot define exceptions for individual enum values.
  • When an exception is defined for a schema or schema property, it applies to all enum values associated with that object.

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

@yelizhenden-mdb yelizhenden-mdb marked this pull request as ready for review January 3, 2025 14:36
@yelizhenden-mdb yelizhenden-mdb requested a review from a team as a code owner January 3, 2025 14:36
@yelizhenden-mdb yelizhenden-mdb merged commit 1157520 into main Jan 3, 2025
13 checks passed
@yelizhenden-mdb yelizhenden-mdb deleted the IPA-123-fix branch January 3, 2025 15:17
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.

2 participants