Skip to content

Support filtering content mentions by paths#2462

Merged
Urgau merged 1 commit into
rust-lang:masterfrom
joshtriplett:mention-content-paths
Jul 12, 2026
Merged

Support filtering content mentions by paths#2462
Urgau merged 1 commit into
rust-lang:masterfrom
joshtriplett:mention-content-paths

Conversation

@joshtriplett

Copy link
Copy Markdown
Member

Some repositories would like to filter by both paths and content. For
instance, any mention of "miri" within "library/". Add support for this.

@Urgau

Urgau commented Jul 12, 2026

Copy link
Copy Markdown
Member

We have two kind of mentions, the content based one and the filename/filepath one.

This PR adds the paths config to both, and while it makes sense for the content based one, it doesn't really make sense for the filename one, it's already restricted by path.

We should IMO ignore (or better error) on paths with type = "filename" (the default).

Comment thread src/config.rs Outdated
@joshtriplett

Copy link
Copy Markdown
Member Author

We have two kind of mentions, the content based one and the filename/filepath one.

This PR adds the paths config to both, and while it makes sense for the content based one, it doesn't really make sense for the filename one, it's already restricted by path.

We should IMO ignore (or better error) on paths with type = "filename" (the default).

While I did primarily add it for content mentions, I do think it makes sense for filename mentions as well. The semantic there is "the primary filename matches and at least one of the paths matches". So, you could use that intersection for "files named xyz, anywhere in one of these five directories", for instance. Or, conversely, "under this prefix, files with one of these names".

@Urgau

Urgau commented Jul 12, 2026

Copy link
Copy Markdown
Member

Except that's not how it works, filename is really just a path, to be precise a starts-with glob.

So if someone wants the "files named xyz, anywhere in one of these five directories" they can already do that:

[mentions."library/{dir1,dir2,dir3,dir4,dir5}/xyz"]

@joshtriplett

Copy link
Copy Markdown
Member Author

@Urgau I had not realized that globset, unlike glob, supports brace expansion. That obviates some of the use cases that I otherwise thought would be easier to write using multiple patterns.

Okay, I'll reject it during validation.

@Urgau

Urgau commented Jul 12, 2026

Copy link
Copy Markdown
Member

We used to use the glob crate but switched to globset specifically to have support for alternates. It's unfortunate that our own crate glob doesn't support them.

Some repositories would like to filter by both paths and content. For
instance, any mention of "miri" within "library/". Add support for this.
@joshtriplett
joshtriplett force-pushed the mention-content-paths branch from ad9b55b to 5635e12 Compare July 12, 2026 19:59

@Urgau Urgau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. Looks good to me.

View changes since this review

@Urgau
Urgau added this pull request to the merge queue Jul 12, 2026
@Urgau

Urgau commented Jul 12, 2026

Copy link
Copy Markdown
Member

Would you mind sending a PR updating the documentation at https://github.com/rust-lang/rust-forge/blob/master/src/triagebot/mentions.md?

Merged via the queue into rust-lang:master with commit df7cf4f Jul 12, 2026
3 checks passed
@joshtriplett
joshtriplett deleted the mention-content-paths branch July 12, 2026 21:59
@joshtriplett

Copy link
Copy Markdown
Member Author

@Urgau Done: rust-lang/rust-forge#1083

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 18, 2026
…y, r=Mark-Simulacrum

triagebot: cc miri on any special-casing of miri in the standard library

---

Blocked until rust-lang/triagebot#2462 is merged and deployed.
rust-timer added a commit to rust-lang/rust that referenced this pull request Jul 19, 2026
Rollup merge of #159152 - joshtriplett:triagebot-miri-library, r=Mark-Simulacrum

triagebot: cc miri on any special-casing of miri in the standard library

---

Blocked until rust-lang/triagebot#2462 is merged and deployed.
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Jul 19, 2026
…-Simulacrum

triagebot: cc miri on any special-casing of miri in the standard library

---

Blocked until rust-lang/triagebot#2462 is merged and deployed.
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