Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Deactivate closed Kitsu projects on OP #4619

Merged

Conversation

friquette
Copy link
Contributor

Changelog Description

Deactivate project on OP when the project is closed on Kitsu.

@iLLiCiTiT
Copy link
Member

iLLiCiTiT commented Mar 14, 2023

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 gazu.cache.clear_all() called before sync? Maybe it already happens I'm not familiar with the implementation.

@tokejepsen tokejepsen added type: enhancement Enhancements to existing functionality module: Kitsu Kitsu integration community contribution labels Mar 14, 2023
@friquette friquette force-pushed the 181-wizz_closed-projetcs-on-kitsu branch from 2c4a297 to a31af10 Compare March 28, 2023 14:16
@iLLiCiTiT iLLiCiTiT requested a review from Tilix4 March 29, 2023 09:30
@iLLiCiTiT
Copy link
Member

@Tilix4 could you take a look? Thank you :)

Copy link
Collaborator

@Tilix4 Tilix4 left a 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

openpype/modules/kitsu/utils/update_op_with_zou.py Outdated Show resolved Hide resolved
openpype/modules/kitsu/utils/update_op_with_zou.py Outdated Show resolved Hide resolved
@ynbot ynbot added the size/XS Denotes a PR changes 0-99 lines, ignoring general files label Mar 30, 2023
Tilix4
Tilix4 previously approved these changes Mar 30, 2023
Copy link
Collaborator

@Tilix4 Tilix4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@iLLiCiTiT iLLiCiTiT requested review from Tilix4 and BigRoy March 31, 2023 09:23
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
iLLiCiTiT
iLLiCiTiT previously approved these changes Mar 31, 2023
BigRoy
BigRoy previously approved these changes Mar 31, 2023
Copy link
Collaborator

@BigRoy BigRoy left a 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. :)

@iLLiCiTiT
Copy link
Member

Please update the branch
image

Copy link
Collaborator

@Tilix4 Tilix4 left a 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.

@friquette friquette dismissed stale reviews from BigRoy and iLLiCiTiT via 654ea05 April 3, 2023 09:13
@iLLiCiTiT
Copy link
Member

Please update the branch image

Branch still have conflicts to resolve

Copy link
Collaborator

@BigRoy BigRoy left a 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!

@iLLiCiTiT iLLiCiTiT merged commit 34528b6 into ynput:develop Apr 3, 2023
@ynbot ynbot added this to the next-patch milestone Apr 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community contribution module: Kitsu Kitsu integration size/XS Denotes a PR changes 0-99 lines, ignoring general files type: enhancement Enhancements to existing functionality
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants