Skip to content

Conversation

@devsergiy
Copy link
Member

@devsergiy devsergiy commented Oct 30, 2025

Update engine to 2.0.0-rc.236 (2025-10-31)

Bug Fixes

  • fix conflict of rewriter and required fields (#1338) (03189bc)

Summary by CodeRabbit

  • Chores

    • Bumped Go module dependency versions to refresh transitive dependency graphs; no functional behavior changes.
  • Tests

    • Centralized benchmark test configuration, capture and log planning results for better diagnostics.
    • Updated integration test expectations for operation-name propagation.
    • Revised query-plan test fixtures to swap two parallel subgraph fetches and adjust related field mappings and fetch ordering.

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.

@coderabbitai
Copy link

coderabbitai bot commented Oct 30, 2025

Walkthrough

Updated Go module pins in two go.mod files, adjusted a planning benchmark test to use a filename constant, capture and log planner output, updated one integration test assertion, and swapped subgraph/field mappings across multiple query plan fixture JSON files.

Changes

Cohort / File(s) Summary
Dependency updates
router-tests/go.mod, router/go.mod
Bumped github.com/wundergraph/graphql-go-tools/v2 from v2.0.0-rc.235v2.0.0-rc.236. In router-tests/go.mod also updated github.com/wundergraph/cosmo/demo and github.com/wundergraph/cosmo/router to newer timestamped pseudo-versions.
Benchmark test refactor
router/internal/planningbenchmark/benchmark_test.go
Added configFileName = "benchmark_config.json" constant, replaced hard-coded filename usages, capture PlanPreparedOperation return as p, and log p.PrettyPrint(); updated related error messages/control flow in TestPlanning and BenchmarkPlanning.
Integration test assertion update
router-tests/integration_test.go
Adjusted expected operation-name substrings in TestPropagateOperationName middleware assertions (suffix changes for Mood and Availability subgraphs).
Query plan fixtures (multiple)
router-tests/testdata/fixtures/query_plans/only_query_plan.json, router-tests/testdata/fixtures/query_plans/query_plan_with_trace_no_data.json, router-tests/testdata/fixtures/query_plans/response_with_query_plan.json, router-tests/testdata/fixtures/query_plans/response_with_query_plan_operation_name.json, router-tests/testdata/fixtures/query_plans/response_with_query_plan_operation_name_sanitized_no_data.json
Swapped the two parallel batch fetch branches between mood and availability subgraphs across multiple fixtures: updated subgraphName/subgraphId, GraphQL entity query texts (e.g., currentMoodisAvailable), dependency fieldName coordinates, and remapped fetchId/dependent fetch references to align with the reordered branches and derived-field dependencies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Review focus:
    • Ensure the graphql-go-tools rc bump introduces no API/behavior changes that affect planner/test logic.
    • Verify p := PlanPreparedOperation(...) usage and p.PrettyPrint() logging do not alter test timing/expectations.
    • Confirm the many fixture swaps (subgraph/field/fetchId changes) correctly reflect intended query-plan semantics and match updated assertions in integration tests.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "fix: fix conflict of rewriter and required fields" directly aligns with the stated PR objective, which explicitly describes the purpose as incorporating a bug fix from graphql-go-tools v2.0.0-rc.236 that addresses a "conflict of rewriter and required fields" (issue #1338). While the PR achieves this fix through a dependency version bump rather than direct code implementation, the title accurately captures the functional outcome and intent of the changeset. The test updates and fixture modifications throughout the PR serve to validate and adapt to the behavioral changes introduced by the dependency update, all supporting the stated fix. The title is specific, uses the conventional "fix:" prefix appropriately, and clearly communicates the primary change from a user perspective.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2457f4b and 1672056.

📒 Files selected for processing (6)
  • router-tests/integration_test.go (2 hunks)
  • router-tests/testdata/fixtures/query_plans/only_query_plan.json (10 hunks)
  • router-tests/testdata/fixtures/query_plans/query_plan_with_trace_no_data.json (11 hunks)
  • router-tests/testdata/fixtures/query_plans/response_with_query_plan.json (10 hunks)
  • router-tests/testdata/fixtures/query_plans/response_with_query_plan_operation_name.json (10 hunks)
  • router-tests/testdata/fixtures/query_plans/response_with_query_plan_operation_name_sanitized_no_data.json (11 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: StarpTech
Repo: wundergraph/cosmo PR: 2142
File: helm/cosmo/Chart.yaml:0-0
Timestamp: 2025-08-15T10:21:45.838Z
Learning: In the WunderGraph Cosmo project, helm chart version upgrades and README badge synchronization are handled in separate helm release PRs, not in the initial version bump PRs.
📚 Learning: 2025-10-01T20:39:16.113Z
Learnt from: SkArchon
Repo: wundergraph/cosmo PR: 2252
File: router-tests/telemetry/telemetry_test.go:9684-9693
Timestamp: 2025-10-01T20:39:16.113Z
Learning: Repo preference: In router-tests/telemetry/telemetry_test.go, keep strict > 0 assertions for request.operation.*Time (parsingTime, normalizationTime, validationTime, planningTime) in telemetry-related tests; do not relax to >= 0 unless CI flakiness is observed.

Applied to files:

  • router-tests/integration_test.go
📚 Learning: 2025-09-02T12:52:27.677Z
Learnt from: endigma
Repo: wundergraph/cosmo PR: 2181
File: router/core/operation_processor.go:0-0
Timestamp: 2025-09-02T12:52:27.677Z
Learning: Hash validation for persisted queries with query bodies is performed in router/core/graphql_prehandler.go in the handleOperation function at lines 571-578, not in the APQ processing logic in operation_processor.go. This validates that extensions.persistedQuery.sha256Hash matches the computed query hash before any APQ operations occur. There's also a test case that verifies this behavior.

Applied to files:

  • router-tests/integration_test.go
📚 Learning: 2025-09-02T12:52:27.677Z
Learnt from: endigma
Repo: wundergraph/cosmo PR: 2181
File: router/core/operation_processor.go:0-0
Timestamp: 2025-09-02T12:52:27.677Z
Learning: Hash validation for persisted queries with query bodies is performed in router/core/graphql_prehandler.go in the handleOperation function, not in the APQ processing logic in operation_processor.go. This validates that extensions.persistedQuery.sha256Hash matches the query body before any APQ operations occur.

Applied to files:

  • router-tests/integration_test.go
⏰ 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). (11)
  • GitHub Check: build-router
  • GitHub Check: build_test
  • GitHub Check: build_push_image
  • GitHub Check: build_push_image (nonroot)
  • GitHub Check: build_test
  • GitHub Check: image_scan (nonroot)
  • GitHub Check: integration_test (./. ./fuzzquery ./lifecycle ./modules)
  • GitHub Check: integration_test (./telemetry)
  • GitHub Check: image_scan
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (7)
router-tests/testdata/fixtures/query_plans/query_plan_with_trace_no_data.json (1)

1-395: Test fixture updates reflect upstream engine changes.

These systematic swaps of the mood/availability subgraphs and their corresponding fields (isAvailable ↔ currentMood) across the query plan fixtures are expected outputs from the updated engine version (v2.0.0-rc.236). The changes are internally consistent and align with the bug fix for the conflict between rewriter and required fields.

router-tests/testdata/fixtures/query_plans/response_with_query_plan.json (1)

1-292: LGTM - Consistent fixture updates.

The query plan structure changes are consistent with the other test fixtures in this PR, correctly reflecting the mood/availability subgraph swap and field remapping.

router-tests/testdata/fixtures/query_plans/only_query_plan.json (1)

1-274: LGTM - Fixture update matches expected pattern.

This fixture follows the same systematic updates as the other query plan fixtures, with all subgraph and field mappings correctly swapped.

router-tests/testdata/fixtures/query_plans/response_with_query_plan_operation_name_sanitized_no_data.json (1)

1-395: LGTM - Sanitized operation name fixture updated correctly.

The fixture correctly reflects the subgraph swap with sanitized operation names in the generated queries. All fetchId assignments and dependencies are consistent.

router-tests/integration_test.go (2)

668-668: Test assertion correctly updated for new operation name.

The expected operation name suffix now reflects that mood is assigned to fetchId 2 instead of 1, consistent with the query plan fixture changes.


683-683: Test assertion correctly updated for new operation name.

The expected operation name suffix now reflects that availability is assigned to fetchId 1 instead of 2, consistent with the query plan fixture changes.

router-tests/testdata/fixtures/query_plans/response_with_query_plan_operation_name.json (1)

1-292: LGTM - Operation name fixture updated correctly.

The query plan fixture correctly reflects the subgraph swap with operation names that match the fetchId assignments (availability__1 and mood__2).


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Oct 30, 2025

Router image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-1abfa2d0ec2981e248097960a62cf296ea4fab6a

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
router/internal/planningbenchmark/benchmark_test.go (1)

20-20: Good refactoring: DRY principle applied.

Introducing the configFileName constant eliminates code duplication and makes future config file name changes easier to manage.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b15429 and 1efeded.

⛔ Files ignored due to path filters (2)
  • router-tests/go.sum is excluded by !**/*.sum
  • router/go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • router-tests/go.mod (1 hunks)
  • router/go.mod (1 hunks)
  • router/internal/planningbenchmark/benchmark_test.go (2 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: StarpTech
PR: wundergraph/cosmo#2142
File: helm/cosmo/Chart.yaml:0-0
Timestamp: 2025-08-15T10:21:45.838Z
Learning: In the WunderGraph Cosmo project, helm chart version upgrades and README badge synchronization are handled in separate helm release PRs, not in the initial version bump PRs.
Learnt from: SkArchon
PR: wundergraph/cosmo#2252
File: router-tests/telemetry/telemetry_test.go:9684-9693
Timestamp: 2025-10-01T20:39:16.113Z
Learning: Repo preference: In router-tests/telemetry/telemetry_test.go, keep strict > 0 assertions for request.operation.*Time (parsingTime, normalizationTime, validationTime, planningTime) in telemetry-related tests; do not relax to >= 0 unless CI flakiness is observed.
Learnt from: endigma
PR: wundergraph/cosmo#2222
File: router-tests/websocket_test.go:2238-2302
Timestamp: 2025-09-24T12:54:00.765Z
Learning: The wundergraph/cosmo project uses Go 1.25 (Go 1.23+ minimum), so fmt.Appendf and other newer Go standard library functions are available and can be used without compatibility concerns.
Learnt from: endigma
PR: wundergraph/cosmo#2222
File: router-tests/websocket_test.go:2238-2302
Timestamp: 2025-09-24T12:54:00.765Z
Learning: The wundergraph/cosmo project uses Go 1.25 (Go 1.25 minimum), so fmt.Appendf and other newer Go standard library functions are available and can be used without compatibility concerns.
Learnt from: StarpTech
PR: wundergraph/cosmo#2157
File: router-tests/go.mod:16-16
Timestamp: 2025-08-20T22:13:25.222Z
Learning: github.com/mark3labs/mcp-go v0.38.0 has regressions and should not be used in the wundergraph/cosmo project. v0.36.0 is the stable version that should be used across router-tests and other modules.
📚 Learning: 2025-08-20T22:13:25.222Z
Learnt from: StarpTech
PR: wundergraph/cosmo#2157
File: router-tests/go.mod:16-16
Timestamp: 2025-08-20T22:13:25.222Z
Learning: github.com/mark3labs/mcp-go v0.38.0 has regressions and should not be used in the wundergraph/cosmo project. v0.36.0 is the stable version that should be used across router-tests and other modules.

Applied to files:

  • router-tests/go.mod
  • router/go.mod
📚 Learning: 2025-10-01T20:39:16.113Z
Learnt from: SkArchon
PR: wundergraph/cosmo#2252
File: router-tests/telemetry/telemetry_test.go:9684-9693
Timestamp: 2025-10-01T20:39:16.113Z
Learning: Repo preference: In router-tests/telemetry/telemetry_test.go, keep strict > 0 assertions for request.operation.*Time (parsingTime, normalizationTime, validationTime, planningTime) in telemetry-related tests; do not relax to >= 0 unless CI flakiness is observed.

Applied to files:

  • router-tests/go.mod
  • router/internal/planningbenchmark/benchmark_test.go
📚 Learning: 2025-09-24T12:54:00.765Z
Learnt from: endigma
PR: wundergraph/cosmo#2222
File: router-tests/websocket_test.go:2238-2302
Timestamp: 2025-09-24T12:54:00.765Z
Learning: The wundergraph/cosmo project uses Go 1.25 (Go 1.23+ minimum), so fmt.Appendf and other newer Go standard library functions are available and can be used without compatibility concerns.

Applied to files:

  • router-tests/go.mod
  • router/go.mod
📚 Learning: 2025-09-24T12:54:00.765Z
Learnt from: endigma
PR: wundergraph/cosmo#2222
File: router-tests/websocket_test.go:2238-2302
Timestamp: 2025-09-24T12:54:00.765Z
Learning: The wundergraph/cosmo project uses Go 1.25 (Go 1.25 minimum), so fmt.Appendf and other newer Go standard library functions are available and can be used without compatibility concerns.

Applied to files:

  • router-tests/go.mod
  • router/go.mod
⏰ 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). (12)
  • GitHub Check: build-router
  • GitHub Check: image_scan (nonroot)
  • GitHub Check: build_push_image
  • GitHub Check: build_push_image (nonroot)
  • GitHub Check: integration_test (./telemetry)
  • GitHub Check: image_scan
  • GitHub Check: integration_test (./. ./fuzzquery ./lifecycle ./modules)
  • GitHub Check: integration_test (./events)
  • GitHub Check: build_test
  • GitHub Check: build_test
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
router/go.mod (1)

34-34: LGTM! Engine version updated correctly.

The dependency update to github.com/wundergraph/graphql-go-tools/v2 uses a valid pseudo-version format pointing to a specific commit. This aligns with the PR objective to fix issues related to rewriter and required fields conflicts.

router-tests/go.mod (1)

26-30: LGTM! Dependencies updated consistently.

The version updates are well-coordinated:

  • Internal cosmo/demo and cosmo/router modules share the same commit timestamp
  • The graphql-go-tools/v2 version matches the update in router/go.mod
  • github.com/mark3labs/mcp-go remains at the stable v0.36.0 version
router/internal/planningbenchmark/benchmark_test.go (2)

43-47: Excellent addition: planning result capture and logging.

Capturing the planning operation result and logging its pretty-printed output significantly improves debugging capability for this test. The structured output will help identify issues when tests fail or when investigating planning behavior.


51-53: LGTM! Consistent use of the new constant.

The benchmark function correctly adopts the configFileName constant while appropriately continuing to discard the planning result (line 77) to avoid measurement overhead.

@devsergiy devsergiy changed the title fix: update engine version fix: fix conflict of rewriter and required fields Oct 30, 2025
@devsergiy devsergiy merged commit 2c7cf9e into main Oct 31, 2025
29 checks passed
@devsergiy devsergiy deleted the sergiy/eng-8243-fix-conflict-of-rewriter-and-required-fields branch October 31, 2025 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants