Skip to content

Commit da0116e

Browse files
authored
Merge pull request #45 from nf-core/pipeline_proposals_github_action
✨ feat: add bot for tracking status of pipeline proposals and SIGs
2 parents ed29574 + 78fe8b9 commit da0116e

16 files changed

+5456
-132
lines changed

.github/ISSUE_TEMPLATE/new_pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: New pipeline proposal
22
description: Propose a new pipeline for incorporation into nf-core
33
title: "New pipeline: nf-core/<add provisional pipeline name here>"
4-
labels: "new-pipeline,proposed"
5-
projects: nf-core/104
4+
labels: ["new-pipeline", "proposed"]
5+
projects: ["nf-core/104"]
66
body:
77
- type: input
88
attributes:

.github/ISSUE_TEMPLATE/new_rfc.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
name: New RFC proposal
22
description: Propose a major new functionality for incorporation into nf-core
33
title: "New RFC: <short sentence describing proposal>"
4-
labels: "new-rfc,proposed"
5-
projects: nf-core/127
6-
assignees:
7-
- nf-core/core
4+
labels: ["new-rfc", "proposed"]
5+
projects: ["nf-core/127"]
86
body:
97
- type: checkboxes
108
attributes:
@@ -28,7 +26,6 @@ body:
2826
attributes:
2927
label: Background & Motivation
3028
description: Provide the context of the proposal, summarising the existing status-quo or issues.
31-
placeholder:
3229
validations:
3330
required: true
3431
- type: textarea

.github/ISSUE_TEMPLATE/new_special_interest_group.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: New special interest group proposal
22
description: Propose a new special interest group for incorporation into nf-core
33
title: "New special interest group: <PROVISIONAL SPECIAL INTEREST GROUP NAME>"
4-
labels: "new-special-interest-group,proposed"
5-
projects: nf-core/105
4+
labels: ["new-special-interest-group", "proposed"]
5+
projects: ["nf-core/105"]
66
body:
77
- type: checkboxes
88
attributes:

.github/workflows/lib/.gitignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Coverage reports
5+
coverage/
6+
7+
# Jest cache
8+
.cache/
9+
10+
# Logs
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
15+
# Runtime data
16+
pids
17+
*.pid
18+
*.seed
19+
*.pid.lock
20+
21+
# Optional npm cache directory
22+
.npm
23+
24+
# Optional REPL history
25+
.node_repl_history
26+
27+
# Output of 'npm pack'
28+
*.tgz
29+
30+
# Yarn Integrity file
31+
.yarn-integrity
32+
33+
# dotenv environment variables file
34+
.env
35+
.env.test
36+
37+
# parcel-bundler cache (https://parceljs.org/)
38+
.cache
39+
.parcel-cache
40+
41+
# next.js build output
42+
.next
43+
44+
# nuxt.js build output
45+
.nuxt
46+
47+
# vuepress build output
48+
.vuepress/dist
49+
50+
# Serverless directories
51+
.serverless
52+
53+
# FuseBox cache
54+
.fusebox/
55+
56+
# DynamoDB Local files
57+
.dynamodb/

.github/workflows/lib/README.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# GitHub Approval Automation
2+
3+
This module contains the `ApprovalManager` class used by GitHub Actions workflows to automate the approval process for pipeline proposals and RFCs.
4+
5+
## Files
6+
7+
- `approval.js` - The main ApprovalManager class
8+
- `approval.test.js` - Unit tests for ApprovalManager class
9+
- `workflow-integration.test.js` - Integration tests for complete workflow scenarios
10+
- `package.json` - Node.js package configuration with Jest setup
11+
- `README.md` - This documentation file
12+
13+
## ApprovalManager Class
14+
15+
The `ApprovalManager` class handles:
16+
17+
- Fetching team members from GitHub organization teams
18+
- Processing comments to track approvals and rejections via `/approve` and `/reject` commands
19+
- Updating issue status and labels based on approval state
20+
- Managing status comments on issues
21+
22+
### Usage Scenarios
23+
24+
#### Pipeline Proposals
25+
26+
- **Approval Criteria**: Either 2 core team members OR 1 core team member + 1 maintainer
27+
- **Issue Title Pattern**: Must start with "New Pipeline"
28+
- **Team Roles**: Both core team and maintainers can vote
29+
30+
#### RFC Proposals
31+
32+
- **Approval Criteria**: Quorum of core team members (Math.ceil(coreTeamMembers.length / 2))
33+
- **Issue Title Pattern**: Must start with "New RFC"
34+
- **Team Roles**: Only core team members can vote
35+
36+
## Running Tests
37+
38+
### Prerequisites
39+
40+
Install Node.js and npm, then install Jest:
41+
42+
```bash
43+
npm install
44+
```
45+
46+
### Test Commands
47+
48+
```bash
49+
# Run all tests
50+
npm test
51+
52+
# Run tests in watch mode (reruns on file changes)
53+
npm test:watch
54+
55+
# Run tests with coverage report
56+
npm test:coverage
57+
```
58+
59+
## Test Suite
60+
61+
The test suite includes both unit tests and integration tests:
62+
63+
### Unit Tests (`approval.test.js`)
64+
65+
Tests individual methods and functionality of the ApprovalManager class.
66+
67+
### Integration Tests (`workflow-integration.test.js`)
68+
69+
End-to-end tests that simulate complete workflow scenarios as they would run in GitHub Actions.
70+
71+
## Test Coverage
72+
73+
The combined test suites cover:
74+
75+
### Core Functionality
76+
77+
- ✅ Constructor initialization
78+
- ✅ Team member fetching from GitHub API
79+
- ✅ Comment processing with `/approve` and `/reject` commands
80+
- ✅ Status comment updates
81+
- ✅ Issue label management
82+
83+
### Pipeline Proposal Scenarios
84+
85+
- ✅ Approval with 2 core members
86+
- ✅ Approval with 1 core + 1 maintainer
87+
- ✅ No approval with only 1 core member
88+
- ✅ No approval with only maintainers
89+
90+
### RFC Proposal Scenarios
91+
92+
- ✅ Approval with core team quorum
93+
- ✅ No approval without quorum
94+
- ✅ Quorum calculation for different team sizes
95+
- ✅ Ignoring maintainer votes (core-only)
96+
97+
### Edge Cases
98+
99+
- ✅ Case-insensitive commands (`/APPROVE`, `/reject`)
100+
- ✅ Commands only at start of line
101+
- ✅ Multiple commands from same user
102+
- ✅ Multiple commands within same comment
103+
- ✅ Non-team member comments (ignored)
104+
- ✅ Empty or malformed comments
105+
- ✅ Mixed line endings
106+
- ✅ Users in both core and maintainer teams
107+
108+
### Error Handling
109+
110+
- ✅ GitHub API errors
111+
- ✅ Empty comment arrays
112+
- ✅ Null/undefined comment bodies
113+
- ✅ Malformed regex patterns
114+
115+
## Command Format
116+
117+
The approval system recognizes these commands when they appear at the start of a line in a comment:
118+
119+
- `/approve` - Approve the proposal
120+
- `/reject` - Reject the proposal
121+
122+
Commands are case-insensitive and can include additional text after the command.
123+
124+
### Examples
125+
126+
```
127+
/approve
128+
```
129+
130+
```
131+
/approve This looks good to me!
132+
```
133+
134+
```
135+
/reject
136+
This needs more work before approval.
137+
```
138+
139+
```
140+
I have some concerns.
141+
/reject
142+
```
143+
144+
## Status Labels
145+
146+
The system manages these issue labels:
147+
148+
- `proposed` - Initial state for new proposals
149+
- `accepted` - Proposal has sufficient approvals
150+
- `turned-down` - Proposal was rejected
151+
- `timed-out` - Proposal expired without sufficient votes

0 commit comments

Comments
 (0)