-
Notifications
You must be signed in to change notification settings - Fork 129
Deactivate closed Kitsu projects on OP #4619
Deactivate closed Kitsu projects on OP #4619
Conversation
Expanding this #4619 (comment) . So this would not work? closed_status_id = None
for status in gazu.project.all_project_status():
if status["name"].lower() == "closed":
closed_status_id = status["id"]
project_is_active = project["project_status_id"] != closed_status_id If not, why we just don't look if the project is is opened projects instead of calculating "closed projects"? all_kitsu_open_projects_names = {
project['name'] for project in gazu.project.all_open_projects()
}
project_is_active = project_name in all_kitsu_open_projects_names EDITED: Could the update state be caused because of cache? So there should be |
2c4a297
to
a31af10
Compare
@Tilix4 could you take a look? Thank you :) |
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.
Two small suggestions, otherwise LGTM
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!
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
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.
Haven't tested the code but changes look good to me.
Only optimization I see if that we could potentially query the gazu.project.all_project_status()
only once and pass it to sync_project_from_kitsu
instead of querying it per project. But I assume it's not a performance issue currently for anyone so I suppose it's fine for everyone. :)
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.
With all this contributions, it gets very clean and straight forward, nice job!
One actual request lest and one suggestion for better understanding.
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.
Haven't tested the code, but changes look good to me. Great work!
Changelog Description
Deactivate project on OP when the project is closed on Kitsu.