Skip to content

Commit 20aee34

Browse files
committed
Merge branch 'upstream/release52' into bbc-release52
2 parents d12fdc3 + b66de77 commit 20aee34

File tree

173 files changed

+5116
-1065
lines changed

Some content is hidden

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

173 files changed

+5116
-1065
lines changed

.github/workflows/node.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Follow these instructions to start up Sofie Core in development mode. (For produ
2929
```bash
3030
git clone -b master https://github.com/nrkno/sofie-core.git
3131
cd sofie-core
32+
yarn
3233
yarn start
3334
```
3435

@@ -136,9 +137,14 @@ Then submit this as a PR.
136137

137138
### ConfigManifests
138139

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

143+
## Blueprint Migrations
144+
145+
In R52, the replacement flow of `validateConfig` and `applyConfig` was extended to the system blueprint
146+
It is no longer recommended to use the old migrations flow for system blueprints.
147+
142148
### ExpectedMediaItems
143149

144150
These are used for Media-manager which is no longer being developed.

meteor/__mocks__/webapp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const WebAppMock = {
2-
rawConnectHandlers: {
2+
rawHandlers: {
33
use: (): void => {
44
// No web server to setup
55
},

meteor/server/Connections.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,19 @@ function traceConnections() {
103103
}, 1000)
104104
}
105105

106-
Meteor.startup(() => {
106+
Meteor.startup(async () => {
107107
// Reset the connection status of the devices
108-
deferAsync(async () => {
109-
await PeripheralDevices.updateAsync(
110-
{
111-
connected: true,
112-
lastSeen: { $lt: getCurrentTime() - 60 * 1000 },
113-
},
114-
{
115-
$set: {
116-
connected: false,
117-
},
108+
109+
await PeripheralDevices.updateAsync(
110+
{
111+
connected: true,
112+
lastSeen: { $lt: getCurrentTime() - 60 * 1000 },
113+
},
114+
{
115+
$set: {
116+
connected: false,
118117
},
119-
{ multi: true }
120-
)
121-
})
118+
},
119+
{ multi: true }
120+
)
122121
})

meteor/server/api/deviceTriggers/RundownsObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Rundowns } from '../../collections'
44
import { literal } from '@sofie-automation/corelib/dist/lib'
55
import { MongoFieldSpecifierOnesStrict } from '@sofie-automation/corelib/dist/mongo'
66
import { DBRundown } from '@sofie-automation/corelib/dist/dataModel/Rundown'
7-
import { PromiseDebounce } from '../../publications/lib/debounce'
7+
import { PromiseDebounce } from '../../publications/lib/PromiseDebounce'
88

99
const REACTIVITY_DEBOUNCE = 20
1010

meteor/server/api/deviceTriggers/StudioObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ContentCache } from './reactiveContentCache'
1919
import { RundownContentObserver } from './RundownContentObserver'
2020
import { RundownsObserver } from './RundownsObserver'
2121
import { RundownPlaylists, Rundowns, ShowStyleBases } from '../../collections'
22-
import { PromiseDebounce } from '../../publications/lib/debounce'
22+
import { PromiseDebounce } from '../../publications/lib/PromiseDebounce'
2323
import { MinimalMongoCursor } from '../../collections/implementations/asyncCollection'
2424

2525
type ChangedHandler = (showStyleBaseId: ShowStyleBaseId, cache: ContentCache) => () => void

meteor/server/api/deviceTriggers/triggersContext.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class MeteorTriggersCollectionWrapper<DBInterface extends { _id: ProtectedString
5050
selector: MongoQuery<DBInterface>,
5151
options?: FindOptions<DBInterface>
5252
): Promise<Array<DBInterface>> {
53+
// Note: the _computation is not used, since we are not using Tracker server-side
5354
return this.#collection.findFetchAsync(selector, options)
5455
}
5556

@@ -58,6 +59,7 @@ class MeteorTriggersCollectionWrapper<DBInterface extends { _id: ProtectedString
5859
selector: MongoQuery<DBInterface> | DBInterface['_id'],
5960
options?: FindOneOptions<DBInterface>
6061
): Promise<DBInterface | undefined> {
62+
// Note: the _computation is not used, since we are not using Tracker server-side
6163
return this.#collection.findOneAsync(selector, options)
6264
}
6365
}
@@ -97,6 +99,7 @@ export const MeteorTriggersContext: TriggersContext = {
9799
},
98100

99101
withComputation: async (_computation, func) => {
102+
// Note: the _computation is not used, since we are not using Tracker server-side
100103
return func()
101104
},
102105

meteor/server/api/ingest/ingestCache.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import {
1313
} from '@sofie-automation/corelib/dist/dataModel/NrcsIngestDataCache'
1414
import { groupByToMap } from '@sofie-automation/corelib/dist/lib'
1515

16+
/**
17+
* This class provides a few convenience methods for fetching IngestRundown
18+
* (or its child types) from the NrcsIngestDataCache collection
19+
*/
1620
export class RundownIngestDataCache {
1721
private constructor(private readonly rundownId: RundownId, private readonly documents: NrcsIngestDataCacheObj[]) {}
1822

meteor/server/api/rest/koa.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ Meteor.startup(() => {
4646
)
4747

4848
// Expose the API at the url
49-
WebApp.rawConnectHandlers.use((req, res) => {
49+
WebApp.rawHandlers.use((req, res) => {
5050
const transaction = profiler.startTransaction(`${req.method}:${req.url}`, 'http.incoming')
5151
if (transaction) {
5252
transaction.setLabel('url', `${req.url}`)
5353
transaction.setLabel('method', `${req.method}`)
5454

5555
res.on('finish', () => {
56+
// When the end of the request is sent to the client, submit the apm transaction
5657
let route = req.originalUrl
5758
if (req.originalUrl && req.url && req.originalUrl.endsWith(req.url.slice(1)) && req.url.length > 1) {
5859
route = req.originalUrl.slice(0, -1 * (req.url.length - 1))

0 commit comments

Comments
 (0)