Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General: Filter representations before integration start #3398

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jun 23, 2022

Brief description

Representations filtering in IntegrateAssetNew happens as first step.

Description

Representations were validated after subset and version creation and is not handled case when instance contains only representations that should not be integrated. Integration still fails if instance don't have any representations, but won't crash if none of those representations should not be integrated. Reset of "transfers" key on instance was moved to end of representations loop instead of at the start -> make sure that transfers end up with same values after each representation process.

Testing notes:

Related to testing notes in PR

  1. Publish instance which does not integrate any representation (e.g. review instance with only review representation)
  2. IntegrateAssetNew should not crash

published_representations = {}
for idx, repre in enumerate(instance.data["representations"]):
for idx, repre in enumerate(repres):
Copy link

Choose a reason for hiding this comment

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

Loop control variable 'idx' not used within the loop body. If this is intended, start the name with an underscore.

@@ -158,7 +192,7 @@ def process(self, instance):
self.handle_destination_files(self.integrated_file_sizes, 'remove')
six.reraise(*sys.exc_info())

def register(self, instance):
def register(self, instance, repres):
Copy link

Choose a reason for hiding this comment

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

'IntegrateAssetNew.register' is too complex (52)

@iLLiCiTiT iLLiCiTiT self-assigned this Jun 23, 2022
@iLLiCiTiT iLLiCiTiT added the type: bug Something isn't working label Jun 23, 2022
@iLLiCiTiT iLLiCiTiT merged commit 2b19e6c into bugfix/stpublisher-editorial-hierarchy Jun 23, 2022
@iLLiCiTiT iLLiCiTiT deleted the bugfix/filter_representations_before_integration_start branch June 23, 2022 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants