-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Team REX dependabot rota spreadsheet #674
Remove Team REX dependabot rota spreadsheet #674
Conversation
8dce89e
to
da6c541
Compare
In preparation for non-spreadsheet-driven rotas
Move the bits of SpreadsheetRotaReporter that aren't spreadsheet-specific (i.e. the base rota reporting functions) into a base class to be extended for non-spreadsheet rotas.
e89dec1
to
d74d84d
Compare
Thanks, Jon. I particularly like the changes so far to It's not really for this PR, but it's no longer actually Dependabot we are using in at least some of our repos right, so perhaps we should re-name this workflow and the text it outputs? If you feel like quickly doing that in this or a separate PR or raising an issue for it feel free or I can do one of those. |
|
||
from workspace.utils.people import get_slack_username | ||
from workspace.utils.people import TEAM_REX, People, get_formatted_slack_username | ||
from workspace.utils.rota import RotaReporter | ||
|
||
|
||
class DependabotRotaReporter(RotaReporter): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DependabotRotaReporter
now reports a rota based on cycling a code-defined set of people. I think this is a helpful approach for simple rotas that's likely to be wanted again for future additional or updated workflows. For example, maybe team RAP would want to use it for exactly the same purpose (dependency updates rota, if they have/want that). So it could make sense to pull out a class into utils/rota.py
so it's more discoverable than being hidden away here. Then if people have that use case they can use or extend this rather than re-implement it. I don't think there's much here that's specific to our use case, a small amount of data in the candidates
, purpose
, and possibly offset
, see other comments, which can be set when instantiated in report_rota
. Hopefully that's not too much of a change but if you'd prefer not to do it in this PR that would be okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like that is perhaps premature optimisation. I had a mind that the team rex slack rota could move to this model (in a separate PR) and at that point I'd do the move. For now, it's a single case and thus I don't think warrants generalising (for now)
workspace/dependabot/jobs.py
Outdated
this_monday = today - timedelta(days=today.weekday()) | ||
next_monday = this_monday + timedelta(weeks=1) | ||
|
||
candidates = [r for r in list(TEAM_REX) if r != People.KATIE] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DependabotRotaReporter
hardcodes some data it has: the iterable of people it applies to (TEAM_REX
- People.KATIE
). This should probably be an instance-level or class-level attribute. This fits with the generalized class approach mentioned in a comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was resolved without change or comment so I'm unsure if you intended to change something or not. If you don't intend to change anything in this PR that's fine, carry on. I slightly prefer leaving it unresolved in that case so it's more visible if someone looks at this PR again (eg to see what comments weren't actioned).
d74d84d
to
9038772
Compare
To allow for selection of static rota for this team. Refactor dict of github-username to slack-username into an enum of staff for ease of referring to staff members by real-world name rather than github username.
Select a member of Team REX based on the week number. (Random selection not possible as it is impossible to consistently and statelessly get next week's person)
Refactor to use Person type for clarity and readability. Co-authored-by Mike Kelly <mike.kelly@thedatalab.org>
9038772
to
0e5be13
Compare
Fixes #664.