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

Add second_reviewer.yml #7829

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Add second_reviewer.yml #7829

merged 2 commits into from
Jan 17, 2024

Conversation

drew2a
Copy link
Contributor

@drew2a drew2a commented Jan 16, 2024

This pull request introduces a new GitHub Actions workflow titled "Second Reviewer Assignment." The primary objective of this workflow is to automate the process of assigning a second reviewer to pull requests when required, as part of our tie-breaker mechanism in code review processes.

Key Features:

  1. Trigger Condition: The workflow is triggered when a label named PR: second reviewer is added to a pull request. It is designed to only respond to this specific label, ensuring that the action is executed intentionally and in the appropriate context.

  2. Fetching Reviewers: The workflow fetches the list of potential reviewers from the 'reviewers' team within the 'Tribler' GitHub organization. This is done using the actions/github-script action with a custom script.

  3. Reviewer Assignment Logic:

    • The script filters out the pull request author and any reviewers already assigned to the pull request, ensuring no duplicate assignments.
    • From the remaining list of eligible reviewers, one reviewer is randomly selected and assigned to the pull request.
  4. Commenting on PR: After assigning the reviewer, the workflow automatically posts a comment on the pull request, explaining the selection. This comment serves to inform all participants about the automated decision and its context.

  5. Handling Unavailability of Reviewers: In case all potential reviewers are already assigned, the workflow adds a comment to the pull request stating that all eligible reviewers have been exhausted. This serves as a notification for manual intervention.

  6. Usage of PAT Token: A Personal Access Token (PAT) titled PAT_TOKEN_FOR_SECOND_REVIEWER_UNTIL_JAN_2025 is used due to the insufficient permissions of the default GitHub token for viewing members of the Tribler organization. This token is valid until January 2025 and will need to be replaced upon expiration.

Additional Notes:

  • Token Expiration Reminder: It's important to note that the PAT_TOKEN_FOR_SECOND_REVIEWER_UNTIL_JAN_2025 will expire in January 2025. A renewal or replacement will be necessary to maintain the functionality of this workflow.

Modifications:

  • Added the .github/workflows/second_reviewer_assignment.yml file implementing the workflow.

Resolves #7807

Refs:

@drew2a drew2a force-pushed the feature/7807 branch 3 times, most recently from 4f471ae to 3dcae19 Compare January 17, 2024 11:38
@drew2a drew2a marked this pull request as ready for review January 17, 2024 13:39
@drew2a drew2a requested review from a team and xoriole and removed request for a team January 17, 2024 13:39
@drew2a drew2a merged commit 44e2235 into main Jan 17, 2024
16 checks passed
@drew2a drew2a deleted the feature/7807 branch January 17, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Tie Breaker
2 participants