Closed mikeyoung85 closed 3 months ago
I'll reopen after I work through how to set nil and Unmaintained statuses correctly
I refactored things a little bit. I've changed the RepositoryHost.update_from_host
method to read the archived
field, which is supported by Github and Gitlab only, and use that to ask the Repository
for the correct status to set. I've changed the moved Readme code to be a little more explicit about what it is doing.
This slightly changes the logic in the Github
fetch_repo
logic to set thestatus
property every time instead of just if the repository was found to be archived. This will allow Libraries to reset the Repository status if something is unarchived. I also moved some status setting logic out of theReadme
class and moved it intoRepository
to make it more visible. I've tested the updated logic locally for the use cases I know about, but let me know if something looks off in here as I've had several different versions of refactors going at the same time.I think there is a much larger refactor needed to separate out the update logic between the RepositoryHost class and the Repository class that I am aiming to tackle in the next few days, so I expect that logic to move somewhere else into a discrete method/class responsible for setting statuses correctly based on upstream repository data.