Skip to content

Add automatic creation of final year module threads - #842

Merged
MattyTheHacker merged 10 commits into
mainfrom
auto-threads
Nov 30, 2026
Merged

MattyTheHacker merged 10 commits into
mainfrom
auto-threads

Conversation

@MattyTheHacker

@MattyTheHacker MattyTheHacker commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Implements an extra step on the channel rollover to automatically create module threads

@MattyTheHacker MattyTheHacker self-assigned this Sep 30, 2026
@MattyTheHacker
MattyTheHacker requested a review from a team September 30, 2026 19:28
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@CarrotManMatt CarrotManMatt added enhancement New feature or request question Further information is requested labels Sep 30, 2026
@flaberpengu

flaberpengu commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Discussed in CSS meeting today (12/10), we think this would be a good feature to have. The overhead seems manageable for the benefit it'll bring. We didn't discuss details of how, i.e. is it part of the new year rollover with the new channels? And how do we handle this year's case where the channels now exist but there are no threads - maybe we manually do ones for second semester then have this feature ready ahead of 2027/28 academic year?

@MattyTheHacker

MattyTheHacker commented Oct 12, 2026 •

Copy link
Copy Markdown
Member Author

Discussed in CSS meeting today (12/10), we think this would be a good feature to have. The overhead seems manageable for the benefit it'll bring. We didn't discuss details of how, i.e. is it part of the new year rollover with the new channels? And how do we handle this year's case where the channels now exist but there are no threads - maybe we manually do ones for second semester then have this feature ready ahead of 2027/28 academic year?

Sounds good, and yeah there's 3 implementation options essentially:

  1. As it is in this PR, which is that it's done as one of the steps in the annual channel handover
  2. As a separate command that does the same thing, but can be triggered at will
  3. same as option 2, but with 2 separate commands - one for sem 1 modules and another for sem 2

In option 1, there's no way to run it for this year, and that would then just be up to committee what they wanna do

Option 2 could be run as soon as it's merged in, but would create all of them, and so would re-create any which names didn't match exactly what already exists.

Option 3 let's you pick whether you want to do sem 1 or 2, but still wouldn't solve the issue of the existing threads - it would re-create any which didn't match the expected names and ignore any that do

Personally I'd suggest option 2 purely because it means you only have to run 1 command (and not have to try and remember to run the sem 2 in with option 3)

For both option 2 and 3 we could also add a feature that will put the links into a message and send it into the channel and pin it

@flaberpengu

Copy link
Copy Markdown
Contributor

I feel like option 3 is probably best? It avoids clogging up with threads of semester 2 modules off the bat, and remembering to run one command once near the new term shouldn't be bad. I can poll committee though and see what people think. I'd be happy with 2 though as well. I think 1 is not fantastic as it means you have to remember to update modules before doing the roll-over, and some modules have been known to be cancelled quite late before start of semester.

What's the logistics re: command numbers? Are we near the command limit or am I making that up?

@MattyTheHacker

Copy link
Copy Markdown
Member Author

Yeah makes sense - happy to take whatever steer committee would prefer.

Command limit wise we're fine for slash commands since the limit for those is like 200 or something. We are at the limit for message context commands (the right click ones) and I think we have 1 spare on the user context commands, but yeah no need to worry for the normal slash commands.

@flaberpengu

Copy link
Copy Markdown
Contributor

Ok, I've polled committee and option 1 won (3 votes vs 2 votes for option 3 vs 0 votes for option 2). So I guess this year's threads will be manual, but otherwise it will be part of the steps in the annual handover. We'll need to note then during handover that the module changes need to be put in at that point and if anything gets cancelled late, we have to manually edit the threads.

MattyTheHacker and others added 2 commits November 20, 2026 16:11
ITJoeAdams
ITJoeAdams previously approved these changes Nov 20, 2026
flaberpengu
flaberpengu previously approved these changes Nov 24, 2026

@flaberpengu flaberpengu left a comment

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.

Code looks good to me. All committee discussions and decisions addressed.

@MattyTheHacker MattyTheHacker added sync Request bots to automatically keep this PR up to date with it's base branch and removed question Further information is requested labels Nov 24, 2026

@CarrotManMatt CarrotManMatt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Passing the reason string into AnnualYearChannelsIncrementCommandCog._create_module_threads() feels clunky, but not the end of the world.

Comment thread cogs/annual_handover_and_reset.py Resolved
Comment thread cogs/annual_handover_and_reset.py Resolved
Comment thread cogs/annual_handover_and_reset.py Resolved
Comment thread cogs/annual_handover_and_reset.py Resolved
Co-authored-by: Matt Norton <matt@carrotmanmatt.com>
Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com>
CarrotManMatt
CarrotManMatt previously approved these changes Nov 24, 2026
@CarrotManMatt CarrotManMatt added the awaiting committee review PRs awaiting approval from a CSS committee member label Nov 24, 2026
@flaberpengu

Copy link
Copy Markdown
Contributor

Will get committee thoughts on this, so holding approval until then, but I think adding a pinned message linking to threads might be nice as many will be archived due to inactivity between creation and start of semester, so first years may miss them

@CarrotManMatt CarrotManMatt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is my code review from a technical perspective. Happy for any further changes to be made, based on committee's functionality/feature requests, as needed.

Comment thread cogs/annual_handover_and_reset.py Resolved
Comment thread cogs/annual_handover_and_reset.py Resolved
Comment thread cogs/annual_handover_and_reset.py Resolved
Comment thread cogs/annual_handover_and_reset.py Resolved
Comment thread cogs/annual_handover_and_reset.py Resolved
MattyTheHacker and others added 2 commits November 26, 2026 18:10
Co-authored-by: Matt Norton <matt@carrotmanmatt.com>
Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com>
Comment thread cogs/annual_handover_and_reset.py Resolved

@flaberpengu flaberpengu left a comment

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.

All comments and concerns addressed. Scope changed to add threads for all years groups + pin on annual roll-over. Tested working.

@MattyTheHacker
MattyTheHacker merged commit e3cae15 into main Nov 30, 2026
14 checks passed
@MattyTheHacker
MattyTheHacker deleted the auto-threads branch November 30, 2026 15:33
@github-actions github-actions Bot removed the awaiting committee review PRs awaiting approval from a CSS committee member label Nov 30, 2026
@CarrotManMatt CarrotManMatt removed the sync Request bots to automatically keep this PR up to date with it's base branch label Nov 30, 2026

This branch was successfully deployed

1 active deployment
publish — b1b8ea20 Deployed Nov 26, 2026 by MattyTheHacker via Build and publish Docker image #5038
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants