Conversation
This PR validates if slicing arguments passed for a field conform to the value of listSize:requireOneSlicingArgument.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
WalkthroughAdds a new GraphQL query Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Router-nonroot image scan passed✅ No security vulnerabilities found in image: |
Router-nonroot image scan passed✅ No security vulnerabilities found in image: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@demo/pkg/subgraphs/products/subgraph/schema.resolvers.go`:
- Around line 127-131: The grouped type block "type ( documentationResolver
struct{ *Resolver } mutationResolver struct{ *Resolver } queriesResolver struct{
*Resolver } )" causes gqlgen/CI formatting mismatch; replace it with separate
type declarations for each resolver (i.e., declare "type documentationResolver
struct{ *Resolver }", then "type mutationResolver struct{ *Resolver }", then
"type queriesResolver struct{ *Resolver }") so the file matches gqlgen's
expected format, or alternatively regenerate the file with `go generate` to
produce the correct layout for the Resolver-related types
(documentationResolver, mutationResolver, queriesResolver).
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 11376f16-cf95-4380-a834-0a3faceb4826
⛔ Files ignored due to path filters (3)
demo/pkg/subgraphs/products/subgraph/generated/generated.gois excluded by!**/generated/**router-tests/go.sumis excluded by!**/*.sumrouter/go.sumis excluded by!**/*.sum
📒 Files selected for processing (7)
demo/pkg/subgraphs/products/subgraph/schema.graphqlsdemo/pkg/subgraphs/products/subgraph/schema.resolvers.gorouter-tests/go.modrouter-tests/security/costs_test.gorouter-tests/testenv/testdata/config.jsonrouter/core/operation_processor.gorouter/go.mod
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2692 +/- ##
===========================================
+ Coverage 35.53% 63.09% +27.55%
===========================================
Files 129 245 +116
Lines 11782 26273 +14491
Branches 467 0 -467
===========================================
+ Hits 4187 16576 +12389
- Misses 7593 8354 +761
- Partials 2 1343 +1341
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@demo/pkg/subgraphs/products/subgraph/schema.resolvers.go`:
- Around line 102-109: The SlicedThings resolver currently derives size directly
from user-controlled pointers (first/last) and uses it as the capacity for
things := make([]*model.Thing, 0, size) which can panic or OOM; replicate the
guard pattern used in SharedThings: validate that the chosen value (from first
or last) is non-nil, non-negative, and enforce an upper bound (e.g., a constant
MAX_PAGE_SIZE) before using it as capacity, returning a clear error for
out-of-range inputs; update the logic around determining size (the size variable
and the allocation in SlicedThings) to use the validated/ capped value.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: eb95a3f4-cefc-49f5-8d5a-cdb22faed8bf
📒 Files selected for processing (1)
demo/pkg/subgraphs/products/subgraph/schema.resolvers.go
endigma
left a comment
There was a problem hiding this comment.
lgtm, ping when its release go tools version
…2-cost-validate-requireoneslicingargument-in-queries
This PR validates if slicing arguments passed for a field conform to the value of listSize:requireOneSlicingArgument.
Summary by CodeRabbit