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

Fix: Locally copied version of last published workfile is not incremented #4722

Merged
merged 44 commits into from
May 2, 2023

Conversation

kalisp
Copy link
Member

@kalisp kalisp commented Mar 27, 2023

Fix 1

When copied, the local workfile version keeps the published version number, when it must be +1 to follow OP's naming convention.

Fix 2

Local workfile version's name is built from anatomy. This avoids to get workfiles with their publish template naming.

Fix 3

In the case a subset has at least two tasks with published workfiles, for example Modeling and Rigging, launching Rigging was getting the first one with the next and trying to find representations, therefore workfileModeling and trying to match the current task_name (Rigging) with the representation["context"]["task"]["name"] of a Modeling representation, which was ending up to a workfile_representation to None, and exiting the process.

Trying to find the task_name in the subset['name'] fixes it.

Fix 4

Fetch input dependencies of workfile.

Replacing #4102 for changes to bring this home.

Tilix4 and others added 26 commits March 15, 2023 09:16
* Enhancement: copy last published workfile as reusable methods (WiP)

* Added get_host_extensions method, added subset_id and las_version_doc access, added optional arguments to get_last_published_workfile

* Plugged in the new methods + minor changes

* Added docstrings, last workfile optional argument, and removed unused code

* Using new implementation to get local workfile path. Warning: It adds an extra dot to the extension which I need to fix

* Refactoring and fixed double dots

* Added match subset_id and get representation method, plus clan up

* Removed unused vars

* Fixed some rebasing errors

* delinted unchanged code and renamed get_representation into get_representation_with_task

* This time it's really delinted, I hope...

* Update openpype/modules/sync_server/sync_server.py

reprenation isn't the right spelling (:

Co-authored-by: Félix David <felixg.david@gmail.com>

* Changes based on reviews

* Fixed non imperative docstring and missing space

* Fixed another non imperative docstring

* Update openpype/modules/sync_server/sync_server.py

Fixed typo

Co-authored-by: Félix David <felixg.david@gmail.com>

Co-authored-by: Hayley GUILLOT <hayleyguillot@outlook.com>
Co-authored-by: Félix David <felixg.david@gmail.com>
* Fix: Local workfile overwrite when local version number is higher than published workfile version number (WiP)

* Changed regex search, clean up

* Readded mistakenly removed newline
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
@kalisp kalisp requested a review from Tilix4 March 27, 2023 16:14
@kalisp kalisp self-assigned this Mar 27, 2023
@kalisp kalisp marked this pull request as draft March 27, 2023 16:20
@kalisp kalisp requested review from Tilix4 and iLLiCiTiT April 3, 2023 09:12
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, only one suggestion for markdown doc.

website/docs/module_site_sync.md Outdated Show resolved Hide resolved
@iLLiCiTiT
Copy link
Member

The prelaunch hook does not handle cases when there are no profiles in settings, or when filter_profiles does return None -> BTW I think that profiles should be empty to be skipped by default.

@Tilix4
Copy link
Collaborator

Tilix4 commented Apr 11, 2023

Found a bug: If you delete all versions of a workfile subset for an asset and try to launch it after, it tries to find the last published workfile (which has been deleted) and hangs forever. It should not try to fetch it and open a new empty file.

@kalisp
Copy link
Member Author

kalisp commented Apr 13, 2023

Fixed issue with no profiles returned.

@kalisp
Copy link
Member Author

kalisp commented Apr 13, 2023

Found a bug: If you delete all versions of a workfile subset for an asset and try to launch it after, it tries to find the last published workfile (which has been deleted) and hangs forever. It should not try to fetch it and open a new empty file.

How should I replicate that? I tried to open DCC on new empty task, works.
I tried to delete all published workfiles for particular tasks and open again, works.

@BigRoy
Copy link
Collaborator

BigRoy commented Apr 13, 2023

I tried to delete all published workfiles for particular tasks and open again, works.

How did you delete it? Did you use the loader action from the standalone loader? (OP tray > Loader) Because maybe @Tilix4 did use that which I believe 'archives' certain publishes instead of actually removing them from the database?

@Tilix4
Copy link
Collaborator

Tilix4 commented Apr 13, 2023

I tried to delete all published workfiles for particular tasks and open again, works.

How did you delete it? Did you use the loader action from the standalone loader? (OP tray > Loader) Because maybe @Tilix4 did use that which I believe 'archives' certain publishes instead of actually removing them from the database?

Indeed that's what I did. That was my guess too.

@kalisp
Copy link
Member Author

kalisp commented Apr 13, 2023

Yeah, I used Delete version action in Loader.

@Tilix4
Copy link
Collaborator

Tilix4 commented Apr 13, 2023

Yeah, I used Delete version action in Loader.

The Delete Old Versions one?

@kalisp
Copy link
Member Author

kalisp commented Apr 13, 2023

Yeah, thats the one. I deleted all versions of "rigging" task for Visitor and then opened Blender without issue.
python_l3RODrvLzu

kalisp and others added 2 commits April 17, 2023 11:01
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
@kalisp kalisp requested a review from iLLiCiTiT April 17, 2023 16:23
@Tilix4
Copy link
Collaborator

Tilix4 commented Apr 20, 2023

Yeah, thats the one. I deleted all versions of "rigging" task for Visitor and then opened Blender without issue. python_l3RODrvLzu

I had this issue by publishing several versions on the same subset and deleting them. It failed until I published the same amount again and them went fine.

That being said, don't block the PR for this as it is not a very frequent use case. We could deal with it later.

@kalisp kalisp merged commit fec104d into develop May 2, 2023
@kalisp kalisp deleted the fx_auto_dl_workfile_version_up branch May 2, 2023 16:49
@ynbot ynbot added this to the next-patch milestone May 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
module: Sitesync size/M Denotes a PR changes 500-999 lines, ignoring general files type: bug Something isn't working type: documentation
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants