Skip to content

Conversation

@Julusian
Copy link
Member

About the Contributor

This pull request is posted on behalf of the BBC

Type of Contribution

This is a: Feature

New Behavior

This is a half-feature, that doesn't make much sense on its own, but is a pretty isolated chunk of a larger feature.

This half-feature allows the timeline/playout-gateway to trigger a callback to regenerate the timeline. This is done with the same callback flow as we use for partinstances/pieceinstances, which has been expanded to use a new trigger type.

It uses a token which changes upon each generation of the timeline to minimise the risk of getting stuck in a regeneration loop where sofie and playout-gateway disagree about the current state/timeline.

The timeline generation logic does not currently create this object, but the flow is in place for it to define a regenerateTimelineAt value, which will cause the object to be created and timeline to be regenerated at that point in time. You can see this in action by forcing that value in the code to something like getCurrentTime() + 10000, and observe the timeline be regenerated every 10s.

Our intention with this is to allow us to avoid putting certain pieces on the timeline until close to the time they are played, rather than them being on the timeline for the around an hour before they get played. By avoiding putting them on the timeline, we avoid these pieces taking part in AB resolving and lookahead.

Originally I was considering doing this by keeping some timer inside the job-worker to run the regeneration, but thought this better matched how things currently work. It would have been fine and not too messy to do inside the job-worker though.

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

Time Frame

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@Julusian Julusian requested a review from a team as a code owner February 12, 2025 14:03
@codecov
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 78.57143% with 24 lines in your changes missing coverage. Please review.

Project coverage is 56.77%. Comparing base (4d991aa) to head (ad450c3).
Report is 17 commits behind head on release53.

Files with missing lines Patch % Lines
...ckages/job-worker/src/playout/timeline/generate.ts 61.29% 24 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           release53    #1384      +/-   ##
=============================================
+ Coverage      56.68%   56.77%   +0.09%     
=============================================
  Files            397      399       +2     
  Lines          72391    72600     +209     
  Branches        4391     4004     -387     
=============================================
+ Hits           41032    41219     +187     
- Misses         31253    31254       +1     
- Partials         106      127      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nytamin nytamin added Contribution External contribution Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) labels Feb 14, 2025
@Julusian Julusian force-pushed the upstream/timeline-trigger-regeneration branch from de5184e to ad450c3 Compare March 13, 2025 15:05
@Julusian Julusian mentioned this pull request Mar 13, 2025
7 tasks
Co-authored-by: Jan Starzak <jan.starzak@gmail.com>
@jstarpl jstarpl merged commit 465adfb into Sofie-Automation:release53 Mar 21, 2025
@Julusian Julusian deleted the upstream/timeline-trigger-regeneration branch January 19, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) Contribution External contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants