Skip to content

Advent of Code Migration from Sir Lancebot#66

Merged
janine9vn merged 6 commits into
mainfrom
aoc-straight-migration
Nov 30, 2022
Merged

Advent of Code Migration from Sir Lancebot#66
janine9vn merged 6 commits into
mainfrom
aoc-straight-migration

Conversation

@janine9vn
Copy link
Copy Markdown
Contributor

This is a migration of the Advent of Code cog, mostly as-is, from Sir Lancebot to Sir Robin. This is as close to a straight migration as I could manage. Any changes or improvements we want will be made in subsequent PRs once this is merged in.

How do I review this?

I've split this up into 4 commits, grouped by collections of files/changes:

  • Porting over the necessary utils/ files
  • Updating the constants.py file
  • A quick port of the invoke help command thingy
  • Migration of the Advent of Code cog itself

The commits have information about what is not quite the straight port. Spoiler alert: it's some import statements and parts of the Redis Cache. Everything else is a straight copy/paste or drag/drop.

If you'd like to test this with minimal effort, I can provide most of my .env file that includes the leaderboard session cookie information. I can also provide you access to my test server where it should have the roles and constants configured for my .env file.

There may be some unnecessary constants, but I ported over at least
what's required for AoC.
This commit migrates the Advent of Code cog. It's *almost* a straight
port of the features.

Some things that were changed:
Some of the usage for RedisSession and RedisCache were changed. Lancebot
AoC was not updated for the newer async-rediscache. with aioredis being
deprecated it made things complicated. Overall functionality is not
changed though.

I changed where the `about.json` lives. I didn't want to make a whole
new folder structure for one file. I promise it works.

Some of the import statements had to change. Instead of
`from bot.bot import bot` we now have
`from bot.bot import SirRobin`.
Comment thread bot/bot.py
Copy link
Copy Markdown
Contributor

@MarkKoz MarkKoz left a comment

Choose a reason for hiding this comment

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

Can someone make time to figure out which utilities are common and create an issue for them to be migrated to bot-core? The copy-pasting is fine for now given the urgency.

Will the AoC extension on the other bot be disabled for the time being, or is there a PR soon to remove that code?

Comment thread bot/exts/advent_of_code/_helpers.py
Comment thread bot/exts/advent_of_code/_helpers.py
@MarkKoz
Copy link
Copy Markdown
Contributor

MarkKoz commented Nov 30, 2022

I did not intend for my comments to block the merge (given that they were left with an approval). I don't know why GH is blocking. Feel free to resolve them whenever you want to merge this. I assume you're still waiting for env vars to be set in prod?

@janine9vn janine9vn merged commit 2fbb9d0 into main Nov 30, 2022
@janine9vn janine9vn deleted the aoc-straight-migration branch November 30, 2022 14:50
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.

4 participants