-
Notifications
You must be signed in to change notification settings - Fork 14
CLOUDP-328283: Implemented Operation ID Generation utility #801
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Added some suggestions and questions, let me know if you need more clarity on any of the comments 👍
tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great work! 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a utility to generate IPA-compliant Operation IDs, adds unit tests for it, and updates Jest and Babel configs to support the ember-inflector package.
- Exported the
removePrefixhelper for reuse - Implemented
generateOperationID(with helpers) inoperationIdGeneration.js - Added corresponding Jest tests and adjusted config to allow testing
ember-inflector
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/spectral/ipa/rulesets/functions/utils/resourceEvaluation.js | Exported removePrefix for use in ID generation |
| tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js | New generateOperationID utility and helpers |
| tools/spectral/ipa/tests/utils/operationIdGeneration.test.js | Unit tests for Operation ID generation |
| package.json | Added ember-inflector, Jest transformIgnorePatterns |
| babel.config.json | Added CommonJS transform plugin for tests |
Comments suppressed due to low confidence (1)
tools/spectral/ipa/tests/utils/operationIdGeneration.test.js:4
- [nitpick] The
describepath does not match the actual file location (rulesets/functions/utils/operationIdGeneration.js). Consider updating it to reflect the real module path for clarity.
describe('tools/spectral/ipa/utils/operationIdGeneration.js', () => {
tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/__tests__/utils/operationIdGeneration.test.js
Outdated
Show resolved
Hide resolved
tools/spectral/ipa/rulesets/functions/utils/operationIdGeneration.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Lovisa Berggren <[email protected]> Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, LGTM! 🚀
Proposed changes
Implemented the base logic for Operation ID validation. Added unit tests for generation function and edited Jest config to enable testing with 3rd party package (ember-inflector).
Jira ticket: CLOUDP-328283
Further comments
For generation outline and choice of library see - Technical Design