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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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"

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.

1 participant