Skip to content

Conversation

@sphterry
Copy link
Contributor

@sphterry sphterry commented Jul 2, 2025

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

@sphterry sphterry marked this pull request as ready for review July 2, 2025 14:06
@sphterry sphterry requested review from a team as code owners July 2, 2025 14:06
@sphterry sphterry enabled auto-merge (squash) July 2, 2025 14:06
@sphterry sphterry self-assigned this Jul 2, 2025
@sphterry sphterry disabled auto-merge July 2, 2025 14:29
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.

Nice work! Added some suggestions and questions, let me know if you need more clarity on any of the comments 👍

Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM. Great work! 💯

@wtrocki wtrocki requested a review from Copilot July 2, 2025 19:02
Copy link

Copilot AI left a 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 removePrefix helper for reuse
  • Implemented generateOperationID (with helpers) in operationIdGeneration.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 describe path 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', () => {

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.

Thanks for the changes, LGTM! 🚀

@sphterry sphterry merged commit 77ba551 into main Jul 3, 2025
8 checks passed
@sphterry sphterry deleted the CLOUDP-328283 branch July 3, 2025 11:16
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