8000 Restore support for `bpo-*` issue numbers in PR titles · Issue #426 · python/bedevere · GitHub
[go: up one dir, main page]

Skip to content
Restore support for bpo-* issue numbers in PR titles #426
Closed
@ezio-melotti

Description

@ezio-melotti

python/cpython#91439 failed with
20220412--01-8

It seems that after #420 bedevere only looks for GH numbers:

ISSUE_RE = re.compile(r"gh-(?P<issue>\d+)")
SKIP_ISSUE_LABEL = util.skip_label("issue")
STATUS_CONTEXT = "bedevere/issue-number"
# Try to keep descriptions at or below 50 characters, else GitHub's CSS will truncate it.
SKIP_ISSUE_STATUS = util.create_status(STATUS_CONTEXT, util.StatusState.SUCCESS,
description="Issue report skipped")
@router.register("pull_request", action="opened")
@router.register("pull_request", action="synchronize")
@router.register("pull_request", action="reopened")
async def set_status(event, gh, *args, session, **kwargs):
"""Set the issue number status on the pull request."""
issue_number_found = ISSUE_RE.search(event.data["pull_request"]["title"])
if not issue_number_found:
issue = await util.issue_for_PR(gh, event.data["pull_request"])
status = (SKIP_ISSUE_STATUS if util.skip("issue", issue)
else create_failure_status_no_issue())

This should be updated to try GH first, and fallback on bpo if a GH number is missing (assuming something is done with the id and the distinction matters, otherwise a single check is enough).

While we are at it, should it also be case-insensitive or do we want to enforce lowercase gh-*?

cc @Mariatta, @brettcannon

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0