Skip to content

Commit 3fd1eaa

Browse files
committed
chore: fixed grabbing agenda items and added more tests and hackmd parsing
1 parent 9a853eb commit 3fd1eaa

28 files changed

+56
-49
lines changed

.github/workflows/create-meeting-artifacts-manual.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ jobs:
5353
run: |
5454
meeting_group="${{ github.event.inputs.meeting_group }}"
5555
user=$(grep '^USER=' "templates/meeting_base_${meeting_group}" | cut -d'=' -f2 | xargs)
56-
hackmd_team_name=$(grep '^HACKMD_TEAM_NAME=' "templates/meeting_base_${meeting_group}" | cut -d'=' -f2 | xargs)
5756
echo "user=$user" >> $GITHUB_OUTPUT
58-
echo "hackmd_team_name=$hackmd_team_name" >> $GITHUB_OUTPUT
5957
6058
- name: Create GitHub App Token
6159
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
@@ -69,7 +67,6 @@ jobs:
6967
env:
7068
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
7169
HACKMD_API_TOKEN: ${{ secrets.HACKMD_API_TOKEN }}
72-
HACKMD_TEAM_NAME: ${{ steps.read-vars.outputs.hackmd_team_name }}
7370
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
7471
run: node create-node-meeting-artifacts.mjs ${{ github.event.inputs.meeting_group }}
7572

.github/workflows/create-meeting-artifacts-scheduled.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ jobs:
5151
run: |
5252
meeting_group="${{ matrix.meeting_group }}"
5353
user=$(grep '^USER=' "templates/meeting_base_${meeting_group}" | cut -d'=' -f2 | xargs)
54-
hackmd_team_name=$(grep '^HACKMD_TEAM_NAME=' "templates/meeting_base_${meeting_group}" | cut -d'=' -f2 | xargs)
5554
echo "user=$user" >> $GITHUB_OUTPUT
56-
echo "hackmd_team_name=$hackmd_team_name" >> $GITHUB_OUTPUT
5755
5856
- name: Create GitHub App Token
5957
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
@@ -67,7 +65,6 @@ jobs:
6765
env:
6866
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
6967
HACKMD_API_TOKEN: ${{ secrets.HACKMD_API_TOKEN }}
70-
HACKMD_TEAM_NAME: ${{ steps.read-vars.outputs.hackmd_team_name }}
7168
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
7269
run: node create-node-meeting-artifacts.mjs ${{ matrix.meeting_group }}
7370

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,14 @@ templates/minutes_base_<shortname>
123123

124124
See [TEMPLATES_DOCUMENTATION.md](./TEMPLATES_DOCUMENTATION.md) for detailed template examples and variable explanations.
125125

126-
### 2. Update GitHub Actions Workflow
126+
### 2. Update GitHub Actions Workflows
127127

128-
Add your meeting group to `.github/workflows/create-meeting-artifacts.yml`:
128+
Add your meeting group to both workflow files:
129+
130+
- `.github/workflows/create-meeting-artifacts-manual.yml`
131+
- `.github/workflows/create-meeting-artifacts-scheduled.yml`
132+
133+
For manual workflow, add your group to the `options` list under `workflow_dispatch.inputs.meeting_group`:
129134

130135
```yaml
131136
workflow_dispatch:
@@ -142,6 +147,19 @@ workflow_dispatch:
142147
- your-new-group # Add your group here
143148
```
144149
150+
For scheduled workflow, add your group to the `matrix.meeting_group` list:
151+
152+
```yaml
153+
strategy:
154+
matrix:
155+
meeting_group:
156+
- uvwasi
157+
- tsc
158+
- build
159+
# ... existing groups ...
160+
- your-new-group # Add your group here
161+
```
162+
145163
### 3. Update Package.json Scripts
146164

147165
Add npm scripts to `package.json` following this pattern:
@@ -211,10 +229,6 @@ The application creates:
211229
- `HACKMD_API_TOKEN`: HackMD API token for creating and managing documents
212230
- `GOOGLE_API_KEY`: Google Calendar API Key for read-only calendar access
213231

214-
#### Optional
215-
216-
- `HACKMD_TEAM_NAME`: HackMD team name/path for team workspaces
217-
218232
### Meeting Base Configuration
219233

220234
Each `meeting_base_<group>` file contains:
@@ -227,5 +241,6 @@ REPO="repository-name"
227241
GROUP_NAME="Full Group Name"
228242
AGENDA_TAG="agenda-label"
229243
ISSUE_LABEL="optional-issue-label"
244+
HACKMD_TEAM_NAME="openjs-nodejs"
230245
JOINING_INSTRUCTIONS="Meeting join instructions"
231246
```

create-node-meeting-artifacts.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ const calendarClient = google.createCalendarClient(config.google);
2424
// Step 3: Initialize GitHub client
2525
const githubClient = github.createGitHubClient(config);
2626

27-
// Step 4: Initialize HackMD client
28-
const hackmdClient = hackmd.createHackMDClient(config);
29-
30-
// Step 5: Read meeting configuration from templates
27+
// Step 4: Read meeting configuration from templates
3128
const meetingConfig = await meetings.readMeetingConfig(config);
3229

30+
// Step 5: Initialize HackMD client with meeting configuration
31+
const hackmdClient = hackmd.createHackMDClient(config, meetingConfig);
32+
3333
// Step 6: Find next meeting event in calendar
3434
const event = await google.findNextMeetingEvent(calendarClient, meetingConfig);
3535

src/config.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export const getConfig = () => ({
2424
hackmd: {
2525
// HackMD API token for authentication
2626
apiToken: process.env.HACKMD_API_TOKEN,
27-
// HackMD team name
28-
teamName: process.env.HACKMD_TEAM_NAME,
2927
},
3028

3129
// Directory paths for templates, output, and configuration

src/github.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,23 @@ export const getAgendaIssues = async (
5959

6060
// Get all public repositories in the organization
6161
const repos = await paginate(rest.repos.listForOrg, {
62-
org: properties.USER,
62+
org: githubOrg,
6363
type: 'public',
6464
per_page: 100,
6565
});
6666

67-
// Fetch issues from all repositories concurrently
67+
// Fetch issues and PRs from all repositories concurrently
6868
const issuePromises = repos.map(async repo => {
69-
const issues = await paginate(rest.issues.listForRepo, {
69+
const items = await paginate(rest.issues.listForRepo, {
7070
owner: githubOrg,
7171
repo: repo.name,
7272
labels: agendaTag,
7373
state: 'open',
7474
per_page: 100,
7575
});
7676

77-
const filteredIssues = issues.filter(({ pull_request }) => !pull_request); // Exclude PRs
78-
79-
return { repoName: repo.name, issues: filteredIssues };
77+
// Include both issues and PRs for agenda items
78+
return { repoName: repo.name, issues: items };
8079
});
8180

8281
return Promise.all(issuePromises);

src/hackmd.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ import { HACKMD_DEFAULT_PERMISSIONS } from './constants.mjs';
55
/**
66
* Creates a HackMD API client
77
* @param {import('./types.d.ts').AppConfig} config - Application configuration
8+
* @param {import('./types.d.ts').MeetingConfig} meetingConfig - Meeting configuration
89
* @returns {HackMDClient} Configured HackMD API client
910
*/
10-
export const createHackMDClient = ({ hackmd: { apiToken, teamName } }) => {
11-
// Use team-specific API endpoint if teamPath is provided
11+
export const createHackMDClient = ({ hackmd: { apiToken } }, meetingConfig) => {
12+
// Use team-specific API endpoint if teamName is provided in meeting config
13+
const teamName = meetingConfig.properties.HACKMD_TEAM_NAME;
14+
1215
const baseURL = teamName
1316
? `https://api.hackmd.io/v1/teams/${teamName}`
1417
: 'https://api.hackmd.io/v1';

src/types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export interface GoogleConfig {
2828
export interface HackMDConfig {
2929
/** HackMD API token */
3030
apiToken: string;
31-
/** HackMD team name/path */
32-
teamName?: string;
3331
}
3432

3533
/**
@@ -74,6 +72,8 @@ export interface MeetingProperties {
7472
AGENDA_TAG?: string;
7573
/** Optional GitHub issue label */
7674
ISSUE_LABEL?: string;
75+
/** HackMD team name for creating documents */
76+
HACKMD_TEAM_NAME?: string;
7777
/** Meeting joining instructions */
7878
JOINING_INSTRUCTIONS?: string;
7979
}

templates/meeting_base_Release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
CALENDAR_FILTER="Node.js Release Working Group Meeting"
22
CALENDAR_ID="c_16f0ae5d3a22625175d199dbdb1cac84c2d09eab7f173e94f558417cb5cdbfd8@group.calendar.google.com"
33
USER="nodejs"
4-
HACKMD_TEAM_NAME="openjs-nodejs"
54
REPO="Release"
65
GROUP_NAME="Release WorkGroup"
6+
HACKMD_TEAM_NAME="openjs-nodejs"
77
JOINING_INSTRUCTIONS="
88

99
Join URL: <https://zoom.us/j/157618869>

templates/meeting_base_benchmarking

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
CALENDAR_FILTER="Benchmarking WG Meeting"
22
CALENDAR_ID="c_16f0ae5d3a22625175d199dbdb1cac84c2d09eab7f173e94f558417cb5cdbfd8@group.calendar.google.com"
33
USER="nodejs"
4-
HACKMD_TEAM_NAME="openjs-nodejs"
54
REPO="benchmarking"
65
GROUP_NAME="Benchmarking WorkGroup"
6+
HACKMD_TEAM_NAME="openjs-nodejs"
77
JOINING_INSTRUCTIONS="
88

99
* link for participants: <https://zoom.us/j/345481302>

0 commit comments

Comments
 (0)