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

feat: rework CacheForPlayout as structured objects SOFIE-2663 SOFIE-2513 #1035

Merged
merged 8 commits into from
Oct 24, 2023

Conversation

Julusian
Copy link
Member

@Julusian Julusian commented Sep 27, 2023

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

code improvement

  • What is the current behavior? (You can also link to an open issue here)

The current CacheForPlayout is based around providing a mongo-like interface. This made it easy to introduce many releases back when we first added the caches.

  • What is the new behavior (if this is a feature change)?

This reworks the cache to be a structure of objects, with various methods exposed for mutation.
This collects the various mutations that the code can do during playout into a set of classes. This will make it easier to test the code, and should aid developers in understanding the code.

  • Other information:

This is inspired by the rewrite TV2DK are doing, but keeping the scope a lot smaller and more incremental.

This PR does not aim to give a perfect implementation of anything, but to be a bulky refactor which gets the general structure in place. It is intended that other portions of the code which call this model to be refactored/tidied up later on.

In the future I expect:

  • The method naming and scope on the model will be refined
  • Unit tests will be added
  • any loose mongo calls will be moved to be done via the model
  • the pattern will be replicated for ingest, with an IngestModel

Status

  • Code documentation for the relevant parts in the code have been added/updated by the PR author
  • The functionality has been tested by the PR author
  • The functionality has been tested by NRK

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

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

Comparison is base (bcfeb99) 58.05% compared to head (cbc551a) 58.20%.
Report is 99 commits behind head on release51.

Additional details and impacted files
@@              Coverage Diff              @@
##           release51    #1035      +/-   ##
=============================================
+ Coverage      58.05%   58.20%   +0.15%     
=============================================
  Files            485      507      +22     
  Lines          78987    81414    +2427     
  Branches        4130     4279     +149     
=============================================
+ Hits           45855    47391    +1536     
- Misses         33077    33965     +888     
- Partials          55       58       +3     
Files Coverage Δ
meteor/client/lib/data/util/object-to-xml.ts 82.35% <100.00%> (-11.77%) ⬇️
meteor/lib/Rundown.ts 81.28% <100.00%> (ø)
meteor/lib/api/client.ts 100.00% <100.00%> (ø)
meteor/lib/api/methods.ts 87.85% <100.00%> (ø)
meteor/lib/api/migration.ts 100.00% <100.00%> (ø)
meteor/lib/api/pieceContentStatus.ts 0.00% <ø> (ø)
meteor/lib/api/pubsub.ts 95.85% <100.00%> (+0.06%) ⬆️
meteor/lib/api/userActions.ts 100.00% <100.00%> (ø)
meteor/lib/lib.ts 77.04% <100.00%> (-0.98%) ⬇️
meteor/lib/logging.ts 84.90% <100.00%> (ø)
... and 87 more

... and 62 files with indirect coverage changes

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

@Julusian Julusian force-pushed the feat/rework-caches-to-structured-objects branch from f4e7999 to bace121 Compare September 27, 2023 13:07
@Julusian Julusian force-pushed the feat/rework-caches-to-structured-objects branch 2 times, most recently from f06cb4d to 023756c Compare October 6, 2023 13:47
@Julusian Julusian force-pushed the feat/rework-caches-to-structured-objects branch from 023756c to 2b032f3 Compare October 10, 2023 14:06
@Julusian Julusian force-pushed the feat/rework-caches-to-structured-objects branch from 431408e to aeb001a Compare October 18, 2023 15:18
@Julusian Julusian marked this pull request as ready for review October 20, 2023 12:35
@Julusian Julusian force-pushed the feat/rework-caches-to-structured-objects branch from fc0470f to cbc551a Compare October 24, 2023 10:02
@Julusian Julusian merged commit 0f76332 into release51 Oct 24, 2023
64 checks passed
@Julusian Julusian deleted the feat/rework-caches-to-structured-objects branch October 24, 2023 10:13
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.

None yet

1 participant