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

Move asset publishing to publish service #1399

Merged
merged 5 commits into from
Dec 16, 2022

Conversation

mvandenburgh
Copy link
Member

Moves asset publishing from a model method into a dedicated service layer function within the publish service.

@mvandenburgh mvandenburgh force-pushed the move-asset-publishing-to-service-layer branch from ac1065e to 2e3df10 Compare December 10, 2022 01:03
@mvandenburgh mvandenburgh marked this pull request as draft December 10, 2022 01:08
@mvandenburgh mvandenburgh force-pushed the move-asset-publishing-to-service-layer branch 2 times, most recently from fc7973b to ef8ad8a Compare December 12, 2022 19:21
@mvandenburgh mvandenburgh marked this pull request as ready for review December 13, 2022 16:17
@mvandenburgh mvandenburgh force-pushed the move-asset-publishing-to-service-layer branch from e1604b9 to d7267be Compare December 13, 2022 16:19
Moves asset publishing into a dedicated service layer function within
the publish service, instead of a model method.
For some reason, we have a test that tries to publish an already
published asset. Due to the new checks added in the publish asset
service function, this test now fails.
`publish_asset` asserts that an asset is valid. Since we weren't doing
that before, several tests started failing and needed to be updated to
only attempt to publish VALID assets
Assets must exist in the DB before being published.
It seems the new call to `asset.refresh_from_db` is causing the blob id
to be converted to a `UUID` object.
Copy link
Member

@jjnesbitt jjnesbitt left a comment

Choose a reason for hiding this comment

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

LGTM. My only concern was changing the publish operation from non-saving to saving, but it seems that the non-saving behavior wasn't used anywhere in the code.

@mvandenburgh mvandenburgh added the internal Changes only affect the internal API label Dec 16, 2022
@mvandenburgh mvandenburgh merged commit 679a0ab into master Dec 16, 2022
@mvandenburgh mvandenburgh deleted the move-asset-publishing-to-service-layer branch December 16, 2022 20:16
@dandibot
Copy link
Member

🚀 PR was released in v0.3.8 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Changes only affect the internal API released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants