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

vod: New webhooks & simplified asset responses #1154

Merged
merged 14 commits into from
Aug 15, 2022

Conversation

gioelecerati
Copy link
Member

@gioelecerati gioelecerati commented Jul 13, 2022

What does this pull request do? Explain your changes. (required)

Rename the task.created webhook to task.spawned, simplify the asset responses

Specific updates (required)

  • Generating a signed url now responds only the ID of the task instead of the full task object
  • The /api/asset endpoint returns the asset object without the videoSpec field
  • The same endpoint returns the videoSpec if details=true is passed.
  • task.created -> task.spawned webhook. createTask -> spawnTask in TaskScheduler
  • Implement webhooks as Simpler webhooks for VOD #1148
  • Integrate docs: fixed the response spec of the asset upload #1136
  • Change the docs accordingly to the new responses, webhooks and request params

How did you test each of these updates (required)

yarn test

Does this pull request close any open issues?

Fixes #1148
Fixes #1149

Screenshots (optional):

Checklist:

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@gioelecerati gioelecerati requested a review from a team as a code owner July 13, 2022 12:38
@vercel
Copy link

vercel bot commented Jul 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
livepeer-studio ✅ Ready (Inspect) Visit Preview Aug 15, 2022 at 4:44PM (UTC)

@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #1154 (a7aa7cc) into master (17134a1) will decrease coverage by 0.06312%.
The diff coverage is 44.82759%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #1154         +/-   ##
===================================================
- Coverage   51.47778%   51.41466%   -0.06313%     
===================================================
  Files             66          66                 
  Lines           4297        4312         +15     
  Branches         767         771          +4     
===================================================
+ Hits            2212        2217          +5     
- Misses          1816        1823          +7     
- Partials         269         272          +3     
Impacted Files Coverage Δ
packages/api/src/store/queue.ts 78.18182% <ø> (ø)
packages/api/src/controllers/asset.ts 55.19481% <41.66667%> (-0.25074%) ⬇️
packages/api/src/task/scheduler.ts 46.60194% <47.05882%> (-1.78516%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17134a1...a7aa7cc. Read the comment docs.

Impacted Files Coverage Δ
packages/api/src/store/queue.ts 78.18182% <ø> (ø)
packages/api/src/controllers/asset.ts 55.19481% <41.66667%> (-0.25074%) ⬇️
packages/api/src/task/scheduler.ts 46.60194% <47.05882%> (-1.78516%) ⬇️

Copy link
Member

@victorges victorges left a comment

Choose a reason for hiding this comment

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

LGTM with a few changes, but most are nits (which are always optional)

packages/api/src/controllers/asset.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/asset.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/asset.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/asset.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/helpers.ts Outdated Show resolved Hide resolved
packages/api/src/task/scheduler.ts Outdated Show resolved Hide resolved
packages/www/docs/api-reference/vod/upload.mdx Outdated Show resolved Hide resolved
packages/www/docs/guides/start-live-streaming/webhook.mdx Outdated Show resolved Hide resolved
packages/www/docs/guides/upload-a-video/index.mdx Outdated Show resolved Hide resolved
packages/www/docs/guides/upload-a-video/index.mdx Outdated Show resolved Hide resolved
packages/www/docs/api-reference/vod/list.mdx Outdated Show resolved Hide resolved
packages/www/docs/api-reference/vod/upload.mdx Outdated Show resolved Hide resolved
packages/www/docs/guides/start-live-streaming/webhook.mdx Outdated Show resolved Hide resolved
packages/www/docs/guides/upload-a-video/index.mdx Outdated Show resolved Hide resolved
Copy link
Member

@victorges victorges left a comment

Choose a reason for hiding this comment

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

Some required, functional, changes are still pending.
Please fix and let me know for a new review.

packages/api/src/task/scheduler.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/asset.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/asset.ts Outdated Show resolved Hide resolved
packages/api/src/controllers/helpers.ts Outdated Show resolved Hide resolved
packages/api/src/schema/schema.yaml Show resolved Hide resolved
packages/api/src/task/scheduler.ts Outdated Show resolved Hide resolved
packages/www/docs/api-reference/vod/list.mdx Outdated Show resolved Hide resolved
Copy link
Member

@victorges victorges left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

packages/api/src/controllers/asset.ts Outdated Show resolved Hide resolved
packages/api/src/task/scheduler.ts Outdated Show resolved Hide resolved
@victorges
Copy link
Member

lets merge this

@victorges
Copy link
Member

victorges commented Aug 8, 2022

@gioelecerati after merging some stuff to master that added conflicts on this, I've just rebased this one to master myself. Included 2 changes apart from that:

  • Fixed a regression that was calling db.asset.delete instead of markDeleted: bc56864#diff-72488d88e2bc58582e64d3c8e8283bcfb59c422a35fcf476d51a2e1da9e41716R305
  • Improve the mung middleware changes (I had refactored it in another PR so there was a much clearer integration path there). Also made details automatically true for admins 😎 47738a9
  • Also a fix on the updateAsset func as it would always send a webhook for "ready" or "failed" assets. It should only do so when there is actually a change in the phase: a7aa7cc

Copy link
Member

@victorges victorges left a comment

Choose a reason for hiding this comment

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

LGTM! Let's launch this

@victorges
Copy link
Member

👀

@victorges victorges merged commit ae8791b into master Aug 15, 2022
@victorges victorges deleted the gio/vod/simplify-responses branch August 15, 2022 16:36
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.

Simplify VOD API responses Simpler webhooks for VOD
3 participants