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

Manage movable holiday events with CI #181

Open
5 tasks
lemonsaurus opened this issue Apr 28, 2022 · 1 comment
Open
5 tasks

Manage movable holiday events with CI #181

lemonsaurus opened this issue Apr 28, 2022 · 1 comment
Assignees
Labels
level: advanced Require a lot of skill or experience with the project priority: high High priority type: feature A request for or implementation of a new feature

Comments

@lemonsaurus
Copy link
Member

What's the problem?

Some of the events we've got branding for, such as Eid al-Fitr and Holi, fall on different dates every year.

This means we manually update the start and end dates for these in order for the events to happen at the right time of year.

How can we solve that?

One approach is to leverage GitHub Actions to create an automatic pull request with the required changes every year.

For example, on January 1, a Python Discord GitHub App could open a pull request to this repository with all the movable holiday changes required for that year.

Implementation steps

  • Find a free API we can use to look up the start date for these holidays.
  • Get Python Discord admins / owners to create a new GH App that has permission to open pull requests and read code in this repository (and no other permissions). App ID and Key for this app must be added to this repository as repository secrets.
  • Write a GitHub Action that uses schedule as the trigger and runs on January 1st every year. This action can simply check out this repository, and then execute a Python file that will make the required changes to the meta.md files that represent movable holidays.
  • In this action, use something like tibdex/github-app-token@v1 to generate a token with the GitHub App credentials.
  • Use the token when you check out this repository, and then use something like peter-evans/create-pull-request@v3 to create a pull request with the necessary changes.

How do we know which events are movable?

The simplest way to do this would be to just add that information to the meta.md files for each movable holiday.

E.g., we could do something like this:

movable: true
duration: 7 days
holiday_api_name: eid-al-fitr

This will tell us that this event is movable, will last 7 days from the start date, and that you can use eid-al-fitr to look up the start date in the holiday API.

This change would have to be made to all relevant events at the same time as we add this CI.

@lemonsaurus lemonsaurus added type: feature A request for or implementation of a new feature priority: high High priority level: advanced Require a lot of skill or experience with the project labels Apr 28, 2022
@D0rs4n
Copy link
Member

D0rs4n commented Aug 16, 2022

I'd like to tackle that one.

@D0rs4n D0rs4n self-assigned this Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level: advanced Require a lot of skill or experience with the project priority: high High priority type: feature A request for or implementation of a new feature
Projects
None yet
Development

No branches or pull requests

2 participants