Repository navigation
fix(core): reject duplicate nonrepeatable directives - #693
flyingrobots merged 5 commits into
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds directive-repeatability tracking to the Apollo SDL lowering adapter: it detects ChangesRepeatable Directive Lowering
Security Tooling Documentation
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ 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 |
🔍 The Case of Pull Request #693Schema Sets
Schema Set
|
…sture docs: document security tooling posture
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/wesley-core/src/adapters/apollo.rs (1)
964-971: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPromote
extract_directives_with_repeatabilityout ofApolloLoweringAdapter
It doesn’t use adapter state, so theApolloLoweringAdapter::new(0)calls infield_argument_from_input_value,schema_operation_from_field, andoperation_argument_from_input_valueare unnecessary ceremony. Make it a free function or associated fn to remove those throwaway adapters.🤖 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 `@crates/wesley-core/src/adapters/apollo.rs` around lines 964 - 971, Move the directive extraction logic out of ApolloLoweringAdapter since extract_directives_with_repeatability does not depend on adapter state. Update field_argument_from_input_value, schema_operation_from_field, and operation_argument_from_input_value to call a free function or associated function directly instead of constructing ApolloLoweringAdapter::new(0) just to invoke it. Keep the existing repeatable_directives and directives handling behavior unchanged while removing the throwaway adapter instances.
🤖 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.
Inline comments:
In `@docs/reference/directives.md`:
- Around line 41-53: Update the IR Encoding Rule wording to match the
implementation in the directives docs: clarify that repeatability is determined
from SDL directive definitions rather than “unknown custom directives,” and
state that directives not declared repeatable are treated as non-repeatable.
Also revise the duplicate-collision example to explicitly mention
extension-to-extension collisions, along with base-definition and extension
collisions, and keep the canonical Wesley alias example aligned with the `@wes_`*
collision behavior.
---
Nitpick comments:
In `@crates/wesley-core/src/adapters/apollo.rs`:
- Around line 964-971: Move the directive extraction logic out of
ApolloLoweringAdapter since extract_directives_with_repeatability does not
depend on adapter state. Update field_argument_from_input_value,
schema_operation_from_field, and operation_argument_from_input_value to call a
free function or associated function directly instead of constructing
ApolloLoweringAdapter::new(0) just to invoke it. Keep the existing
repeatable_directives and directives handling behavior unchanged while removing
the throwaway adapter instances.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ce6b303e-6f59-4fe1-a93d-72f008c2044c
📒 Files selected for processing (10)
CHANGELOG.mdSECURITY.mdcrates/wesley-core/src/adapters/apollo.rscrates/wesley-core/tests/lowering_validation.rsdocs/reference/directives.mddocs/topics/README.mddocs/topics/ci-workflows.mddocs/topics/security-tooling.mddocs/topics/validation.mddocs/truth-manifest.json
Activity SummaryCode Lawyer pass completed for PR #693.
Validation:
Merge-gate note: local validation and GitHub checks are green, the worktree is clean, and unresolved review threads are zero. The strict gate remains locked because there are zero submitted approvals and the visible CodeRabbit top-level comment includes a review-limit notice even though the status context reports pass. |
9e4565d
into
dx/first-contributor-fast-paths
Summary
repeatableValidation
cargo test -p wesley-core --test lowering_validation directive -- --nocapturecargo test -p wesley-core -- --nocapturecargo clippy -p wesley-core --all-targets -- -D warningscargo xtask docs-checkpnpm run preflightgit diff --checkCloses #683
Summary by CodeRabbit
Bug Fixes
New Features
Documentation