-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: simplify meetings scheduling (#297)
- Loading branch information
Showing
14 changed files
with
184 additions
and
123 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
.github/workflows/create-event-issue-community-meeting.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Schedule Community Meeting | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
time: | ||
description: 'Info about meeting hour in UTC time zone, like: 08 or 16. No PM or AM versions.' | ||
required: true | ||
date: | ||
description: 'Date in a form like: 2022-04-05 where 04 is a month and 05 is a day number.' | ||
required: true | ||
|
||
jobs: | ||
|
||
setup-community-meeting: | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
name: Setup Community meeting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Create issue content | ||
uses: actions/github-script@v4 | ||
id: date | ||
with: | ||
script: | | ||
const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/meetings/community.js'); | ||
const setupMeeting = require('./.github/workflows/event_issue_templates/index.js'); | ||
setupMeeting('${{ github.event.inputs.date }}', '${{ github.event.inputs.time }}', core, getMeetingIssueContent); | ||
- name: Create issue with meeting details | ||
run: gh issue create -l meeting -t "Community Meeting, ${{steps.date.outputs.hour}}:00 UTC ${{steps.date.outputs.fullDate}}" -F content.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Schedule Lets talk about contributing Meeting | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
time: | ||
description: 'Info about meeting hour in UTC time zone, like: 08 or 16. No PM or AM versions.' | ||
required: true | ||
date: | ||
description: 'Date in a form like: 2022-04-05 where 04 is a month and 05 is a day number.' | ||
required: true | ||
descSuffix: | ||
description: 'You can specify additional text that appears at the end of generated issue title, like: - Product Design' | ||
required: false | ||
default: '' | ||
|
||
jobs: | ||
|
||
setup-lets-talk-about-contrib-stream: | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
name: Setup Lets talk about contributing live stream | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Create issue content | ||
uses: actions/github-script@v4 | ||
id: date | ||
with: | ||
script: | | ||
const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/meetings/lets-talk-about-contrib.js'); | ||
const setupMeeting = require('./.github/workflows/event_issue_templates/index.js'); | ||
setupMeeting('${{ github.event.inputs.date }}', '${{ github.event.inputs.time }}', core, getMeetingIssueContent); | ||
- name: Create issue with meeting details | ||
run: gh issue create -l meeting -t "Let's talk about contributing, ${{steps.date.outputs.hour}}:00 UTC ${{steps.date.outputs.fullDate}} ${{ github.event.inputs.descSuffix }}" -F content.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Schedule Spec 3.0 Meeting | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
time: | ||
description: 'Info about meeting hour in UTC time zone, like: 08 or 16. No PM or AM versions.' | ||
required: true | ||
date: | ||
description: 'Date in a form like: 2022-04-05 where 04 is a month and 05 is a day number.' | ||
required: true | ||
|
||
jobs: | ||
|
||
setup-spec-3-0-meeting: | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
name: Setup 3.0 spec meeting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Create issue content | ||
uses: actions/github-script@v4 | ||
id: date | ||
with: | ||
script: | | ||
const { getMeetingIssueContent } = require('./.github/workflows/event_issue_templates/meetings/spec-3-0.js'); | ||
const setupMeeting = require('./.github/workflows/event_issue_templates/index.js'); | ||
setupMeeting('${{ github.event.inputs.date }}', '${{ github.event.inputs.time }}', core, getMeetingIssueContent); | ||
- name: Create issue with meeting details | ||
run: gh issue create -l meeting -t "Spec 3.0 Meeting, ${{steps.date.outputs.hour}}:00 UTC ${{steps.date.outputs.fullDate}}" -F content.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const { writeFileSync } = require('fs'); | ||
const { getMeetingIssueContent } = require('./meetings/community.js'); | ||
const { parseDate } = require('./utils/date.js'); | ||
|
||
/** | ||
* @param {string} date Date as YYYY-MM-DD | ||
* @param {string} time Number that represents hour, 2-digit format | ||
* @param {string} code Entire core package helper | ||
* @param {string} getMeetingIssueContent Function that returns content of the meeting issue | ||
*/ | ||
module.exports = (date, time, core, getMeetingIssueContent) => { | ||
|
||
core.info(`Workflow triggered with the following hour ${time} and date ${date}`); | ||
const dateDetails = parseDate(`${ date }T${ time }:00:00Z`); | ||
|
||
core.info('This is how time and date looks like after parsing:'); | ||
core.info(JSON.stringify(dateDetails)); | ||
|
||
if (dateDetails === 'Invalid Date') core.setFailed('Invalid date of the event. Make sure that you provided correct hour of the meeting and date in a format described in the meeting input form.') | ||
|
||
const issueContent = getMeetingIssueContent(dateDetails.hour, dateDetails.formattedDate); | ||
|
||
writeFileSync('content.md', issueContent, { encoding: 'utf8'}); | ||
|
||
core.setOutput('formattedDate', dateDetails.formattedDate); | ||
core.setOutput('fullDate', dateDetails.fullDate); | ||
core.setOutput('hour', dateDetails.hour); | ||
} |
28 changes: 28 additions & 0 deletions
28
.github/workflows/event_issue_templates/meetings/community.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports.getMeetingIssueContent = (time, date) => { | ||
|
||
return `This is the AsyncAPI Community meeting. You're invited to [join us live on Zoom](https://zoom.us/j/165106914) and ask questions. **The meeting takes place on alternate Tuesdays**. Recordings from the previous meetings are available in [this](https://www.youtube.com/playlist?list=PLbi1gRlP7pijUwZJErzyYf_Rc-PWu4lXS) playlist on YouTube. | ||
**This time we meet at ${time}:00 UTC. Check what time is it in your time zone with [time zone converter](https://dateful.com/convert/coordinated-universal-time-utc?t=${time}&d=${date})** | ||
Join [this](https://groups.google.com/forum/#!forum/asyncapi-users) mailing list to get an always-up-to-date invite to the meeting in your calendar. You can also check [AsyncAPI Calendar](https://calendar.google.com/calendar/u/0/embed?src=tbrbfq4de5bcngt8okvev4lstk@group.calendar.google.com). | ||
## Agenda | ||
> Don't wait for the meeting to discuss topics that already have issues. Feel free to comment on them earlier. | ||
1. Q&A | ||
1. _Place for your topic_ | ||
1. Q&A | ||
## Notes | ||
tbd | ||
## Chat | ||
tbd | ||
## Recording | ||
tbd` | ||
} |
4 changes: 2 additions & 2 deletions
4
...vent_issue_templates/contributor-first.js → ...lates/meetings/lets-talk-about-contrib.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...rkflows/event_issue_templates/spec-3-0.js → ...vent_issue_templates/meetings/spec-3-0.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Instead of using `package.json` and building complex build system for scripts that setup AsyncAPI meetings, we keep source code of minified [day.js](https://github.com/iamkun/dayjs) and its UTC-format plugin here in `utils` folder directly. This scripts run on CI, and are not vulerable so do not need `package.json` and regular security updates. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const dayjs = require('./dayjs.min.js'); | ||
const utc = require('./utc.js'); | ||
dayjs.extend(utc); | ||
|
||
/** | ||
* @param {string} date Date as 2019-01-25T08:00:00Z | ||
*/ | ||
module.exports.parseDate = (date) => { | ||
|
||
const meetingDate = dayjs(date); | ||
const formattedDate = meetingDate.utc().format('YYYY-MM-DD'); | ||
const fullDate = meetingDate.utc().format('dddd MMMM D YYYY'); | ||
const hour = meetingDate.utc().format('H'); | ||
|
||
return { formattedDate, fullDate, hour } | ||
} | ||
|
||
|
||
|
Oops, something went wrong.