Skip to content

Handle JOSH subtrees when milestoning rust-lang/rust PRs - #2519

Merged
Kobzol merged 2 commits into
rust-lang:mainfrom
Urgau:milestone-josh-subtrees
Oct 2, 2026
Merged

Kobzol merged 2 commits into
rust-lang:mainfrom
Urgau:milestone-josh-subtrees

Conversation

@Urgau

@Urgau Urgau commented Sep 30, 2026

Copy link
Copy Markdown
Member

rustfmt is now a JOSH subtrees, let's modify the logic to check the modified files instead of checking if the same commit exists in the subtree repository.

This implements #2499 (comment):

So what I think we can do for Josh subtrees, if we ever get one that wants milestones, is to look at which files the commit modifies.

If the commit only modifies files inside the subtree and is named Merge pull request #{pr_number}, then we milestone the corresponding PR.

For the record:

cc @ytmimi @jieyouxu

@Urgau
Urgau requested a review from Kobzol September 30, 2026 21:23
@ytmimi

ytmimi commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

@Urgau thank you for working on this!

For the record:

Nice, so that's referencing rust-lang/rust@3128678 from rust-lang/rust#163545

@Kobzol Kobzol 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! If we alerady have the set of all files downloaded somewhere (I haven't checked), maybe we could do a pre-filter, and if none of them match the prefix, don't go fetch the changed files of the merge commits?

View changes since this review

Comment thread src/github/repos.rs
Comment thread src/handlers/milestone_prs.rs Outdated
@Urgau

Urgau commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

If we alerady have the set of all files downloaded somewhere (I haven't checked), maybe we could do a pre-filter, and if none of them match the prefix, don't go fetch the changed files of the merge commits?

That's already the case here:

for (repo, subtree) in [("rust-lang/rustfmt", "src/tools/rustfmt")] {
if event_diff
.files
.iter()
.any(|fd| fd.filename.starts_with(subtree))
{
// This PR touches the subtree so we'll try to assign milestones

@Urgau
Urgau force-pushed the milestone-josh-subtrees branch from b6b191c to 0b65013 Compare October 1, 2026 16:38

@Kobzol Kobzol 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.

@Kobzol
Kobzol added this pull request to the merge queue Oct 2, 2026
Merged via the queue into rust-lang:main with commit 6c5294c Oct 2, 2026
4 checks passed
@ytmimi

ytmimi commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Thank you @Urgau for updating the milestone implementation for rustfmt and thank you @Kobzol for the review 🙏🏼

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.

3 participants