Skip to content

Conversation

@antgonza
Copy link
Member

@antgonza antgonza commented Apr 2, 2020

The issue comes from studies/artifacts that became public before we had more stringent metadata requirements and when a new artifact (new reprocessing) is added the new artifact will not comply with them and the artifact will not be created. The easiest solution is to simply skip the validation step for when a new artifact is created.

All tests passed. So ready for review.

@antgonza antgonza requested a review from wasade April 2, 2020 17:31
@antgonza antgonza changed the title WIP: fix parent cp visibility error fix parent cp visibility error Apr 15, 2020
# set based on the "lowest" visibility
if 'sandbox' in visibilities:
instance.visibility = 'sandbox'
instance._set_visibility('sandbox')
Copy link
Contributor

Choose a reason for hiding this comment

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

is this change necessary? it looks like instance.visibility is a property where the setter calls _set_visibility

Copy link
Member Author

Choose a reason for hiding this comment

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

Some background: when an artifact is created, it will "copy" the parents visibility; however, right now the visibility "regular" setter (visibility) has a validation step that prevents this from happening. Thus, the "solution" is that for creation we use the new setter (_set_visibility) without validation and when we do whatever else we use the regular one, which has the validation ... AKA special case for artifact creation

@antgonza antgonza mentioned this pull request Apr 28, 2020
2 tasks
Copy link
Contributor

@ElDeveloper ElDeveloper left a comment

Choose a reason for hiding this comment

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

Changes look good. However if I am understanding correctly, _set_visibility is a privileged and private method that bypasses validation for artifacts that inherit a "public" status but are no longer valid (such is life). The only place where this new method is called is during creation, are we sure that all artifacts can be safely created without any additional validation? My concern is that all artifact creations are no longer going to be validated. Maybe this should only happen when the inherited visibility is "public"?

The alternative would be to require users to make their metadata compliant before they can create new artifacts.

@antgonza
Copy link
Member Author

Good point, I'll change so we only use _set_visibility for public ... yeah, that was the idea too but one of the main culprits is AGP and fixing will not happen any time soon ...

@ElDeveloper ElDeveloper merged commit 3f3cf52 into qiita-spots:dev Apr 29, 2020
@ElDeveloper
Copy link
Contributor

Thanks @antgonza!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants