Skip to content

Add PipelineOptions changes for merging ValidatesRunner tests. - #40437

Merged
reuvenlax merged 1 commit into
apache:masterfrom
reuvenlax:merge_validates_runner_pipeline_options
Oct 13, 2026
Merged

reuvenlax merged 1 commit into
apache:masterfrom
reuvenlax:merge_validates_runner_pipeline_options

Conversation

@reuvenlax

Copy link
Copy Markdown
Contributor

When merging ValidatesRunner tests, we need to ensure that pipelines with differing PipelineOptions (including and PIpelineOptions subclass) are not merged together. This simple approach of just serializing the options (MAPPER.valueToTree(options).get("options")), however that contains every bound value. As a result, two options objects configured identically can serialize differently depending purely on which getters happened to be called on each — e.g. View.asList() and Reshuffle read updateCompatibilityVersion during construction, and GcsFileSystem reads gcsPerformanceMetrics, so a pipeline that uses them "has" those keys and one that doesn't, doesn't. In these cases the getters simply return the default values, so the PipelineOptions are logically the same.

There is a BoundValue.isDefault bit (private) that one might try to use to solve this problem, by excluding default-values from the comparison. However testing often roundtrips options through JSON, after which this isDefault bit is lost.

This PR introduces PipelineOptionsFactory.explicitlySetProperties(PipelineOptions) which returns the names of properties that have been explicitly set. In order to maintain things across roundtrips, we introduce a new field in the serialized JSON to track any fields that have lazily-bound defaults. This is currently not enabled in production pipelines - it's only enabled by TestPipeline.java.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.95652% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.74%. Comparing base (69bdf5f) to head (70a91b9).
⚠️ Report is 27 commits behind head on master.

Files with missing lines Patch % Lines
...pache/beam/sdk/options/PipelineOptionsFactory.java 71.42% 0 Missing and 2 partials ⚠️
...pache/beam/sdk/options/ProxyInvocationHandler.java 93.54% 0 Missing and 2 partials ⚠️
...java/org/apache/beam/sdk/testing/TestPipeline.java 75.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #40437      +/-   ##
============================================
- Coverage     59.04%   58.74%   -0.30%     
+ Complexity    15624    13911    -1713     
============================================
  Files          2797     2583     -214     
  Lines        280750   271479    -9271     
  Branches      12488    11240    -1248     
============================================
- Hits         165764   159491    -6273     
+ Misses       108540   105990    -2550     
+ Partials       6446     5998     -448     
Flag Coverage Δ
java 65.25% <86.95%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @chamikaramj for label java.

This pull request likely touches a core component ("core" label). Please review with scrutiny.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@reuvenlax

Copy link
Copy Markdown
Contributor Author

@kennknowles friendly ping

@reuvenlax
reuvenlax merged commit 046b038 into apache:master Oct 13, 2026
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants