feat: add option to ignore external key checks#2598
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR introduces support for ignoring external keys during graph composition, adding a new Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## david/eng-9098-add-composition-options #2598 +/- ##
===========================================================================
+ Coverage 43.74% 56.85% +13.11%
===========================================================================
Files 1042 428 -614
Lines 146615 54038 -92577
Branches 9416 4803 -4613
===========================================================================
- Hits 64132 30723 -33409
+ Misses 80756 23292 -57464
+ Partials 1727 23 -1704
🚀 New features to boost your workflow:
|
Router image scan passed✅ No security vulnerabilities found in image: |
controlplane/src/core/bufservices/feature-flag/createFeatureFlag.ts
Outdated
Show resolved
Hide resolved
controlplane/src/core/bufservices/feature-flag/deleteFeatureFlag.ts
Outdated
Show resolved
Hide resolved
controlplane/src/core/bufservices/feature-flag/enableFeatureFlag.ts
Outdated
Show resolved
Hide resolved
controlplane/src/core/bufservices/feature-flag/updateFeatureFlag.ts
Outdated
Show resolved
Hide resolved
controlplane/src/core/bufservices/federated-graph/checkFederatedGraph.ts
Outdated
Show resolved
Hide resolved
controlplane/src/core/bufservices/federated-graph/createFederatedGraph.ts
Outdated
Show resolved
Hide resolved
controlplane/src/core/bufservices/federated-graph/migrateFromApollo.ts
Outdated
Show resolved
Hide resolved
controlplane/src/core/bufservices/federated-graph/updateFederatedGraph.ts
Outdated
Show resolved
Hide resolved
controlplane/src/core/bufservices/graph/setGraphRouterCompatibilityVersion.ts
Outdated
Show resolved
Hide resolved
Aenimus
left a comment
There was a problem hiding this comment.
Some small changes and we're good to go
|
@alepane21 can you also write a test? You can use the exact same subgraphs as in my PR |
This comment has been minimized.
This comment has been minimized.
controlplane/src/core/bufservices/monograph/publishMonograph.ts
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
| // Here we check if the schema is valid as a subgraph SDL | ||
| const result = buildSchema(newSchemaSDL, true, routerCompatibilityVersion); | ||
| const result = buildSchema(newSchemaSDL, true, routerCompatibilityVersion, { | ||
| ignoreExternalKeys: ignoreExternalKeysFeature?.enabled ?? false, |
There was a problem hiding this comment.
Shouldn't disableResolvabilityValidation also be set here?
There was a problem hiding this comment.
Fixed. A bit worried because it was missed also before ...
There was a problem hiding this comment.
buildSchema calls normalization, which doesn't use that flag. That's probably why it was not included before.
There was a problem hiding this comment.
I think you can remove it and put a comment like
// disableResolvabilityValidation not included because buildSchema only calls normalization
|
|
||
| const ignoreExternalKeysFeature = await orgRepo.getFeature({ | ||
| organizationId: authContext.organizationId, | ||
| featureId: 'composition-ignore-external-keys', |
There was a problem hiding this comment.
can we please create a constant somewhere for these feature ids please? we have others too in the codebase as loose strings repeated.
| const ignoreExternalKeysFeature = await orgRepo.getFeature({ | ||
| organizationId: authContext.organizationId, | ||
| featureId: 'composition-ignore-external-keys', | ||
| }); |
There was a problem hiding this comment.
I think put the ?.enabled ?? false here to save doing it everywhere else
52661b1
into
david/eng-9098-add-composition-options
Summary by CodeRabbit
New Features
--ignore-external-keysCLI flag to the compose command to ignore external entity keys during composition.composition-ignore-external-keysfeature flag for controlling external key handling.Bug Fixes
Chores
Checklist