nrkno / sofie-core

Sofie Core: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
124 stars 40 forks source link

fix: check if segment should be immediately regenerated during ingest SOFIE-2887 #1143

Closed Julusian closed 4 months ago

Julusian commented 5 months ago

About the Contributor

This pull request is posted on behalf of the NRK.

Type of Contribution

This is a: Bug fix / Feature

New Behavior

Blueprints can mark ExpectedPackages as ones they are listening to. When PackageInfos are updated which belong to these packages, sofie will re-run the ingest for those segments automatically.

During ingest, after calling getSegment, if any packages returned were not known of before the getSegment call, then we check if the listening behaviour should be triggered immediately.
It now performs a quick check to see if there are any PackageInfos which would have been returned to the blueprints when they asked, and if so it will re-run getSegment with a fresh copy of the PackageInfos

This is to catch cases where the blueprints define a dependency on a 'new' expectedPackage A, which already exists in the database so can be immediately fulfilled.

Testing Instructions

Other Information

This is best reviewed a commit at a time, some large refactoring of the changed code was performed prior to any functional changes, to allow the change to be made more easily.

Status

codecov[bot] commented 5 months ago

Codecov Report

Attention: 194 lines in your changes are missing coverage. Please review.

Comparison is base (3ad0c73) 57.74% compared to head (4e3a359) 58.04%. Report is 53 commits behind head on release51.

Files Patch % Lines
meteor/server/migration/1_50_0.ts 28.91% 59 Missing :warning:
...ackages/job-worker/src/ingest/generationSegment.ts 90.66% 30 Missing and 1 partial :warning:
...ations/packageManager/expectedPackages/generate.ts 0.00% 29 Missing :warning:
...job-worker/src/blueprints/context/OnTakeContext.ts 82.66% 26 Missing :warning:
...text/services/PartAndPieceInstanceActionService.ts 97.78% 12 Missing :warning:
...b-worker/src/blueprints/context/watchedPackages.ts 76.92% 9 Missing :warning:
meteor/server/publications/rundown.ts 0.00% 7 Missing :warning:
...ns/pieceContentStatusUI/rundown/regenerateItems.ts 0.00% 5 Missing :warning:
...s/server-core-integration/src/lib/subscriptions.ts 16.66% 5 Missing :warning:
...orker/src/blueprints/context/OnSetAsNextContext.ts 96.61% 4 Missing :warning:
... and 4 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## release51 #1143 +/- ## ============================================= + Coverage 57.74% 58.04% +0.30% ============================================= Files 512 517 +5 Lines 82571 83403 +832 Branches 4307 4368 +61 ============================================= + Hits 47679 48410 +731 - Misses 34841 34940 +99 - Partials 51 53 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.