Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for exceptions in non default branch warning #1860

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Nov 24, 2024

This PR adds support for specifying exceptions to the global default branch according to the PR title.

This is done to improve the usefulness of the non-default branch warning by making it warn if a PR trying to target the stable branch is actually targeting the master branch.

[assign]
warn_non_default_branch.enable = true

[[assign.warn_non_default_branch.exceptions]]
title = "[beta"
branch = "beta"

[[assign.warn_non_default_branch.exceptions]]
title = "[stable"
branch = "stable"

cc #1852 @cuviper
r? @ehuss

@Urgau Urgau force-pushed the warn_default_branch-exceptions branch from 602f13b to 2d95522 Compare November 24, 2024 14:17
@Urgau Urgau force-pushed the warn_default_branch-exceptions branch from 2d95522 to 56928c7 Compare November 24, 2024 14:59
enable: bool,
/// List of exceptions that have a different default branch
#[serde(default)]
exceptions: Vec<WarnNonDefaultBranchException>,
Copy link
Member Author

Choose a reason for hiding this comment

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

We could also use a HashMap<String, WarnNonDefaultBranchException> where the string would be the branch name, which would permit this and be more consistent with the rest of the configs, but we would losz the "exceptions" field. I'm not sure which one is better.

[assign.warn_non_default_branch]
enable = true

[assign.warn_non_default_branch."beta"]
title = "[beta"

[assign.warn_non_default_branch."stable"]
title = "[stable"

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks!

@ehuss ehuss merged commit b8d10a2 into rust-lang:master Dec 8, 2024
2 checks passed
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 12, 2024
Use newly added exceptions to non default branch warning

cc rust-lang/triagebot#1860
cc `@cuviper`
r? `@ehuss`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 12, 2024
Rollup merge of rust-lang#134089 - Urgau:triagebot-exceptions, r=ehuss

Use newly added exceptions to non default branch warning

cc rust-lang/triagebot#1860
cc `@cuviper`
r? `@ehuss`
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