Skip to content

Only invalidate variant cache when modified#1645

Merged
douglasjacobsen merged 1 commit into
GoogleCloudPlatform:developfrom
linsword13:variant-cache
Jun 30, 2026
Merged

Only invalidate variant cache when modified#1645
douglasjacobsen merged 1 commit into
GoogleCloudPlatform:developfrom
linsword13:variant-cache

Conversation

@linsword13

Copy link
Copy Markdown
Member

No description provided.

@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 conditional cache invalidation for the VariantSet class, optimizing cache management by only invalidating the cache when a mutation actually occurs. It adds a new @invalidates_cache decorator and corresponding unit tests. The feedback highlights two key areas for improvement: first, the Variant class needs __eq__ and __hash__ implementations to prevent identity-based comparisons from defeating the cache optimization; second, the @invalidates_cache decorator should use functools.wraps to preserve the metadata of the decorated methods.

Comment thread lib/ramble/ramble/variants.py Outdated
Comment thread lib/ramble/ramble/variants.py
@ramble-pr-bot

ramble-pr-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

Ramble Performance Test Metrics

Results produced with commit: 0dc3379

Test Name Outcome Duration (s) Most Recent Run (s) Last 5 Avg (s)
test_analyze_large_file passed 2.9368 2.9454 (f466d88) 2.9158
test_large_template_expansion passed 2.1665 2.1428 (f466d88) 2.1366
test_many_experiments passed 38.5491 38.2628 (f466d88) 37.1191
test_many_objects_defaults passed 20.8098 20.1709 (f466d88) 19.8585
test_matrix_filter_perf passed 1.6153 1.6127 (f466d88) 1.6100

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.30%. Comparing base (f466d88) to head (0dc3379).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1645   +/-   ##
========================================
  Coverage    93.29%   93.30%           
========================================
  Files          352      352           
  Lines        34188    34233   +45     
========================================
+ Hits         31896    31941   +45     
  Misses        2292     2292           

☔ 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 merged commit b33e329 into GoogleCloudPlatform:develop Jun 30, 2026
30 checks passed
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