Skip to content

Commit 7571833

Browse files
committed
Merge remote-tracking branch 'upstream/master' into docs/reorganize-repo-docs
2 parents c668b3b + fa572f4 commit 7571833

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4550
-205
lines changed

.github/workflows/create-event-workflow-reusable.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ jobs:
102102
- name: Checkout repository
103103
uses: actions/checkout@v2
104104
- name: Setup Node.js
105-
uses: actions/setup-node@v2
105+
uses: actions/setup-node@v4
106106
with:
107-
node-version: 16
107+
node-version: 22
108108
cache: 'npm'
109109
cache-dependency-path: '**/package-lock.json'
110110
- name: Install deps

.github/workflows/mailing/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ const sendMail = async (to, type, name, links, title, custom = {}) => {
88
const { subject, html } = htmlMailContent(type, name, links, title, custom);
99
const text = htmlToText(html);
1010

11+
console.debug(`Sending mail with subject: ${subject}`);
12+
console.debug(`Sending mail with text: ${text}`);
13+
console.debug(`Sending mail with text in html: ${html}`);
14+
1115
const msg = {
1216
to,
1317
from,

.github/workflows/maintainer_management.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ jobs:
172172
});
173173
core.info(`Successfully removed ${maintainer} from the organization.`);
174174
} catch (error) {
175-
core.setFailed(`Failed to remove ${maintainer} from the organization: ${error.message}`);
175+
if (error.message.startsWith('Cannot find')) {
176+
core.info(`Failed to remove ${maintainer} from the organization: ${error.message}`);
177+
} else {
178+
core.setFailed(`Failed to remove ${maintainer} from the organization: ${error.message}`);
179+
}
176180
}
177181
}
178182
@@ -191,14 +195,10 @@ jobs:
191195
github-token: ${{ secrets.GH_TOKEN_ORG_ADMIN }}
192196
script: |
193197
const removedMaintainers = "${{ needs.remove_maintainer.outputs.removedMaintainers }}".split(",");
194-
const removedTscMembers = "${{ needs.remove_maintainer.outputs.removedTscMembers }}".split(",");
195198
196-
// Goodbye message to removed maintainers and notification to TSC members
199+
// Goodbye message to removed maintainers
197200
const combinedMessages = removedMaintainers.map((maintainer) => {
198-
const tscNotification = removedTscMembers.includes(maintainer)
199-
? `@asyncapi/tsc_members We want to inform you that @${maintainer.trim().replace(/^@/, '')} is no longer a maintainer of any repository under AsyncAPI Initiative. It means this maintainer is also no longer a member of TSC.`
200-
: '';
201-
return `@${maintainer.trim().replace(/^@/, '')} We wanted to express our gratitude for your contributions as a maintainer of AsyncAPI Initiative. Your efforts have been immensely valuable to us, and we truly appreciate your dedication. Thank you once again, and we wish you all the best in your future endeavors!\n\n${tscNotification}`;
201+
return `@${maintainer.trim().replace(/^@/, '')} We would like to express our gratitude for your contributions as a maintainer of AsyncAPI Initiative. Your efforts have been immensely valuable to us, and we truly appreciate your dedication. Thank you once again, and we wish you all the best in your future endeavors!\n\n`;
202202
});
203203
204204
const { owner, repo } = context.repo;

.github/workflows/tsc_management.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
184184
// Goodbye message to removed TSC members
185185
const tscMessages = removedTscMembers.map(tscMember => {
186-
return `@asyncapi/tsc_members We want to inform you that @${tscMember.trim().replace(/^@/, '')} is no longer a member of the TSC. This might be because of various reasons. Might be that @${tscMember.trim().replace(/^@/, '')} is no longer a maintainer of any repository under AsyncAPI Initiative. Might be also that @${tscMember.trim().replace(/^@/, '')} is still a maintainer but cannot commit to support entire organization and wants to focus only on the maintained repository. Might be also that @${tscMember.trim().replace(/^@/, '')} did not participate in voting for a long time and was removed due to inactivity and no communication.`;
186+
return `@${tscMember.trim().replace(/^@/, '')} We would like to express our gratitude for your contributions as a member of the Technical Steering Committee at the AsyncAPI Initiative. Your efforts have been immensely valuable to us, and we truly appreciate your dedication. Thank you once again, and we wish you all the best in your future endeavors!\n\n`;
187187
});
188188
189189
const { owner, repo } = context.repo;
@@ -196,6 +196,8 @@ jobs:
196196
needs: remove_tsc_member
197197
if: needs.remove_tsc_member.outputs.removedMaintainers != ''
198198
runs-on: ubuntu-latest
199+
env:
200+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
199201
steps:
200202
- name: Check out code
201203
uses: actions/checkout@v2
@@ -242,6 +244,7 @@ jobs:
242244
run: |
243245
git config --global user.name asyncapi-bot
244246
git config --global user.email [email protected]
247+
245248
- name: Create new branch
246249
run: |
247250
git checkout -b update-emeritus-${{ github.run_id }}

.github/workflows/vote-notify-helpers/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ async function sendMailNotification(member, issue, daysSinceStart, slackToken, s
165165
return false;
166166
}
167167

168+
//logging only type of email value to identify if undefined or string so we know if API responds with data or there are some scopes issues and API returns undefined
169+
console.debug(`Fetched email from Slack for ${response.data.user.profile.real_name_normalized} and data is: ${typeof response.data.user.profile.email}`);
170+
168171
const { real_name_normalized, email } = response.data.user.profile;
169172
const { success, message } = await sendMail(email, 'voting', real_name_normalized, links, title, { days: daysSinceStart });
170173

.github/workflows/vote-notify.yml

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
name: Notify TSC Members about Voting Status
22

33
on:
4+
workflow_dispatch:
5+
inputs:
6+
notification_method:
7+
description: 'Which channel(s) to notify on manual dispatch'
8+
required: true
9+
default: 'both'
10+
type: choice
11+
options:
12+
- email
13+
- slack
14+
- both
415
schedule:
516
# Daily at 9:00 UTC
617
- cron: '0 9 * * *'
@@ -47,52 +58,65 @@ jobs:
4758
# This file comes from the branch vote_state which is created by the stateful-action
4859
# Eg: https://github.com/ash17290/asyncapi-community/tree/vote_state
4960
cd .vote_state
50-
61+
5162
# Check if the file exists, not empty and readable and create if not
5263
if [ ! -f vote_status.json ] || [ ! -s vote_status.json ] || [ ! -r vote_status.json ]; then
53-
echo "Intializing vote_status.json"
64+
echo "Initializing vote_status.json"
5465
echo "{}" > vote_status.json
5566
fi
5667
5768
# Read the file and export it as JSON
5869
export json=$(cat vote_status.json | jq -c)
59-
6070
echo "::debug::vote_status=$json"
6171
6272
# Store in GitHub Output
6373
echo "vote_status=$json" >> $GITHUB_OUTPUT
64-
74+
6575
# Needed as axios and js-yaml are not available in the default environment
6676
- name: Install the dependencies
6777
6878
shell: bash
69-
79+
7080
- name: Notify TSC Members
7181
uses: actions/github-script@v7
7282
id: notify
7383
env:
7484
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
85+
# default to 'both' if inputs.notification_method is undefined (schedule runs)
86+
NOTIFY_METHOD: ${{ github.event.inputs.notification_method || 'both' }}
87+
SLACK_DM: ${{ secrets.SLACK_DM_TSC }}
7588
with:
7689
script: |
7790
const yaml = require('js-yaml');
7891
const fs = require('fs');
79-
const axios = require('axios');
92+
const {
93+
filterIssues,
94+
getTSCLeftToVote,
95+
sendSlackNotification,
96+
sendMailNotification
97+
} = require('./.github/workflows/vote-notify-helpers/index.js');
98+
const { sendMail } = require('./.github/workflows/mailing/index.js');
8099
81100
// Creates list of issues for which the TSC members need to be notified
82101
// The number of buffer days is easily configurable by changing the value of the days variable
83-
const { filterIssues, getTSCLeftToVote, sendSlackNotification, sendMailNotification } = require('./.github/workflows/vote-notify-helpers/index.js');
84-
const { sendMail } = require('./.github/workflows/mailing/index.js');
85102
const issues = ${{ steps.list.outputs.result }};
86103
const initialState = ${{ steps.fetch.outputs.vote_status }};
87-
const config = {
88-
days: 5
89-
}
104+
105+
// On manual dispatch, override to 0; on schedule keep 5
106+
// If workflow_dispatch is used (manual workflow trigger) then we want to set 0 to force notification sending, even if it was just sent or the other day
107+
const daysBuffer = context.eventName === 'workflow_dispatch' ? 0 : 5;
108+
const config = { days: daysBuffer };
90109
91110
const { issuesToNotify, state } = filterIssues(issues, initialState, config);
92111
112+
// Read TSC members from MAINTAINERS.yaml
93113
const tscMembers = yaml.load(fs.readFileSync('MAINTAINERS.yaml', 'utf8')).filter(member => member.isTscMember);
94114
const failingSlackIds = new Set();
95115
const failingEmails = new Set();
116+
117+
const method = process.env.NOTIFY_METHOD; // 'email' | 'slack' | 'both'
118+
119+
console.log(`Notification method: ${method}`);
96120
console.log(`Issues to notify: ${JSON.stringify(issuesToNotify.map(issue => issue.number))}`);
97121
98122
for (const issue of issuesToNotify) {
@@ -101,22 +125,30 @@ jobs:
101125
for (const member of leftToVote) {
102126
console.log(`Notifying ${member.name} about issue #${issue.number}`);
103127
104-
if (!await sendSlackNotification(member, issue, daysSinceStart, `${{ secrets.SLACK_DM_TSC }}`, voteCommentURL)) {
105-
failingSlackIds.add(member.slack);
128+
// Only send Slack if requested
129+
if (method === 'slack' || method === 'both') {
130+
if (!await sendSlackNotification(member, issue, daysSinceStart, process.env.SLACK_DM, voteCommentURL)) {
131+
failingSlackIds.add(member.slack);
132+
}
106133
}
107134
108-
if (!await sendMailNotification(member, issue, daysSinceStart, `${{ secrets.SLACK_DM_TSC }}`, sendMail, voteCommentURL)) {
109-
failingEmails.add(member.email);
135+
// Only send Email if requested
136+
if (method === 'email' || method === 'both') {
137+
if (!await sendMailNotification(member, issue, daysSinceStart, process.env.SLACK_DM, sendMail, voteCommentURL)) {
138+
failingEmails.add(member.email);
139+
}
110140
}
111141
}
142+
143+
// Update last_notified timestamp
112144
state[issue.number].last_notified = new Date().toISOString();
113145
}
114146
115147
// Store the failing IDs in GITHUB_ENV
116148
const failingIds = [...failingSlackIds, ...failingEmails];
117149
if (failingIds.length > 0) {
118-
process.env.FAILED_IDS = Array.from(failingIds).join(',');
119-
core.exportVariable('FAILED_IDS', JSON.stringify(Array.from(failingIds)));
150+
process.env.FAILED_IDS = failingIds.join(',');
151+
core.exportVariable('FAILED_IDS', JSON.stringify(failingIds));
120152
}
121153
122154
// Store the state back
@@ -127,11 +159,12 @@ jobs:
127159
run: |
128160
echo ${{ steps.notify.outputs.result }} | jq > ./.vote_state/vote_status.json
129161
162+
# Always alert on any failures, regardless of method
130163
- name: Notify about failing Slack DMs
131-
if: env.FAILED_IDS
164+
if: ${{ env.FAILED_IDS }}
132165
uses: rtCamp/action-slack-notify@v2
133166
env:
134-
SLACK_WEBHOOK: ${{secrets.SLACK_CI_FAIL_NOTIFY}}
135-
SLACK_TITLE: 🚨 Vote notifications could'nt be sent to following IDs 🚨
136-
SLACK_MESSAGE: ${{ env.FAILED_SLACK_IDS }}
167+
SLACK_WEBHOOK: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}
168+
SLACK_TITLE: 🚨 Vote notifications couldn’t be sent 🚨
169+
SLACK_MESSAGE: ${{ env.FAILED_IDS }}
137170
MSG_MINIMAL: true

Emeritus.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ emeritus_ambassadors:
66
- raphaeldelio
77

88
emeritus_tsc:
9-
- jotamusik
9+
- jotamusik
1010
- LouisXhaferi
1111
- aeworxet
1212
- arjungarg07
@@ -25,3 +25,4 @@ emeritus_tsc:
2525
- M3lkior
2626
- anandsunderraman
2727
- lbroudoux
28+
- CameronRushton

MAINTAINERS.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
slack: U01DVKKAV5K
8686
availableForHire: false
8787
company: Solace
88-
isTscMember: true
88+
isTscMember: false
8989
repos:
9090
- spec-json-schemas
9191
- bindings

0 commit comments

Comments
 (0)