rocket2
rocket2 copied to clipboard
feat: Slack pairings
fixes #514 , closes https://github.com/ubclaunchpad/ideas/issues/8
Details
Creates basic donut style matching for Rocket.
What implemented so far:
- A donut scheduler that currently runs every minute (for debugging purposes, will bump to a reasonable number once this is ready to land)
- Some initial refactoring to allow the schedulers to have access to the db
- Slack api calls needed to:
- Get a slack channel's id by name
- Create a private conversation given a list of users
- Basic persistence of pairings in a new pairings table
TODOs before this is ready:
- [x] Add persistence, to prevent users from getting matched again
- [x] ~~Add TTL to entries in the Pairings table~~ I can file a follow up for this, we can live without it for now
- [x] Add tests
- For slack API calls
- For persistence
- [ ] Add documentation
- General documentation for the feature
- For the new environment variable
- Documentation for the new pairings table
Where I am currently:
~~Contemplating if I should add a table for the pairings or if it should be a part of the User
model, leaning towards the latter with possibly opening a ticket for the former beyond this pr.
Went with creating a new table 😄 Now working on adding the TTL and making sure edge cases don't explode on us~~
I'll be updating the above as I go.
Contemplating if I should add a table for the pairings or if it should be a part of the
User
model, leaning towards the latter with possibly opening a ticket for the former beyond this pr.
IMO I think you should go with the former (though the difference in work is pretty significant). Seems less hacky and wouldn't leak too much information (example: /rocket user view
can potentially see who you matched with).
And it would set the precedent for similar things in the future.
Codecov Report
Merging #553 into master will decrease coverage by
0.54%
. The diff coverage is83.52%
.
@@ Coverage Diff @@
## master #553 +/- ##
==========================================
- Coverage 93.01% 92.46% -0.55%
==========================================
Files 42 44 +2
Lines 2420 2589 +169
Branches 323 346 +23
==========================================
+ Hits 2251 2394 +143
- Misses 110 131 +21
- Partials 59 64 +5
Impacted Files | Coverage Δ | |
---|---|---|
db/dynamodb.py | 85.71% <57.14%> (-4.80%) |
:arrow_down: |
app/model/pairing.py | 65.00% <65.00%> (ø) |
|
tests/memorydb.py | 91.17% <76.92%> (+1.06%) |
:arrow_up: |
app/scheduler/__init__.py | 92.30% <80.00%> (-2.94%) |
:arrow_down: |
interface/slack.py | 95.77% <87.50%> (-2.41%) |
:arrow_down: |
app/model/__init__.py | 100.00% <100.00%> (ø) |
|
app/scheduler/modules/pairing.py | 100.00% <100.00%> (ø) |
|
config/__init__.py | 100.00% <100.00%> (ø) |
|
db/facade.py | 100.00% <100.00%> (ø) |
|
... and 2 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 255ce39...d2e2b87. Read the comment docs.
OK I got some time to work on this again (after like 20 days 😢) and Added a few tests.
I think this is ready for a round of review so I'll change it from a draft. My next focus will be docs and addressing any feedback that pops up. No rush on the review, we are all busy and this is decently large.
Nothing that this closes https://github.com/ubclaunchpad/ideas/issues/8 as well