Skip to content

Add link to the GitHub Issue from the PR #428

Closed

Description

@Mariatta

We used to automatically append a link to the bpo ticket from the GitHub PR, by looking at the PR title's issue number.

In #420, the functionality was dropped. I had thought that GitHub UI would automatically link the issue number when referenced like this, however this is not a case. GitHub would automatically link the issue in the PR descriptions or in the PR comments, but not in the title.

To make it easier for us to navigate to the issue from the title, we should add back the reference to the issue in the PR description.
Upon seeing the GH- issue number in the PR title, bedevere should edit the description and add the issue number there.
We don't need to add it as a link, because GitHub can automatically render gh- as links, so just adding the text gh-NNNN at the end would be sufficient.

This text should be added only if the issue number has not already mentioned, to avoid duplicated links.

Activity

  1. ryanlong1004 commented on Apr 12, 2022

    @ryanlong1004
    Contributor

    @Mariatta there is code than already handles this in gh_issue.py. Is this issue still valid?

  2. Mariatta commented on Apr 13, 2022

    @Mariatta
    MemberAuthor

    We only create status checks in gh_issue.py. Basically we need to add back this logic:

    bedevere/bedevere/bpo.py

    Lines 42 to 47 in 6f4978e

    if "body" in event.data["pull_request"]:
    body = event.data["pull_request"]["body"] or ""
    if not body or CLOSING_TAG not in body:
    new_body = BODY.format(body=body, issue_number=issue_number)
    body_data = {"body": new_body}
    await gh.patch(event.data["pull_request"]["url"], data=body_data)

    It was removed in PR #420 when we removed bpo.py and added gh_issue.py

  3. Mariatta commented on Apr 13, 2022

    @Mariatta
    MemberAuthor

    So yes this issue is still valid.

  4. added a commit that references this issue on Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions