test(composition): Add a test reproducing the composeDirective issue#2919
test(composition): Add a test reproducing the composeDirective issue#2919achmiel wants to merge 1 commit into
Conversation
WalkthroughThis PR adds a Vitest regression test to the ChangesCompose Directive Ordering Regression Test
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
composition/tests/v1/directives/compose-directive.test.ts (1)
503-559: ⚡ Quick winAlign new constant identifiers with the project constant naming rule.
The newly introduced
constbindings (composesButDoesNotApply,composesAndApplies,expected,appliesFirst,composesFirst) don’t follow the configuredUPPER_SNAKE_CASEconvention for constants.As per coding guidelines: “Use UPPER_SNAKE_CASE for constants.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@composition/tests/v1/directives/compose-directive.test.ts` around lines 503 - 559, Rename the local constant bindings to follow UPPER_SNAKE_CASE: change composesButDoesNotApply → COMPOSES_BUT_DOES_NOT_APPLY, composesAndApplies → COMPOSES_AND_APPLIES, expected → EXPECTED, appliesFirst → APPLIES_FIRST, and composesFirst → COMPOSES_FIRST; update all uses (calls to createSubgraph, federateSubgraphsSuccess, normalizeString, schemaToSortedNormalizedString, and the expect assertions) to refer to the new identifiers so the test compiles and adheres to the project constant naming rule.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@composition/tests/v1/directives/compose-directive.test.ts`:
- Around line 503-559: Rename the local constant bindings to follow
UPPER_SNAKE_CASE: change composesButDoesNotApply → COMPOSES_BUT_DOES_NOT_APPLY,
composesAndApplies → COMPOSES_AND_APPLIES, expected → EXPECTED, appliesFirst →
APPLIES_FIRST, and composesFirst → COMPOSES_FIRST; update all uses (calls to
createSubgraph, federateSubgraphsSuccess, normalizeString,
schemaToSortedNormalizedString, and the expect assertions) to refer to the new
identifiers so the test compiles and adheres to the project constant naming
rule.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a890fd18-51e7-4e9b-b693-931271973d36
📒 Files selected for processing (1)
composition/tests/v1/directives/compose-directive.test.ts
Summary by CodeRabbit
@composeDirectivedirectives are correctly preserved during subgraph federation, regardless of the order in which subgraphs are processed. Confirms no warnings are emitted.Context
This PR contains a failing test to illustrate the issue (#2920) and is not meant to be merged.
Open Source AI Manifesto
This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.