Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add another cache control heuristic#2053

Merged
woodruffw merged 3 commits into
mainfrom
ww/another-cache-heuristic
May 23, 2026
Merged

Add another cache control heuristic#2053
woodruffw merged 3 commits into
mainfrom
ww/another-cache-heuristic

Conversation

@woodruffw
Copy link
Copy Markdown
Member

This ended up being very large due to refactoring (mostly moving BinExpr into its own proper type and changing how origin tests are represented), but the core change is only a hundred lines or so.

TL;DR: we can now detect (with acceptable generality) patterns like github.event_name == 'push' && github.ref_type == 'tag' (and their negation). Needs more tests still.

Fixes #2050.

@woodruffw woodruffw self-assigned this May 23, 2026
@woodruffw woodruffw added the enhancement New feature or request label May 23, 2026
/// For example, `a == b` is considered to match `b == a`, but `a > b` is not
/// considered to match `b > a`. This check is recusive, i.e. two nested binary expressions
/// will be fully checked for commutative equivalence.
pub fn commutative_matches(&self, other: &Expr<'src>) -> bool {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is one of the key changes: we now have this helper for comparing BinExprs for commutative equivalence. We don't yet do anything more special here, like De Morgan's laws for equivalence between distinct forms.

@woodruffw woodruffw force-pushed the ww/another-cache-heuristic branch from aecb075 to cdf3d14 Compare May 23, 2026 18:51
@woodruffw woodruffw marked this pull request as ready for review May 23, 2026 18:59
@woodruffw woodruffw enabled auto-merge (squash) May 23, 2026 18:59
@woodruffw woodruffw disabled auto-merge May 23, 2026 19:00
@woodruffw woodruffw enabled auto-merge (squash) May 23, 2026 19:02
@woodruffw woodruffw merged commit 5964472 into main May 23, 2026
12 checks passed
@woodruffw woodruffw deleted the ww/another-cache-heuristic branch May 23, 2026 19:03
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.

Feature: cache-poisoning (finer grained)

1 participant