Skip to content

Commit

Permalink
Website: add support for annual auto issues, add new digital experien…
Browse files Browse the repository at this point in the history
…ce issue (#23218)

Changes:
- updated build-static-content to allow auto-issue rituals with a
`annually` frequency
- Updated the create-issues-for-todays-rituals script to create GH
issues for annually occurring rituals
- Added an annual ritual for checking GitHub's terms
- Added a responsibility to the Digital experience handbook page about
the ritual.

---------

Co-authored-by: Sam Pfluger <[email protected]>
  • Loading branch information
eashaw and Sampfluger88 authored Oct 27, 2024
1 parent 0ba4a93 commit 6094e31
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions handbook/digital-experience/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,10 @@ After the team member notifies the Head of Digital Experience (via Slack), the H
4. Go through the calendar and make sure all private meetings (e.g. 1:1's, E-Group, and quarterly board meetings) have "[no shadows]" in the event title.
### Check GitHub terms
Go to [GitHub's terms of services](https://docs.github.com/en/free-pro-team@latest/github/site-policy/github-terms-of-service) and search “inbound=outbound” to find the clause, if still there as is, paste a screenshot into the table in this [document](https://docs.google.com/document/d/101rcp9v3Zdml4YolGRmqYS5ruAKzQvXLOTHLXCavPuE/edit#heading=h.xu6qsi0wrns). If the clause has changed, contact Mike M. and let him know.
## Rituals
Expand Down
10 changes: 10 additions & 0 deletions handbook/digital-experience/digital-experience.rituals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,16 @@
description: "Log into the \"Integrations admin\" account in Salesforce and change the password to prevent a password change being required by Salesforce."
moreInfoUrl: "https://fleetdm.com/handbook/digital-experience#change-the-integrations-admin-salesforce-account-password"
dri: "eashaw"
-
task: "Check GitHub/GitLab terms"
startedOn: "2023-10-24"
frequency: "Annually"
description: "Check GitHub's terms to make sure the “inbound=outbound” clause is unchanged."
moreInfoUrl: "https://fleetdm.com/handbook/digital-experience#check-github-terms"
dri: "hollidayn"
autoIssue:
labels: [ "#g-digital-experience" ]
repo: "confidential"
-
task: "Check that there is sufficient availability for scheduling demos via fleetdm.com/contact"
startedOn: "2024-10-25"
Expand Down
2 changes: 1 addition & 1 deletion website/scripts/build-static-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ module.exports = {
});

let githubLabelsToCheck = {};
let KNOWN_AUTOMATABLE_FREQUENCIES = ['Daily', 'Weekly', 'Triweekly', 'Monthly'];
let KNOWN_AUTOMATABLE_FREQUENCIES = ['Daily', 'Weekly', 'Triweekly', 'Monthly', 'Annually'];
// Process each rituals YAML file. These will be added to the builtStaticContent as JSON
for(let ritualsYamlFilePath of ritualTablesYamlFiles){
// Get this rituals.yml file's parent folder name, we'll use this as the key for this section's rituals in the ritualsTables dictionary
Expand Down
15 changes: 14 additions & 1 deletion website/scripts/create-issues-for-todays-rituals.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ module.exports = {
ritualsFrequencyInMs = 1000 * 60 * 60 * 24 * 7 * 2;
} else if(ritual.frequency === 'Triweekly'){
ritualsFrequencyInMs = 1000 * 60 * 60 * 24 * 7 * 3;
} else if (ritual.frequency === 'Annually') {
ritualsFrequencyInMs = 1000 * 60 * 60 * 24 * 365;
} else if (ritual.frequency === 'Monthly') {
// For monthly rituals, we will create issues on the day of the month that the ritual was started on, or the last day of the month if the ritual was started on a day that doesn't exist in the current month
// (e.g, the next issue for a monthly ritual started on 2024-01-31 would be created for on 2024-02-29)
Expand All @@ -66,7 +68,18 @@ module.exports = {
}//fi

// Determine if we should create an issue for non-monthly rituals.
if(ritual.frequency !== 'Monthly') {
if(ritual.frequency === 'Annually') {
// Create a date of when the ritual started
let ritualStartedOn = new Date(ritual.startedOn);
let dayToCreateIssueOn = ritualStartedOn.getUTCDate();
let monthToCreateIssueOn = ritualStartedOn.getUTCMonth();

// Check if today's month and day match the ritual's start date
if (now.getUTCDate() === dayToCreateIssueOn && now.getUTCMonth() === monthToCreateIssueOn) {
isItTimeToCreateANewIssue = true;
}
nextIssueShouldBeCreatedAt = new Date(now.getUTCFullYear() + 1, monthToCreateIssueOn, dayToCreateIssueOn);
} else if(ritual.frequency !== 'Monthly') {
// Get a JS timestamp representing 12 PM UTC of the day this script is running.
let twelveHoursInMs = 1000 * 60 * 60 * 12;
let lastUTCNoonAt = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), 12, 0, 0, 0)).getTime();
Expand Down

0 comments on commit 6094e31

Please sign in to comment.