Skip to content

Add (exclude_)where args to workload directive [AI] - #1642

Open
douglasjacobsen wants to merge 1 commit into
GoogleCloudPlatform:developfrom
douglasjacobsen:workload-filters
Open

Add (exclude_)where args to workload directive [AI]#1642
douglasjacobsen wants to merge 1 commit into
GoogleCloudPlatform:developfrom
douglasjacobsen:workload-filters

Conversation

@douglasjacobsen

Copy link
Copy Markdown
Collaborator

This merge adds support for filtering experiments at the workload directive level. This can be used to silently reduce the possible experiment definitions, without creating errors.

Tests and documentation are added as well.

@douglasjacobsen douglasjacobsen added the enhancement New feature or request label Jun 25, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces internal filters for workloads using where and exclude_where arguments, allowing experiments to be conditionally dropped during workspace setup. It updates the workload definition, experiment rendering logic, and documentation, and adds corresponding unit and end-to-end tests. A review comment points out an unused capsys fixture in the end-to-end tests that should be removed.

Comment thread lib/ramble/ramble/test/end_to_end/workload_where_clauses.py
@ramble-pr-bot

ramble-pr-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

Ramble Performance Test Metrics

Results produced with commit: 53a52d7

Test Name Outcome Duration (s) Most Recent Run (s) Last 5 Avg (s)
test_analyze_large_file passed 2.0643 2.0885 (37185cb) 2.1795
test_large_template_expansion passed 1.4086 1.4420 (37185cb) 1.5133
test_many_experiments passed 24.3759 24.8163 (37185cb) 26.4485
test_many_objects_defaults passed 14.3984 15.3026 (37185cb) 15.6905
test_matrix_filter_perf passed 0.9037 0.9178 (37185cb) 0.9613

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@37185cb). Learn more about missing BASE report.
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #1642   +/-   ##
==========================================
  Coverage           ?   93.36%           
==========================================
  Files              ?      366           
  Lines              ?    35622           
  Branches           ?        0           
==========================================
  Hits               ?    33259           
  Misses             ?     2363           
  Partials           ?        0           

☔ 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.

@douglasjacobsen
douglasjacobsen marked this pull request as ready for review June 26, 2026 19:23
inputs=None,
tags=None,
where=None,
exclude_where=None,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are we worried about the change in this arg order? This can technically be breaking for some people right? I think it should be rare, but if we know anyone who is likely to get broken we could provide backwards compat and depreciate warning?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't know anyone who would currently break by this. Most people haven't adopted when yet (as it's not in main or a tag).

Technically, it is breaking, as when happens after the where arguments now. I only did it this way to make the interface consistent (as when is last in all of the rest of the interfaces). But I have pushed a changed to place the where args after when to avoid breaking other people's interfaces.

This commit adds support for filtering experiments at the workload
directive level. This can be used to silently reduce the possible
experiment definitions, without creating errors.

Tests and documentation are added as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants