Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workflow for Agenda Verification and Notifications before Monday Meetings #802

Merged
merged 20 commits into from
Sep 24, 2024

Conversation

nikhilkalburgi
Copy link
Contributor

GitHub Issue: #794

Summary:

I have created a workflow that checks if the issue contains the original template every Monday 10min before the meeting. If there is any agenda added to it by the issue-collector workflow, then the condition does not match else a comment is sent to the issue thread along with slack notification like it is done for few other workflows.

This does not close the issue itself. Let me know if this works and you also want me to automate closing the issue.

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this PR! Much appreciated. I just added a few suggestions but looks great ...

REPO: 'community'
OCWM_LABEL: ${{ vars.OCWM_LABEL }}
TEMPLATE_PATH: '../ISSUE_TEMPLATE/open_community_working_meeting.md'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_GEN_NOTIF }}

This is the secret containing the the webhook


on:
schedule:
- cron: '50 21 * * 1' # Runs at 21:50 UTC, which is 10 minutes before 14:00 PT every Monday
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- cron: '50 21 * * 1' # Runs at 21:50 UTC, which is 10 minutes before 14:00 PT every Monday
- cron: '50 18 15-21 * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month

I am suggesting this change because we just decided to make the meetings mothly the 3rd monday of the month and 2 hours earlier as 12:00 PT


// Add a comment to the issue
await mygithub.request(`POST /repos/${process.env.OWNER}/${process.env.REPO}/issues/${latestIssue.number}/comments`, {
body: "The meeting as been cancelled as there is no agenda for today. Thanks"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
body: "The meeting as been cancelled as there is no agenda for today. Thanks"
body: "The meeting has been cancelled as there is no agenda for today. Thanks everyone!"


// Send a notification to Slack
const slackPayload = {
text: `The meeting as been cancelled as there is no agenda for today. Thanks`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
text: `The meeting as been cancelled as there is no agenda for today. Thanks`
text: `The meeting has been cancelled as there is no agenda for today. Thanks everyone!`

@nikhilkalburgi
Copy link
Contributor Author

Hi @benjagm,

I've made the changes that were suggested to the workflow.

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nikhilkalburgi. I added some more suggestions mostly I found that making the process run only on the third monday of the month is not as easy as I thought and is not possible using only using cron. Please check the code and let me know.


on:
schedule:
- cron: '50 18 15-21 * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- cron: '50 18 15-21 * 1' # Runs at 11:50 AM PT on the 3rd Monday of the month
- cron: '50 21 * * 1' # Runs at 21:50 UTC, which is 10 minutes before 14:00 PT every Monday

My apologies but the code I suggested to be added was not working as I was expecting so sorry for suggesting it. Let's return your previous change.

Make the process runs only the third monday is not possible only using cron. We'll need to add a new step the workflow. I'll suggest the change later.


- name: Install Dependencies
run: npm install @octokit/[email protected]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Step to check if today is the third Monday
- name: Check if today is the third Monday
id: check-third-monday
run: |
day=$(date +%d)
dow=$(date +%u) # Day of the week (1 = Monday, ..., 7 = Sunday)
# Check if the day is between 15th and 21st, and if it's Monday (1)
if [ "$dow" -ne 1 ]; then
echo "Not a Monday, exiting..."
exit 0
fi
if [ "$day" -ge 15 ] && [ "$day" -le 21 ]; then
echo "This is the third Monday of the month!"
else
echo "Not the third Monday, exiting..."
exit 0
fi

This new step will make sure the process only runs completely the third monday of the month.

@nikhilkalburgi
Copy link
Contributor Author

Hi @benjagm ,

I have added the new step to the workflow. I had to do tests to check if the last step is working. Anyway..Let me know if any other changes are required here.

@gregsdennis
Copy link
Member

Can you rename this PR, please? 'Resolves an issue' doesn't tell me what this PR does.

@nikhilkalburgi nikhilkalburgi changed the title resolves #794 add workflow for Agenda Verification and Notifications before Monday Meetings Sep 24, 2024
@nikhilkalburgi
Copy link
Contributor Author

Can you rename this PR, please? 'Resolves an issue' doesn't tell me what this PR does.

Renaming Done!

We are facing issues with this same logic in other workflows. I am just applying the same version we have in other workflows to consistently merge with master branch.
Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge thanks for this contribution!! Let's merge it!

@benjagm benjagm merged commit defef76 into json-schema-org:main Sep 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants