Skip to content

chore: fix the BenchmarkExecutionEngine#1288

Merged
devsergiy merged 2 commits intomasterfrom
yury/eng-7627-engine-fix-executionbenchmarkexecutionengine
Sep 5, 2025
Merged

chore: fix the BenchmarkExecutionEngine#1288
devsergiy merged 2 commits intomasterfrom
yury/eng-7627-engine-fix-executionbenchmarkexecutionengine

Conversation

@ysmolski
Copy link
Copy Markdown
Contributor

@ysmolski ysmolski commented Sep 1, 2025

Also fix the corresponding test for static datasource.

Summary by CodeRabbit

  • New Features

    • Responses now include path metadata for string values, improving traceability.
  • Behavior Changes

    • Default field mapping is now applied for relevant queries, which may alter how fields map to data sources.
    • Data source inputs now better handle object-shaped payloads.
  • Tests

    • Benchmarks and static data source tests updated to reflect new data shape and mapping behavior.
  • Chores

    • Added benchmark execution to the quick test workflow.

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.

Also fix the corresponding test for static datasource.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 1, 2025

Walkthrough

Adds benchmark invocation to test-quick targets in Makefiles and updates tests to use JSON-shaped static data and adjusted mappings; tests reflect removal of FieldConfiguration.DisableDefaultMapping and addition of Path on resolve.String.

Changes

Cohort / File(s) Summary
Build targets
execution/Makefile, v2/Makefile
Appends a benchmark run to test-quick: adds go test -run=^$$ -bench=. -benchtime=1x ./... after unit-test invocation.
Engine benchmark test
execution/engine/execution_engine_test.go
Benchmark input data changed from string "world" to JSON string {"hello":"world"}; FieldConfiguration usage in test no longer sets DisableDefaultMapping; benchmark now fails on engine.Execute error (b.Fatal(err)).
Static datasource test
v2/pkg/engine/datasource/staticdatasource/static_datasource_test.go
FetchConfiguration.Input and plan Configuration.Data switched to {"hello":"world"}; expected GraphQL response adds Path: []string{"hello"} on returned string; FieldConfiguration no longer sets DisableDefaultMapping.
API shape reflected in tests
v2/pkg/engine/.../plan (tests reference), v2/pkg/engine/.../resolve (tests reference)
Tests updated to reflect removal of FieldConfiguration.DisableDefaultMapping and addition of Path []string to resolve.String.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@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 (2)
execution/Makefile (1)

9-9: Use -run=^$ to skip tests reliably (and consider -benchmem).

-run=xxxx could accidentally match a test name. -run=^$ guarantees no tests run while benchmarks do. Adding -benchmem is often helpful and low-cost.

-	go test -run=xxxx -bench=. -benchtime=1x ./...
+	go test -run=^$ -bench=. -benchmem -benchtime=1x ./...
execution/engine/execution_engine_test.go (1)

4724-4729: Avoid silently ignoring Execute errors in the hot loop.

A cheap check won't skew results and prevents false-green runs if something regresses.

-			_ = bc.engine.Execute(ctx, &req, bc.writer)
+			if err := bc.engine.Execute(ctx, &req, bc.writer); err != nil {
+				b.Fatal(err)
+			}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between df86fc7 and 797fe0b.

📒 Files selected for processing (3)
  • execution/Makefile (1 hunks)
  • execution/engine/execution_engine_test.go (2 hunks)
  • v2/pkg/engine/datasource/staticdatasource/static_datasource_test.go (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
v2/pkg/engine/datasource/staticdatasource/static_datasource_test.go (1)
pkg/introspection/introspection.go (1)
  • TypeName (42-44)
⏰ 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). (4)
  • GitHub Check: Build and test (go 1.23 / ubuntu-latest)
  • GitHub Check: Build and test (go 1.23 / windows-latest)
  • GitHub Check: Build and test (go 1.23 / windows-latest)
  • GitHub Check: Build and test (go 1.23 / ubuntu-latest)
🔇 Additional comments (6)
execution/engine/execution_engine_test.go (2)

4671-4671: LGTM: static datasource now serves JSON-shaped payload.

Switching Data to {"hello": "world"} aligns the source with the requested field shape.


4682-4683: LGTM: trimmed FieldConfiguration matches new defaults.

Using only TypeName and FieldName is consistent with the removal of DisableDefaultMapping.

v2/pkg/engine/datasource/staticdatasource/static_datasource_test.go (4)

27-27: LGTM: static fetch input updated to JSON object.

Matches the field shape and static source semantics.


38-39: LGTM: explicit Path on resolve.String.

Reflects the new Path field in resolve.String and clarifies mapping.


61-61: LGTM: plan configuration data matches fetch input.

Consistent JSON object payload.


70-72: LGTM: minimal FieldConfiguration.

Removal of DisableDefaultMapping is correctly reflected.

Copy link
Copy Markdown
Contributor

@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)
v2/Makefile (1)

14-14: Correctly skip tests and run only benchmarks; consider adding -benchmem.

Escaping with ^$$ is right for Make to pass ^$ to go test. Optional: include -benchmem for alloc stats.

-	go test -run=^$$ -bench=. -benchtime=1x ./...
+	go test -run=^$$ -bench=. -benchtime=1x -benchmem ./...
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 797fe0b and a68ff84.

📒 Files selected for processing (3)
  • execution/Makefile (1 hunks)
  • execution/engine/execution_engine_test.go (3 hunks)
  • v2/Makefile (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • execution/Makefile
🧰 Additional context used
🧬 Code graph analysis (1)
execution/engine/execution_engine_test.go (2)
v2/pkg/introspection/introspection.go (1)
  • Data (10-12)
pkg/introspection/introspection.go (1)
  • TypeName (42-44)
⏰ 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). (4)
  • GitHub Check: Build and test (go 1.23 / ubuntu-latest)
  • GitHub Check: Build and test (go 1.23 / windows-latest)
  • GitHub Check: Build and test (go 1.23 / ubuntu-latest)
  • GitHub Check: Build and test (go 1.23 / windows-latest)
🔇 Additional comments (3)
execution/engine/execution_engine_test.go (3)

4671-4671: Static datasource payload now matches field shape.

Switching Data to a JSON object aligns with default mapping for Query.hello.


4682-4683: FieldConfiguration trimmed to TypeName/FieldName is correct post-API change.

No DisableDefaultMapping needed; default mapping will resolve hello.


4727-4729: Benchmark now fails fast on Execute error.

Good addition; avoids false-positive perf numbers when execution fails.

@devsergiy devsergiy merged commit 37eb05f into master Sep 5, 2025
11 checks passed
@devsergiy devsergiy deleted the yury/eng-7627-engine-fix-executionbenchmarkexecutionengine branch September 5, 2025 14:22
@coderabbitai coderabbitai Bot mentioned this pull request Sep 5, 2025
3 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Oct 24, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants