feat: backend - enable journey routing filter to be skipped#8603
Conversation
|
I see you added the "on stage" label, I'll get this merged to the stage branch! |
WalkthroughAdds a boolean Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Resolver as JourneyResolver
participant DB as Database
Client->>Resolver: query journey(id, options{ skipRoutingFilter })
alt options.skipRoutingFilter == true
Resolver->>DB: findUnique(where: { id })
DB-->>Resolver: journey
else options.skipRoutingFilter != true
Resolver->>DB: findUnique(where: { id, AND: [routingFilter] })
DB-->>Resolver: journey (possibly filtered)
end
Resolver-->>Client: return journey
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
View your CI Pipeline Execution ↗ for commit 752dafe
☁️ Nx Cloud last updated this comment at |
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
a5ed82f to
d426c20
Compare
…omisable-fields-not-showing-up
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apis/api-journeys/schema.graphql (1)
2240-2256: GateskipRoutingFilterto admin/internal callers.
Thejourneyquery is public (no auth guards) and exposesskipRoutingFilteronJourneysQueryOptions. Any client can setskipRoutingFilter: trueto bypass the custom domain routing filter, allowing unauthorized access to journeys that should be isolated by hostname. Add authorization checks (e.g.,@UseGuards(AppCaslGuard)) or move this flag to an admin-only query/input.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
apis/api-journeys/src/app/__generated__/graphql.tsis excluded by!**/__generated__/**
📒 Files selected for processing (4)
apis/api-journeys/schema.graphqlapis/api-journeys/src/app/modules/journey/journey.graphqlapis/api-journeys/src/app/modules/journey/journey.resolver.spec.tsapis/api-journeys/src/app/modules/journey/journey.resolver.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- apis/api-journeys/src/app/modules/journey/journey.resolver.ts
- apis/api-journeys/src/app/modules/journey/journey.resolver.spec.ts
- apis/api-journeys/src/app/modules/journey/journey.graphql
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: tataihono
Repo: JesusFilm/core PR: 7153
File: apis/api-journeys-modern/src/schema/journey/journey.ts:72-80
Timestamp: 2025-07-10T22:50:12.639Z
Learning: In the JesusFilm Core codebase, journey data is public and does not require authorization checks for read access in GraphQL queries like journeySimpleGet.
Learnt from: mikeallisonJS
Repo: JesusFilm/core PR: 7498
File: apis/api-journeys-modern/src/schema/action/emailAction/blockUpdateEmailAction.mutation.ts:26-36
Timestamp: 2025-09-08T22:56:21.606Z
Learning: In the action mutations migration (PR `#7498`), the `journeyId` parameter is intentionally kept in blockUpdate*Action mutations even when unused in the resolver, to maintain API compatibility during the migration from the old "api-journeys" endpoint to the modern "api-journeys-modern" endpoint.
📚 Learning: 2025-09-16T04:10:28.624Z
Learnt from: jaco-brink
Repo: JesusFilm/core PR: 7679
File: apis/api-gateway/schema.graphql:0-0
Timestamp: 2025-09-16T04:10:28.624Z
Learning: In PR `#7679` (showAssistant field), the showAssistant field was intentionally excluded from JourneyUpdateInput because it will be controlled through direct database operations rather than through GraphQL mutations, keeping it out of the public API surface while still being queryable.
Applied to files:
apis/api-journeys/schema.graphql
📚 Learning: 2025-09-08T22:56:21.606Z
Learnt from: mikeallisonJS
Repo: JesusFilm/core PR: 7498
File: apis/api-journeys-modern/src/schema/action/emailAction/blockUpdateEmailAction.mutation.ts:26-36
Timestamp: 2025-09-08T22:56:21.606Z
Learning: In the action mutations migration (PR `#7498`), the `journeyId` parameter is intentionally kept in blockUpdate*Action mutations even when unused in the resolver, to maintain API compatibility during the migration from the old "api-journeys" endpoint to the modern "api-journeys-modern" endpoint.
Applied to files:
apis/api-journeys/schema.graphql
📚 Learning: 2025-08-20T21:51:25.797Z
Learnt from: mikeallisonJS
Repo: JesusFilm/core PR: 7486
File: apis/api-journeys-modern/schema.graphql:1068-1074
Timestamp: 2025-08-20T21:51:25.797Z
Learning: Before suggesting type changes during API migrations, always verify the existing implementation to ensure consistency is maintained. The migration to api-journeys-modern should preserve the same field types as the original api-journeys schema.
Applied to files:
apis/api-journeys/schema.graphql
📚 Learning: 2025-08-26T20:45:14.971Z
Learnt from: mikeallisonJS
Repo: JesusFilm/core PR: 7498
File: apis/api-gateway/schema.graphql:117-152
Timestamp: 2025-08-26T20:45:14.971Z
Learning: During API migrations using Apollo Federation, override directives should be maintained in the gateway schema to route requests to the new service while keeping the old service as fallback. The override: "api-journeys" directive tells the supergraph to route requests to API_JOURNEYS_MODERN but fall back to the original api-journeys service if needed. These directives should only be removed after migration completion, not during the migration process.
Applied to files:
apis/api-journeys/schema.graphql
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: lint (22)
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
…omisable-fields-not-showing-up
…omisable-fields-not-showing-up
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.