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: add onTake and onSetAsNext blueprint callbacks SOFIE-2897 SOFIE-2808 #1117

Merged
merged 9 commits into from
Jan 23, 2024

Conversation

ianshade
Copy link
Contributor

@ianshade ianshade commented Jan 12, 2024

About the Contributor

This pull request is posted on behalf of the BBC.

Type of Contribution

This is a:

Feature (addition to the Blueprints API)

Current Behavior

As described in the RFC #1013 and its subsequent comments, it is currently not possible to modify Parts and their Pieces while a Take is being performed or while a part is being set as Next.

New Behavior

Two new optional blueprint callbacks are added to the ShowStyleBlueprintManifest:

  • onTake - Called during a Take action. Allows for Part (Instances) modification or aborting the take.
  • onSetAsNext - Called when a part is set as Next, including right after a Take. Allows for Part (Instances) modification.

Testing Instructions

Implement the onTake and onSetAsNext callbacks in ShowStyleBlueprintManifest of the blueprints and verify that methods of the contexts passed to those callbacks are acting as documented.
This feature shares some code with Adlib Actions. Since the logic behind IActionExecutionContext was refactored for reuse in this feature, Adlib Action execution needs to be tested for regressions as well.

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.

Copy link

codecov bot commented Jan 12, 2024

Codecov Report

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

Comparison is base (3ad0c73) 57.74% compared to head (43e0835) 57.94%.
Report is 24 commits behind head on release51.

Files Patch % Lines
meteor/server/migration/1_50_0.ts 28.91% 59 Missing ⚠️
...ations/packageManager/expectedPackages/generate.ts 0.00% 29 Missing ⚠️
...job-worker/src/blueprints/context/OnTakeContext.ts 82.66% 26 Missing ⚠️
...text/services/PartAndPieceInstanceActionService.ts 97.78% 12 Missing ⚠️
...ns/pieceContentStatusUI/rundown/regenerateItems.ts 0.00% 5 Missing ⚠️
...s/server-core-integration/src/lib/subscriptions.ts 16.66% 5 Missing ⚠️
...orker/src/blueprints/context/OnSetAsNextContext.ts 96.61% 4 Missing ⚠️
.../job-worker/src/blueprints/context/adlibActions.ts 95.34% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           release51    #1117      +/-   ##
=============================================
+ Coverage      57.74%   57.94%   +0.20%     
=============================================
  Files            512      517       +5     
  Lines          82571    83159     +588     
  Branches        4307     4351      +44     
=============================================
+ Hits           47679    48188     +509     
- Misses         34841    34917      +76     
- Partials          51       54       +3     

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

@jstarpl jstarpl added the Contribution from BBC Contributions sponsored by BBC (bbc.co.uk) label Jan 12, 2024
@Julusian Julusian changed the title feat: add onTake and onSetAsNext blueprint callbacks feat: add onTake and onSetAsNext blueprint callbacks SOFIE-2897 SOFIE-2808 Jan 15, 2024
@ianshade
Copy link
Contributor Author

@Julusian the comments were addressed, and merge conflicts resolved

@Julusian Julusian merged commit 0bd621c into nrkno:release51 Jan 23, 2024
34 of 35 checks passed
@PeterC89 PeterC89 deleted the feat/customTakeLogic branch September 27, 2024 15:36
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants