fix: use remapped variables in cost calculation - #2882
Conversation
…0-cost-calculation-ignores-remapvariables
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Router-nonroot image scan passed✅ No security vulnerabilities found in image: |
|
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)
WalkthroughBump graphql-go-tools to v2.4.0, add operationContext.VariablesView(), update router cost validation and actual-cost callers to use the view, and add tests exercising slicing-argument behavior with remapped variables. ChangesVariable Remapping Cost Calculation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@router-tests/security/costs_test.go`:
- Around line 604-605: The test constructs a GraphQL request using Query:
`query($some: Int) { slicedThings(first: $some) { a } }` but the Variables JSON
uses the key `"$some"`, which is invalid; change the Variables payload to use
the variable name without the dollar sign (e.g. replace `{"$some": null}` with
`{"some": null}`) so the test sends a null variable value for `$some` rather
than a missing variable path.
🪄 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: 240e9913-075f-4dcb-bcf2-788baee1e23f
⛔ Files ignored due to path filters (2)
router-tests/go.sumis excluded by!**/*.sumrouter/go.sumis excluded by!**/*.sum
📒 Files selected for processing (6)
router-tests/go.modrouter-tests/security/costs_test.gorouter/core/context.gorouter/core/graphql_handler.gorouter/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 #2882 +/- ##
==========================================
+ Coverage 66.04% 66.24% +0.20%
==========================================
Files 258 258
Lines 27053 27056 +3
==========================================
+ Hits 17866 17923 +57
+ Misses 7759 7720 -39
+ Partials 1428 1413 -15
🚀 New features to boost your workflow:
|
Simple PR to verify that remapped variables are handled correctly in the fixed engine.
Summary by CodeRabbit
Chores
Tests
Improvements