-
Notifications
You must be signed in to change notification settings - Fork 15
Add a handler so that PDC branches are EOL'd when the branch is retired #63
Conversation
@@ -0,0 +1,67 @@ | |||
import logging |
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 notice that this project doesn't seem to have an overall copyright file. You might want to add a copyright header on the two files in this PR.
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.
@bowlofeggs, could you open an issue about this? It's a good observation, but not something I want to handle in this PR.
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.
pdcupdater/handlers/retirement.py
Outdated
""" When a component's branch is retired, EOL all it's branches """ | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(RetireComponentHandler, self).__init__(*args, **kwargs) |
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 recommend dropping this method since it just calls the superclass.
pdcupdater/handlers/retirement.py
Outdated
pass | ||
|
||
def initialize(self, pdc): | ||
pass |
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.
All five of the above methods would benefit from docblocks explaning what they do, what the types and purposes of their arguments are, and what the type of the return values are.
This would be nice to have. (Maybe I can take it on and hit some of @bowlofeggs's points too). Instead of querying datagrepper, this could iterate over all of the source repos in dist-git looking for dead.package files (for every branch). That will indeed take a while, but will support eventual consistency. |
pdcupdater/handlers/retirement.py
Outdated
|
||
# Look up all non-retired branches from PDC | ||
log.info('Looking up all branches from PDC.') | ||
branches = pdc.get_paged(pdc['component-branches']) |
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.
The comment says "all non-retired branches" but this query will return all branches.
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.
LGTM.
This PR doesn't implement an
audit
function. Is it worth the effort considering accuracy would require a lot of querying of datagrepper?