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

GitHub action: Adding Issue Labels to Pull Requests #1707

Closed
14 of 17 tasks
Aveline-art opened this issue Jun 11, 2021 · 2 comments · Fixed by #1740
Closed
14 of 17 tasks

GitHub action: Adding Issue Labels to Pull Requests #1707

Aveline-art opened this issue Jun 11, 2021 · 2 comments · Fixed by #1740
Assignees
Labels
Complexity: Medium enhancement New feature or request suggestion Feature Missing This label means that the issue needs to be linked to a precise feature label. role: back end/devOps Tasks for back-end developers size: missing

Comments

@Aveline-art
Copy link
Member

Aveline-art commented Jun 11, 2021

Overview

We need to have the pr's automatically populated with the same labels as the related issue so that the same methodology that people use to pick issues to work on can be used for prs to review (pick the issue that matches your current level).

Details

Pull requests range in complexity and scope, and potential reviewers currently have a hard time deciding which pull requests to review. Repopulating pull requests with the labels of the linked issue will help reviewers decide which request fit their comfort level and ability.

Action Items

  • Create a Github action bot. Psudo-code is:
    • Read the text of the first/original comment of the pull request
    • From that text, find the linked issue
    • Read or retrieve the labels from the linked issue
    • Add the same labels to the pull request
  • Non-exhaustive list of unit tests:
    • Bot must run when a new PR is created OR... (read: not XOR)
    • ...Bot must run when the first/original comment is edited
    • Bot must not add labels when a linked issue does not exist
    • Bot must not run when multiple linked issue exists
    • Bot must add the exact same labels, no more, no less
    • Bot will not add the labels if the there is a linked pull request rather than a linked issue (Note: abandoned due to need for additional API call. Inefficient.)
    • When the comment is updated, bot will erase existing labels, before re-adding labels
    • Proof it against dependencies should breaking changes every happen
    • Do proper security handling
    • Ensure logged output does not display sensitive information
    • Possible function awaiting approval from seniors: bot will add a comment to the pull request when a linked issue is not added or multiple issues are in the text

Resources/Instructions

Don't know how to do GitHub actions? Start here!

@Aveline-art Aveline-art self-assigned this Jun 11, 2021
@Aveline-art Aveline-art added enhancement New feature or request suggestion role: back end/devOps Tasks for back-end developers Complexity: Medium labels Jun 11, 2021
@akibrhast
Copy link
Member

Possible function awaiting approval from seniors: bot will add a comment to the pull request when a linked issue is not added or multiple issues are in the text

That is a good idea! But it should be its own issue and its own action. Something along the lines of:

  • Create a github action called "request-linked-issue-on-pr.yml" that auto adds a comment[Please link an issue to this PR] to a PR if the PR has no linked pull request
  • the trigger for the gh action should be "On New PR creation + 20mins"

@Aveline-art
Copy link
Member Author

Aveline-art commented Jun 13, 2021

  • Progress: Event triggers are set up. Currently trying to extract Linked Issue number. github env does not log linked issues in comments. Will need to use regex to extract linked issue's value.
  • Blockers: Weighing the pros and cons of two methods of reading first comments. Through API or a potentially buggy github native env?
  • Availability: Sunday, Wednesday, Friday, Saturday.
  • ETA: By Tuesday, at the latest.

Note to self:

  • Ensure that when the issue number is not returned (no issue, or multiple issues), do not move onto the next script
  • Ensure that if there are no labels, the script returns neatly, and do not move onto the next script

@Aveline-art Aveline-art changed the title GitHub HackForLA bot: Adding Issue Labels to Pull Requests GitHub action: Adding Issue Labels to Pull Requests Jun 15, 2021
@Josiah-O Josiah-O added size: missing Feature Missing This label means that the issue needs to be linked to a precise feature label. labels Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Medium enhancement New feature or request suggestion Feature Missing This label means that the issue needs to be linked to a precise feature label. role: back end/devOps Tasks for back-end developers size: missing
Projects
Development

Successfully merging a pull request may close this issue.

4 participants