Skip to content

Restore support for bpo-* issue numbers in PR titles #426

Closed

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

Activity

  1. brettcannon commented on Apr 12, 2022

    @brettcannon
    Member

    You should be able to just tweak the regex and update the tests.

    P.S. I announced a while back I was stepping down from heading up infrastructure stuff, so I'm not the best person to be cc'ing to get stuff done. 😉

  2. added a commit that references this issue on Apr 14, 2022
    7fa9486
  3. added a commit that references this issue on Apr 15, 2022
    3453f81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions