aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Fix docstrings and add a few explanatory commentsGravatar Sebastiaan Zeeff2020-11-30-5/+8
|
* Set correct channel ID as default for AoC channelGravatar Sebastiaan Zeeff2020-11-30-1/+1
|
* Remove now redundant advent_of_code_staff constantGravatar Sebastiaan Zeeff2020-11-30-2/+1
| | | | | We're no longer going to use a two-channel setup for this event, as we don't want to split the event community into two, staff and non-staff.
* Remove redundant _error_embed_helper functionGravatar Sebastiaan Zeeff2020-11-30-7/+3
| | | | | | This helper function was only being used in one spot and did not factor out any logic. I've removed the helper function to just create the embed where it's needed.
* Rewrite Advent of Code leaderboard logicGravatar Sebastiaan Zeeff2020-11-30-0/+680
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've rewritten the Advent of Code leaderboard logic. Unfortunately, nearly all of the changes made are interrelated, meaning that they've ended up in the same commit. To add a bit of structure to the extension, I've chosen for a subpackage structure instead of a single file structure. The biggest changes: - Whether or not you get a join code for the staff leaderboard will now be determined by looking for the Helpers-role. - The Python Discord Leaderboard now includes all boards, including the staff leaderboard. This is one event. - Redis is now used to set a cache expiry period. This means that our code does not have to check for cache staleness; Redis will do that for us. - The period "fetching" task has been removed. We now fetch solely when the data is needed to prevent putting unnecessary stress on the Advent of Code website. - The option to display the Global Leaderboard within Discord has been removed. Rather, we now link to the website. This simplified the code for now, although we could add it back later. - An additional command, `.aoc refresh`, has been added to allow Admins and the Events Lead to force the cache to be invalidated. This should be done sparingly to not overburden the AoC website. - I've also made sure that the daily notification task actually pings the notification role by setting the `allowed_mentions` kwarg.
* Remove adventofcode.py in favour of subpackageGravatar Sebastiaan Zeeff2020-11-30-983/+0
| | | | | | As the Advent of Code file was getting massive, I've removed the old single-file based extension as I'm going to replace it with a partially rewritten subpackage-based extension.
* Add constants parsing for multiple leaderboardsGravatar Sebastiaan Zeeff2020-11-30-9/+38
| | | | | | | | | | | | | | | | | | | | I've added a unified approach to setting data for multiple leaderboards using environmental variables. Instead of setting separate variables for the three pieces of data we have, hoping that the position of each board matches up in the three fields, I now set one environmental variable, AOC_LEADERBOARDS, that holds delimited data. The data is in the format: board_id1,session1,join_code1::board_id2,session2,join_code2[::...] The staff leaderboards should be included as usual in this environmental variable. Another environment variable, AOC_STAFF_LEADERBOARD_ID, can be used to designate which leaderboard should be used as the staff board. I've also made some other constants configurable in this commit and added the role ID of the Events Lead role to allow the Events Lead to force a reload of the leaderboard cache.
* Fix adventofcode extension (and constants) grammarGravatar ks1292020-11-27-12/+12
| | | Co-authored-by: Joe Banks <[email protected]>
* Use default 0 for score and reverse leaderboard membersGravatar ks1292020-11-27-1/+3
|
* Handle leaderboard cache create/update failGravatar ks1292020-11-27-12/+52
|
* Remove unnecessary check for members in leaderboard updater taskGravatar ks1292020-11-27-3/+1
|
* Add comment about choosing leaderboard for userGravatar ks1292020-11-27-0/+1
|
* Store AoC leaderboard IDs instead join codes for users mappingGravatar ks1292020-11-26-5/+10
|
* Implement staff and public leaderboardsGravatar ks1292020-11-26-58/+197
|
* Implement different invitation codes for staff and public leaderboardsGravatar ks1292020-11-25-11/+66
|
* Add comments about AoC env config order and change cookies wayGravatar ks1292020-11-24-1/+4
|
* Add staff AoC channel to whitelistGravatar ks1292020-11-24-1/+1
|
* Update constants to match with new format of AoC that will run in 2020Gravatar ks1292020-11-24-3/+6
|
* Update CODEOWNERSGravatar Joe Banks2020-11-24-1/+2
|
* Update CODEOWNERSGravatar Joe Banks2020-11-24-1/+1
|
* Merge pull request #524 - add wonder twins commandGravatar Mark2020-11-23-0/+148
|\
| * Merge branch 'master' into feature/wonder-twins-commandGravatar ks1292020-11-23-1115/+303
| |\
| * | fix typos in docstringGravatar fisher602020-11-22-1/+1
| | |
| * | make init variables more readable, fix docstring, remove redundant listGravatar fisher602020-11-22-6/+6
| | |
| * | move constants to init, change [-1] to .endswith()Gravatar fisher602020-11-21-9/+9
| | |
| * | feature/add wonder twins commandGravatar fisher602020-11-19-0/+148
| | | | | | | | | | | | This commit implements a wonder twins inspired command. This is a purely fun command that uses real transformations from the show to make random new transformations. The yaml is all hand transcribed from the actual show.
* | | Fix parameter specification in Build workflowGravatar Sebastiaan Zeeff2020-11-23-4/+6
| | |
* | | Use deployment.yaml defined in the kubernetes repoGravatar Sebastiaan Zeeff2020-11-23-24/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Our dear knight, Sir Lancebot, will now get their deployment information from the private python-discord/kubernetes repository. The workflow will use GitHub Personal Access Token to access this private repository. To not mix up files, the repositories are checked out side-by-side in subdirectories of the workflow directory.
* | | Narrow down repository events that trigger a buildGravatar Sebastiaan Zeeff2020-11-23-1/+1
| |/ |/| | | | | | | | | I've narrowed down repository events that trigger a Build to the "push" event specifically. This means that we never build for a "pull request" trigger, even if the source branch is called "master".
* | Add a banner and fix the README a bit.Gravatar Leon Sandøy2020-11-21-2/+4
| |
* | Merge branch 'master' of github.com:python-discord/seasonalbotGravatar Leon Sandøy2020-11-21-143/+104
|\ \
| * \ Merge pull request #528 from ↵Gravatar Leon Sandøy2020-11-21-143/+104
| |\ \ | | | | | | | | | | | | | | | | python-discord/lemon/refactor/seasonalbot_name_change Rebrand bot to Sir Lancebot.
| | * | Remove dead ShowProjects cog.Gravatar Leon Sandøy2020-11-21-37/+2
| | | | | | | | | | | | | | | | We no longer have this channel, so this cog serves no purpose.
| | * | Remove references to old name.Gravatar Leon Sandøy2020-11-21-89/+82
| | | | | | | | | | | | | | | | | | | | I've tried to replace this with generic references where appropriate, but a lot of the time it just doesn't make a lot of sense to do so.
| | * | Make the bot name less hard-coded.Gravatar Leon Sandøy2020-11-21-19/+22
| |/ /
* / / Header image for Sir LancebotGravatar Leon Sandøy2020-11-21-0/+0
|/ /
* | Merge branch 'master' into redis-persistGravatar Leon Sandøy2020-11-20-71/+85
|\ \ | | | | | | | | | | | | | | | | | | # Conflicts: # bot/exts/evergreen/branding.py # bot/exts/halloween/candy_collection.py # bot/exts/halloween/hacktoberstats.py
| * | Add inline cache manifest to docker imageGravatar Sebastiaan Zeeff2020-11-20-0/+1
| |/ | | | | | | | | We need to attach an inline cache manifest to the image we build and push to the GHCR to be able to use the registry as a cache source for subsequent builds. I've added it to the build workflow configuration.configuration.
| * Update workflow status badges in readmeGravatar Sebastiaan Zeeff2020-11-19-1/+7
| | | | | | Our two workflows, Lint and Build, now have separate status badges that link to the latest results from that workflow.
| * Merge pull request #520 from python-discord/sebastiaan/backend/fix-flake8-checkGravatar Leon Sandøy2020-11-19-78/+85
| |\ | | | | | | Fix flake8 check in CI and separate Lint and Build jobs into separate workflows
| | * Split lint and build jobs into separate workflowsGravatar Sebastiaan Zeeff2020-11-16-57/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've separated the lint and build jobs into two separate workflows: - Lint: .github/workflows/lint.yaml - Build: .github/workflows/build.yaml The main difference is that the Build workflow will be triggered if the Lint workflow completes while it's been run on the "master" branch. The build job will check if the Lint run was successful and if it were, it actually builds the container, pushes it the GHCR, and triggers the deployment to our kubernetes cluster.
| | * Fix lint errors introduced by persistence removalGravatar Sebastiaan Zeeff2020-11-16-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We ripped some features out of the bot to make the migration to kubernetes easier. However, that process left us with some linting errors that will play up if anyone makes a PR. I've added "noqa" to the valid TODO lines and commented out lines that introduced now unused names or tried to use now undefined names. This should have no influence on the bot, as it does not touch code that is actually being run at the moment.
| | * Ensure flake8 runs correctly in Pull Request checkGravatar Sebastiaan Zeeff2020-11-16-13/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, the flake8 action we were using from the marketplace required us to use the `pull_request_target` event, which runs in the context of the target repository to protect secrets. However, this also meant that flake8 would run on files already merged into our master branch, not the actual changes made in teh PR! That's obviously pretty useless as a guard against merging linting errors into our repository. This change sidesteps the issue by removing the marketplace action and replacing it by a direct `flake8` run command. To make sure error output ends up as a GitHub Actions Annotation, we ask `flake8` to format its error messages using the correct GitHub Workflow Command format: ::error file={filename},line={line},col={col}::{message} Whenever something is printed to stdout/stderr in that format, GitHub Actions will automatically interpret it as the "register error message" workflow command. Since this doesn't require a GitHub Token with "write" permissions, we can now switch back to the safer `pull_request` event that gets a read-only GitHub Token.
* | Simpler environment variables.Gravatar Leon Sandøy2020-11-20-6/+6
| | | | | | Co-authored-by: Jeremiah Boby <[email protected]>
* | Get rid from branding management stuffGravatar ks1292020-11-17-836/+5
| |
* | Remove unnecessary JSON filesGravatar ks1292020-11-16-5/+0
| |
* | Port HacktoberStats cog to use Redis instead of JSONGravatar ks1292020-11-16-67/+12
| |
* | Port candy_collection.py to use Redis instead of JSONGravatar ks1292020-11-16-34/+26
| |
* | Migrate branding from JSON persist to RedisGravatar ks1292020-11-16-25/+13
| |
* | Depend bot on redis, add other environment variables + sync filesGravatar ks1292020-11-16-4/+7
| |