Skip to content

Commit 9438f67

Browse files
committed
Add support for out-of-band topics
1 parent 68d1052 commit 9438f67

File tree

5 files changed

+369
-31
lines changed

5 files changed

+369
-31
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,42 @@ Steps to run the meeting
1616

1717
Working days: non-holiday weekdays. Relevant holidays are the national holidays of the USA, Western Europe, and India.
1818

19+
# Tips
20+
21+
## Submitting Out-of-Band Topics
22+
23+
Out-of-band topics allow you to include discussion items from external sources (like RHCOS, other projects, or any URL) in the FCOS meeting without creating issues in the fedora-coreos-tracker repository.
24+
25+
### How to Submit an Out-of-Band Topic:
26+
27+
1. **Create a new issue** in this repository (`fcos-meeting-action`)
28+
2. **Add the label**: `out-of-band-topic`
29+
3. **Title your issue** with a descriptive meeting topic name
30+
4. **Add a URL** in the issue body pointing to the external resource you want to discuss
31+
32+
**Example Issue:**
33+
```
34+
Title: Discuss new awesome feature
35+
Label: out-of-band-topic
36+
Body:
37+
https://github.com/coreos/placeholder/issues/456
38+
```
39+
40+
### What Happens Next:
41+
42+
- The action automatically includes your topic in the next meeting checklist
43+
- If the URL points to a GitHub issue, the action fetches the real issue title
44+
- If title fetching fails, your issue title is used instead
45+
- The trigger issue is automatically closed with a comment linking to the meeting checklist
46+
- Your external topic appears alongside regular tracker topics in the meeting agenda
47+
48+
### Supported URLs:
49+
50+
- GitHub issues (title auto-fetched)
51+
- Any other URL (uses your issue title)
52+
53+
This feature is for discussing RHCOS topics, external dependencies, or one-time discussion items that might not make sense in the fedora-coreos-tracker repository
54+
1955
# Development
2056

2157
## Prerequisites

dist/index.js

Lines changed: 141 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/createIssue.ts

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import * as core from '@actions/core'
22
import { Octokit } from 'octokit'
3+
import { OutOfBandTopic } from './meetingTopics'
34

4-
export async function createThisReposIssue(body: string): Promise<void> {
5+
export interface CreatedIssue {
6+
number: number
7+
url: string
8+
}
9+
10+
export async function createThisReposIssue(
11+
body: string
12+
): Promise<CreatedIssue | null> {
513
try {
614
const octokit = new Octokit({
715
auth: process.env.GITHUB_TOKEN
@@ -15,14 +23,67 @@ export async function createThisReposIssue(body: string): Promise<void> {
1523
}
1624
const [owner, repo] = githubRepository.split(`/`)
1725

18-
await octokit.rest.issues.create({
26+
const response = await octokit.rest.issues.create({
1927
owner,
2028
repo,
2129
title,
2230
body
2331
})
32+
33+
return {
34+
number: response.data.number,
35+
url: response.data.html_url
36+
}
2437
} catch (error) {
2538
// Fail the workflow run if an error occurs
2639
if (error instanceof Error) core.setFailed(error.message)
2740
}
41+
return null
42+
}
43+
44+
export async function closeOutOfBandIssues(
45+
outOfBandIssues: OutOfBandTopic[],
46+
checklistIssue: CreatedIssue
47+
): Promise<void> {
48+
if (outOfBandIssues.length === 0) {
49+
return
50+
}
51+
52+
try {
53+
const octokit = new Octokit({
54+
auth: process.env.GITHUB_TOKEN
55+
})
56+
const githubRepository = process.env.GITHUB_REPOSITORY
57+
if (!githubRepository) {
58+
throw new Error(`GITHUB_REPOSITORY environment variable is not set`)
59+
}
60+
const [owner, repo] = githubRepository.split(`/`)
61+
62+
for (const issue of outOfBandIssues) {
63+
// Add comment to the issue
64+
const comment = `This out-of-band topic has been added to the meeting checklist: ${checklistIssue.url}\n\nTopic: ${issue.title}\nExternal link: ${issue.url}`
65+
66+
await octokit.rest.issues.createComment({
67+
owner,
68+
repo,
69+
issue_number: issue.issueNumber,
70+
body: comment
71+
})
72+
73+
// Close the issue
74+
await octokit.rest.issues.update({
75+
owner,
76+
repo,
77+
issue_number: issue.issueNumber,
78+
state: 'closed'
79+
})
80+
81+
console.log(`Closed out-of-band issue #${issue.issueNumber}`)
82+
}
83+
} catch (error) {
84+
// Log error but don't fail the workflow
85+
if (error instanceof Error) {
86+
console.error(`Error closing out-of-band issues: ${error.message}`)
87+
}
88+
}
2889
}

src/main.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as core from '@actions/core'
22
import { GetActionItems } from './actionItems'
33
import { GetMeetingTopics } from './meetingTopics'
4-
import { createThisReposIssue } from './createIssue'
4+
import { createThisReposIssue, closeOutOfBandIssues } from './createIssue'
55
import { GetAttendees } from './attendees'
66
import fs from 'fs'
77

@@ -19,16 +19,25 @@ export async function run(): Promise<void> {
1919
console.log(actionItems)
2020

2121
console.log('Get meeting topics')
22-
const meetingTopics = await GetMeetingTopics()
23-
console.log(meetingTopics)
22+
const meetingTopicsResult = await GetMeetingTopics()
23+
console.log(meetingTopicsResult.topics)
2424

2525
const issueBody = hydrateIssueTemplate(
2626
attendees,
2727
actionItems,
28-
meetingTopics
28+
meetingTopicsResult.topics
2929
)
3030
console.log('Create issue')
31-
createThisReposIssue(issueBody)
31+
const createdIssue = await createThisReposIssue(issueBody)
32+
33+
// Close out-of-band issues if any were processed
34+
if (createdIssue && meetingTopicsResult.outOfBandIssues.length > 0) {
35+
console.log('Closing out-of-band issues')
36+
await closeOutOfBandIssues(
37+
meetingTopicsResult.outOfBandIssues,
38+
createdIssue
39+
)
40+
}
3241
} catch (error) {
3342
// Fail the workflow run if an error occurs
3443
if (error instanceof Error) core.setFailed(error.message)

0 commit comments

Comments
 (0)