Skip to content

✨ feat(pipeline-proposals): add github action bot for tracking status #45

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kenibrewer
Copy link
Member

This pull request introduces a new GitHub Actions workflow to automate the approval process for pipeline proposals. The workflow handles issue creation, comment-based voting, and status updates, ensuring that proposals are reviewed and approved or rejected based on team member input. It includes logic to manage labels, track votes, and update issue status dynamically.

New Workflow for Pipeline Proposal Approval:

  • Workflow Setup: Added a new workflow file .github/workflows/pipeline_proposals.yml to automate the approval process for pipeline proposals triggered by issue events (opened, closed, labeled, unlabeled) and comments (created, edited).

  • Approval Logic: Implemented logic to fetch team members, track approvals/rejections, and determine the proposal status based on voting rules (e.g., approvals required from either 2 core members or 1 core member + 1 maintainer).

  • Dynamic Status Updates: Added functions to generate detailed status comments, format user lists, and update issue labels and states based on the current approval/rejection status.

  • Timed-Out and Label Handling: Integrated label-based handling to mark proposals as "timed-out" and update the status accordingly.

@kenibrewer kenibrewer requested a review from Copilot May 28, 2025 21:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a GitHub Actions workflow to automate the approval process for pipeline proposals by tracking team votes and updating issue status and labels.

  • Introduces a new workflow file that triggers on issue and comment events for "New Pipeline" issues.
  • Implements functions to fetch core and maintainer team members and compute approval/rejection votes.
  • Updates or creates status comments and adjusts issue labels and state based on voting rules and timeouts.
Comments suppressed due to low confidence (2)

.github/workflows/pipeline_proposals.yml:36

  • [nitpick] The variable name res is generic. Renaming it to something more descriptive like response or teamMembersResponse will improve code clarity.
const res = await github.request('GET /orgs/{org}/teams/{team_slug}/members', {

.github/workflows/pipeline_proposals.yml:167

  • The script reopens issues when they’re manually closed because it only closes in specific status cases. Consider adding an explicit guard to ignore manual closed events (those without state_reason set by the bot) before updating status to prevent unintentionally reopening issues.
if (context.eventName === 'issues' && context.payload.action === 'opened') {

uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
github-token: ${{ secrets.nf_core_bot_auth_token }}
script: |
Copy link
Preview

Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The inline script is 267 lines long, which can make maintenance difficult. Consider moving the logic into a separate JavaScript/TypeScript file in the repo and referencing it here to improve readability and reuse.

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't agree more 👆🏻

Probably the same for the other one too actually. Is this possible to do with actions/github-script? Bonus points if we can have a shared utils.js to share functions..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants