Skip to content

Restructure event directories#129

Merged
lemonsaurus merged 16 commits into
python-discord:mainfrom
kwzrd:kwzrd/events-rework
Mar 29, 2021
Merged

Restructure event directories#129
lemonsaurus merged 16 commits into
python-discord:mainfrom
kwzrd:kwzrd/events-rework

Conversation

@kwzrd
Copy link
Copy Markdown
Contributor

@kwzrd kwzrd commented Mar 6, 2021

Closes #123.
Closes #127.


This PR implements the changes proposed in #123.

The events directory (previously seasonal) is restructured and configured with meta.md files to be used by Python's new branding manager. A validation script is added, which will run in CI and validate event configuration to ensure that a broken setup doesn't reach the main branch.

What has changed?

The changes are not too dramatic - the new events directory is very similar in structure to what we had before. The new addition are meta.md files, which use frontloaded YAML to provide each event with a description and a duration. These files are fetched and read by the Python bot.

The exact structure that events must comply with in order to pass validation is documented in the new events/README.md. I will therefore not go into too much detail, as I assume that reviewers will read the README anyway.

Branding for past one-time events (i.e. jams) is not included in the events directory. I've placed those assets into a parallel jams directory. It is assumed that the branding manager will be used to manage jam assets in the future, but it does not make sense to include past events as they will never be applied again.

Validation & CI

I have added a validation script that lives in the events directory. It's a few lines of code that will run through the directory and verify that each event is correctly set up, and that there are no collisions between events. It depends on the YAML parser declared in the requirements file. The script exits with a non-0 code if it detects errors.

image

image

image

I have also added a GH Actions workflow that runs this script on pull requests and new commits on main. However, it seems that since I am working from a fork, we will not be able to run the workflow until the PR is merged into the upstream. Reviewers can run the script locally (see the events README for instructions). I have tested and verified that it fails the workflow if errors are found.

PyDis projects use a custom workflow for sending status embeds to the #mod-log channel, reporting whether CI passed. Because I have struggled a little bit with understanding how this workflow works, and didn't want to blindly copy-paste it without being able to test, I'd prefer for it to be added later (directly in upstream, and probably by someone more experienced). So for now the CI runs and validates events, but does not produce a cute status embed.

Assets

This PR adds an Easter banner, which was previously missing. It is a simple colour edit of the evergreen SVG:

image

Event descriptions

With the help of @dawnofmidnight we have added a short description for each event. The descriptions are pulled by Python and presented as embeds:

image

Each description links Wikipedia or similar for more information. I assume there may be some discussion regarding the descriptions. I wasn't entirely sure on how to approach them.

Calendar

Quick overview of current configuration, formatted as event_name[start_day-end_day]. Both bounds inclusive.

February: Valentines[1-15], BHM[16-29]
March: StPatrick[10-18]
April: Easter[1-30]
June: Pride[1-30]
October: Hacktoberfest[1-31]
November: Diwali[1-7]
December: Christmas[1-25], NewYear[26-31]

Python-side, a calendar overview can be produced on-demand from the fetched events:

image

I'd recommend that reviewers also read the Python-side PR description.

kwzrd added 3 commits March 6, 2021 15:33
Move all files from the 'seasonal' directory into 'events' and adjust
internal event structure for the new schema.

A new directory 'jams' contains jam-related assets. These may
eventually live in 'events' as well, but since the event-calender
is not officially decided yet, I decided to keep them separately.

All files removed by this commit were duplicates.
For now, the files contain the start and end dates, and a header.
Descriptions will be added later.

The Evergreen season is a special case, registering as a 'fallback',
rather than having a defined period. This is the branding that we
use when no other event is active.

By default, we understand the 'fallback' key to be False.
@kwzrd kwzrd marked this pull request as draft March 6, 2021 21:52
Base automatically changed from master to main March 13, 2021 19:17
@kwzrd kwzrd marked this pull request as ready for review March 15, 2021 19:27
@kwzrd
Copy link
Copy Markdown
Contributor Author

kwzrd commented Mar 16, 2021

This PR will now also add the missing Easter banner (#127). It's a colour edit of the evergreen one to match the Easter logo:

image

PR includes both the SVG base & a rendered PNG.

@kwzrd kwzrd marked this pull request as draft March 18, 2021 08:36
@kwzrd kwzrd mentioned this pull request Mar 26, 2021
kwzrd and others added 3 commits March 27, 2021 17:46
Many of these were contributed by DawnOfMidnight!

Co-authored-by: DawnOfMidnight <78233879+dawnofmidnight@users.noreply.github.com>
@kwzrd kwzrd marked this pull request as ready for review March 28, 2021 11:14
@kwzrd
Copy link
Copy Markdown
Contributor Author

kwzrd commented Mar 28, 2021

🙏

Ready for review!

lemonsaurus
lemonsaurus previously approved these changes Mar 29, 2021
Copy link
Copy Markdown
Contributor

@lemonsaurus lemonsaurus left a comment

Choose a reason for hiding this comment

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

This looks excellent to me. Very well done.

Shivansh-007
Shivansh-007 previously approved these changes Mar 29, 2021
Copy link
Copy Markdown
Contributor

@Shivansh-007 Shivansh-007 left a comment

Choose a reason for hiding this comment

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

Looks good! Just 2 grammar changes (can be ignored) and it would be perfect!

Comment thread events/README.md Outdated

## Automatic validation

Fortunately, it is not necessarily to manually verify that all events are configured properly w.r.t. the requirements explained above. The `validation.py` script contains logic to ascertain correct setup, and will automatically run in CI on pull requests to prevent a broken configuration from reaching the production branch.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Fortunately, it is not necessarily to manually verify that all events are configured properly w.r.t. the requirements explained above. The `validation.py` script contains logic to ascertain correct setup, and will automatically run in CI on pull requests to prevent a broken configuration from reaching the production branch.
Fortunately, it is not necessary to manually verify that all events are configured properly w.r.t. the requirements explained above. The `validation.py` script contains logic to ascertain correct setup, and will automatically run in CI on pull requests to prevent a broken configuration from reaching the production branch.

Comment thread events/README.md Outdated

The markdown section of the meta file then contains the event's description. Descriptions are made available directly in the Discord guild as embeds sent by the Python bot. For formatting, use Discord's watered down Markdown ~ keep in mind that e.g. the `#` symbol does not create a heading.

A description is required to exist, and must be at most 2048 characters in length in order to fit into a Discord embed.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
A description is required to exist, and must be at most 2048 characters in length in order to fit into a Discord embed.
A description is required to exist, and must be at most 2048 characters in length to fit into a Discord embed.

Comment thread events/README.md Outdated

## Event directory structure

In order for an event directory to be valid, it has to contain the following assets.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
In order for an event directory to be valid, it has to contain the following assets.
For an event directory to be valid, it has to contain the following assets.

in order for seems a bit wordy here, it is grammatically correct, but keeping it concise is better.

kwzrd and others added 2 commits March 29, 2021 13:10
Co-authored-by: Shivansh-007 <Shivansh-007@users.noreply.github.com>
@kwzrd kwzrd dismissed stale reviews from Shivansh-007 and lemonsaurus via 04099d2 March 29, 2021 11:13
@kwzrd
Copy link
Copy Markdown
Contributor Author

kwzrd commented Mar 29, 2021

@lemonsaurus Thank you for the review!

@Shivansh-007 Thanks, applied in f8c4282.

Copy link
Copy Markdown
Contributor

@Shivansh-007 Shivansh-007 left a comment

Choose a reason for hiding this comment

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

purrrfect

Copy link
Copy Markdown
Contributor

@lemonsaurus lemonsaurus left a comment

Choose a reason for hiding this comment

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

Let's do this.

@lemonsaurus lemonsaurus merged commit 6e6f2ad into python-discord:main Mar 29, 2021
@kwzrd kwzrd mentioned this pull request Mar 30, 2021
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.

Create Easter themed banner Rework seasonal branding structure

3 participants