Skip to content

A very quick implementation of fail on labels#91

Draft
Cadair wants to merge 1 commit into
OpenAstronomy:masterfrom
Cadair:fail_on_label
Draft

A very quick implementation of fail on labels#91
Cadair wants to merge 1 commit into
OpenAstronomy:masterfrom
Cadair:fail_on_label

Conversation

@Cadair
Copy link
Copy Markdown
Member

@Cadair Cadair commented Sep 25, 2019

@bsipocz

Fixes #90

@pllim
Copy link
Copy Markdown
Contributor

pllim commented Sep 25, 2019

Would be nice to show example config file with fail_check_labels implemented.

Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

looks good to me, just minor comments

@@ -0,0 +1,37 @@
from loguru import logger
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.

lol, best package name :)


from baldrick.plugins.github_pull_requests import pull_request_handler

BLOCKED_MESSAGE = 'This pull request is blocked from being merged by labels.'
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.

could we have the name of the label, that triggered this, listed, too?

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.

Or all of them that triggers this in a repo? (I don't expect all maintainers to always know about this feature)

pass_message = bl_config.get("label_absent_message", MERGEABLE_MESSAGE)

pr_labels = set(pr_handler.labels)
blocking_labels = set(cl_config.get('labels', [])
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.

Suggested change
blocking_labels = set(cl_config.get('labels', [])
blocking_labels = set(cl_config.get('blocking_labels', [])

to remove ambiguity

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.

Disable merge button for certain labels

3 participants