Skip to content

Commit 6b36d5b

Browse files
authored
Merge branch 'release52' into upstream/interlaced-fix
2 parents 3b4cdda + fcd04da commit 6b36d5b

File tree

262 files changed

+7362
-1740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+7362
-1740
lines changed

.github/workflows/audit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: |
3030
yarn
3131
cd meteor
32-
meteor yarn validate:prod-dependencies
32+
meteor npm run validate:prod-dependencies
3333
env:
3434
CI: true
3535

@@ -57,7 +57,7 @@ jobs:
5757
run: |
5858
yarn
5959
cd meteor
60-
meteor yarn run validate:all-dependencies
60+
meteor npm run validate:all-dependencies
6161
env:
6262
CI: true
6363

.github/workflows/node.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
# setup zodern:types. No linters are setup, so this simply installs the packages
4747
meteor lint
4848
49-
meteor yarn ci:lint
49+
meteor npm run ci:lint
5050
env:
5151
CI: true
5252

@@ -85,12 +85,12 @@ jobs:
8585
# setup zodern:types. No linters are setup, so this simply installs the packages
8686
meteor lint
8787
88-
NODE_OPTIONS="--max-old-space-size=6144" meteor yarn unitci --force-exit
88+
NODE_OPTIONS="--max-old-space-size=6144" meteor npm run unitci --force-exit
8989
env:
9090
CI: true
9191
- name: Send coverage
9292
if: ((github.event_name == 'pull_request') && (!startsWith(github.head_ref, 'release'))) || ((github.event_name == 'push') && (!startsWith(github.ref_name, 'release')))
93-
uses: codecov/codecov-action@v4
93+
uses: codecov/codecov-action@v5
9494
env:
9595
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
9696

@@ -246,7 +246,7 @@ jobs:
246246
echo "image=$image" >> $GITHUB_OUTPUT
247247
- name: Trivy scanning
248248
if: steps.check-build-and-push.outputs.enable == 'true' && steps.check-ghcr.outputs.enable == 'true' && steps.ghcr-tag.outputs.tags != 0
249-
uses: aquasecurity/trivy-action@0.24.0
249+
uses: aquasecurity/trivy-action@0.29.0
250250
env:
251251
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
252252
with:
@@ -397,7 +397,7 @@ jobs:
397397
echo "image=$image" >> $GITHUB_OUTPUT
398398
- name: Trivy scanning
399399
if: steps.check-build-and-push.outputs.enable == 'true' && steps.check-ghcr.outputs.enable == 'true' && steps.ghcr-tag.outputs.tags != 0
400-
uses: aquasecurity/trivy-action@0.24.0
400+
uses: aquasecurity/trivy-action@0.29.0
401401
env:
402402
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
403403
with:

.github/workflows/trivy.yml

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Scheduled Trivy Scan
22
on:
33
workflow_dispatch:
44
schedule:
5-
- cron: '0 10 * * 1'
5+
- cron: "0 10 * * 1"
66

77
jobs:
88
trivy:
@@ -17,21 +17,21 @@ jobs:
1717

1818
steps:
1919
- name: Run Trivy vulnerability scanner (json)
20-
uses: aquasecurity/trivy-action@0.24.0
20+
uses: aquasecurity/trivy-action@0.29.0
2121
env:
2222
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
2323
with:
2424
image-ref: ghcr.io/nrkno/sofie-core-${{ matrix.image }}:latest
2525
format: json
26-
output: '${{ matrix.image }}-trivy-scan-results.json'
26+
output: "${{ matrix.image }}-trivy-scan-results.json"
2727

2828
- name: Run Trivy vulnerability scanner (table)
29-
uses: aquasecurity/trivy-action@0.24.0
29+
uses: aquasecurity/trivy-action@0.29.0
3030
env:
3131
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
3232
with:
3333
image-ref: ghcr.io/nrkno/sofie-core-${{ matrix.image }}:latest
34-
output: '${{ matrix.image }}-trivy-scan-results.txt'
34+
output: "${{ matrix.image }}-trivy-scan-results.txt"
3535

3636
- name: Post all scan results to Github Summary as a table
3737
env:
@@ -44,12 +44,12 @@ jobs:
4444
echo $CODE_BLOCK >> $GITHUB_STEP_SUMMARY
4545
4646
- name: Run Trivy in GitHub SBOM mode and submit results to Dependency Graph
47-
uses: aquasecurity/trivy-action@0.24.0
47+
uses: aquasecurity/trivy-action@0.29.0
4848
env:
4949
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
5050
with:
51-
format: 'github'
52-
output: 'dependency-results-${{ matrix.image }}.sbom.json'
51+
format: "github"
52+
output: "dependency-results-${{ matrix.image }}.sbom.json"
5353
image-ref: ghcr.io/nrkno/sofie-core-${{ matrix.image }}:latest
5454
github-pat: ${{ secrets.GITHUB_TOKEN }}
5555

@@ -64,46 +64,31 @@ jobs:
6464
echo ${{ env.SUMMARY }}
6565
6666
- name: Send Slack Notification
67-
uses: slackapi/slack-github-action@v1.27.0
67+
uses: slackapi/slack-github-action@v2.0.0
6868
with:
69+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
70+
webhook-type: incoming-webhook
6971
payload: |
70-
{
71-
"text": "Trivy scan results",
72-
"blocks": [
73-
{
74-
"type": "header",
75-
"text": {
76-
"type": "plain_text",
77-
"text": "Trivy scan results for sofie-core-${{ matrix.image }}:latest"
78-
}
79-
},
80-
{
81-
"type": "section",
82-
"text": {
83-
"type": "mrkdwn",
84-
"text": ":thisisfine: ${{ env.SUMMARY }}"
85-
}
86-
},
87-
{
88-
"type": "section",
89-
"text": {
90-
"type": "mrkdwn",
91-
"text": "Read the full scan results on Github"
92-
},
93-
"accessory": {
94-
"type": "button",
95-
"text": {
96-
"type": "plain_text",
97-
"text": ":github: Scan results",
98-
"emoji": true
99-
},
100-
"value": "workflow_run",
101-
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
102-
"action_id": "button-action"
103-
}
104-
}
105-
]
106-
}
107-
env:
108-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
109-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
72+
text: "Trivy scan results"
73+
blocks:
74+
- type: "header"
75+
text:
76+
type: "plain_text"
77+
text: "Trivy scan results for sofie-core-${{ matrix.image }}:latest"
78+
- type: "section"
79+
text:
80+
type: "mrkdwn"
81+
text: ":thisisfine: ${{ env.SUMMARY }}"
82+
- type: "section"
83+
text:
84+
type: "mrkdwn"
85+
text: "Read the full scan results on Github"
86+
accessory:
87+
type: "button"
88+
text:
89+
type: "plain_text"
90+
text: ":github: Scan results"
91+
emoji: true
92+
value: "workflow_run"
93+
url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
94+
action_id: "button-action"

DEVELOPER.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Follow these instructions to start up Sofie Core in development mode. (For produ
3131
```bash
3232
git clone -b master https://github.com/nrkno/sofie-core.git
3333
cd sofie-core
34+
yarn
3435
yarn start
3536
```
3637

@@ -138,12 +139,12 @@ Then submit this as a PR.
138139

139140
### ConfigManifests
140141

141-
The ConfigManifests for Blueprints and Gateways was replaced with JSONSchema in R50.
142+
The ConfigManifests for Blueprints and Gateways was replaced with JSONSchema in R50.
142143
However, one usage by AdlibActions for their userDataManifest remains as this is not something we are actively using.
143144

144145
## Blueprint Migrations
145146

146-
In R49, a replacement flow was added consisting of `validateConfig` and `applyConfig`.
147+
In R49, a replacement flow was added consisting of `validateConfig` and `applyConfig`.
147148
It is no longer recommended to use the old migrations flow for showstyle and studio blueprints.
148149

149150
### ExpectedMediaItems

meteor/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
### [1.51.2](https://github.com/nrkno/tv-automation-server-core/compare/v1.51.1...v1.51.2) (2024-11-21)
6+
7+
8+
### Bug Fixes
9+
10+
* Include previousPartInstance in check to orphan segments rather than remove them. ([2c113b5](https://github.com/nrkno/tv-automation-server-core/commit/2c113b58b205198d13f0fc7e2114704311eb915b))
11+
* updatePartInstancesSegmentIds: take into account when multiple segments have been merged into one. ([bdab8c4](https://github.com/nrkno/tv-automation-server-core/commit/bdab8c4e4ee1e67a3568cccc98106bb7f1258673))
12+
513
## [1.51.0-in-testing.3](https://github.com/nrkno/sofie-core/compare/v1.51.0-in-testing.2...v1.51.0-in-testing.3) (2024-09-25)
614

715
## [1.51.0-in-testing.2](https://github.com/nrkno/sofie-core/compare/v1.51.0-in-testing.1...v1.51.0-in-testing.2) (2024-09-24)

meteor/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
"debug": "meteor run",
1111
"libs:syncVersions": "node scripts/libs-sync-version.js",
1212
"libs:syncVersionsAndChangelogs": "node scripts/libs-sync-version-and-changelog.js",
13-
"postinstall": "meteor yarn run prepareForTest",
13+
"postinstall": "meteor npm run prepareForTest",
1414
"prepareForTest": "node ../scripts/fixTestFibers.js",
1515
"inject-git-hash": "node ./scripts/generate-version-file.js",
1616
"unit": "jest",
1717
"unitci": "jest --maxWorkers 2 --coverage",
1818
"unitcov": "jest --coverage",
19-
"test": "meteor yarn check-types && meteor yarn unit",
19+
"test": "meteor npm run check-types && meteor npm run unit",
2020
"watch": "jest --watch",
2121
"update-snapshots": "jest --updateSnapshot",
22-
"ci:lint": "meteor yarn check-types && meteor yarn lint",
22+
"ci:lint": "meteor npm run check-types && meteor npm run lint",
2323
"cov-open": "open-cli coverage/lcov-report/index.html",
24-
"cov": "meteor yarn unitcov && meteor yarn cov-open",
24+
"cov": "meteor npm run unitcov && meteor npm run cov-open",
2525
"license-validate": "node ../scripts/checkLicenses.js --allowed=\"MIT,BSD,ISC,Apache,Unlicense,CC0,LGPL,CC BY 3.0,CC BY 4.0,MPL 2.0,Python 2.0\" --excludePackages=timecode,rxjs/ajax,rxjs/fetch,rxjs/internal-compatibility,nw-pre-gyp-module-test,rxjs/operators,rxjs/testing,rxjs/webSocket,undefined,i18next-conv,@fortawesome/fontawesome-common-types,argv,indexof,custom-license,private,public-domain-module,@sofie-automation/corelib,@sofie-automation/shared-lib,@sofie-automation/job-worker",
2626
"lint": "run lint:raw .",
2727
"lint:raw": "eslint --ext .ts --ext .js --ext .tsx --ext .jsx",
@@ -67,7 +67,7 @@
6767
"object-path": "^0.11.8",
6868
"p-lazy": "^3.1.0",
6969
"semver": "^7.5.4",
70-
"superfly-timeline": "9.0.1",
70+
"superfly-timeline": "9.0.2",
7171
"threadedclass": "^1.2.2",
7272
"timecode": "0.0.4",
7373
"type-fest": "^3.13.1",

meteor/server/api/rest/v1/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import KoaRouter from '@koa/router'
22
import { interpollateTranslation, translateMessage } from '@sofie-automation/corelib/dist/TranslatableMessage'
33
import { UserError, UserErrorMessage } from '@sofie-automation/corelib/dist/error'
4+
import { IConfigMessage, NoteSeverity } from '@sofie-automation/blueprints-integration'
45
import Koa from 'koa'
56
import bodyParser from 'koa-bodyparser'
67
import { Meteor } from 'meteor/meteor'
@@ -92,6 +93,30 @@ function extractErrorDetails(e: unknown): string[] | undefined {
9293
}
9394
}
9495

96+
export const checkValidation = (method: string, configValidationMsgs: IConfigMessage[]): void => {
97+
/**
98+
* Throws if any of the configValidationMsgs indicates that the config has errors.
99+
* Will log any messages with severity WARNING or INFO
100+
*/
101+
const configValidationOK = configValidationMsgs.reduce((acc, msg) => acc && msg.level !== NoteSeverity.ERROR, true)
102+
if (!configValidationOK) {
103+
const details = JSON.stringify(
104+
configValidationMsgs.filter((msg) => msg.level === NoteSeverity.ERROR).map((msg) => msg.message.key),
105+
null,
106+
2
107+
)
108+
logger.error(`${method} failed blueprint config validation with errors: ${details}`)
109+
throw new Meteor.Error(409, `${method} has failed blueprint config validation`, details)
110+
} else {
111+
const details = JSON.stringify(
112+
configValidationMsgs.map((msg) => msg.message.key),
113+
null,
114+
2
115+
)
116+
logger.info(`${method} received messages from bluepring config validation: ${details}`)
117+
}
118+
}
119+
95120
interface APIRequestError {
96121
status: number
97122
message: string

meteor/server/api/rest/v1/playlists.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ class PlaylistsServerAPI implements PlaylistsRestAPI {
9696
event: string,
9797
rundownPlaylistId: RundownPlaylistId,
9898
adLibId: AdLibActionId | RundownBaselineAdLibActionId | PieceId | BucketAdLibId,
99-
triggerMode?: string | null
99+
triggerMode?: string | null,
100+
adLibOptions?: { [key: string]: any }
100101
): Promise<ClientAPI.ClientResponse<object>> {
101102
const baselineAdLibPiece = RundownBaselineAdLibPieces.findOneAsync(adLibId as PieceId, {
102103
projection: { _id: 1 },
@@ -204,6 +205,7 @@ class PlaylistsServerAPI implements PlaylistsRestAPI {
204205
actionId: adLibActionDoc.actionId,
205206
userData: adLibActionDoc.userData,
206207
triggerMode: triggerMode ?? undefined,
208+
actionOptions: adLibOptions,
207209
}
208210
)
209211
} else {
@@ -576,7 +578,7 @@ export function registerRoutes(registerRoute: APIRegisterHook<PlaylistsRestAPI>)
576578
}
577579
)
578580

579-
registerRoute<{ playlistId: string }, { adLibId: string; actionType?: string }, object>(
581+
registerRoute<{ playlistId: string }, { adLibId: string; actionType?: string; adLibOptions?: any }, object>(
580582
'post',
581583
'/playlists/:playlistId/execute-adlib',
582584
new Map([
@@ -591,12 +593,24 @@ export function registerRoutes(registerRoute: APIRegisterHook<PlaylistsRestAPI>)
591593
)
592594
const actionTypeObj = body
593595
const triggerMode = actionTypeObj ? (actionTypeObj as { actionType: string }).actionType : undefined
594-
logger.info(`API POST: execute-adlib ${rundownPlaylistId} ${adLibId} - triggerMode: ${triggerMode}`)
596+
const adLibOptions = actionTypeObj ? actionTypeObj.adLibOptions : undefined
597+
logger.info(
598+
`API POST: execute-adlib ${rundownPlaylistId} ${adLibId} - actionType: ${triggerMode} - options: ${
599+
adLibOptions ? JSON.stringify(adLibOptions) : 'undefined'
600+
}`
601+
)
595602

596603
check(adLibId, String)
597604
check(rundownPlaylistId, String)
598605

599-
return await serverAPI.executeAdLib(connection, event, rundownPlaylistId, adLibId, triggerMode)
606+
return await serverAPI.executeAdLib(
607+
connection,
608+
event,
609+
rundownPlaylistId,
610+
adLibId,
611+
triggerMode,
612+
adLibOptions
613+
)
600614
}
601615
)
602616

0 commit comments

Comments
 (0)