Skip to content

Commit

Permalink
Merge branch 'upstream/release52' into bbc-release52
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Dec 11, 2024
2 parents d12fdc3 + b66de77 commit 20aee34
Show file tree
Hide file tree
Showing 173 changed files with 5,116 additions and 1,065 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
CI: true
- name: Send coverage
if: ((github.event_name == 'pull_request') && (!startsWith(github.head_ref, 'release'))) || ((github.event_name == 'push') && (!startsWith(github.ref_name, 'release')))
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
echo "image=$image" >> $GITHUB_OUTPUT
- name: Trivy scanning
if: steps.check-build-and-push.outputs.enable == 'true' && steps.check-ghcr.outputs.enable == 'true' && steps.ghcr-tag.outputs.tags != 0
uses: aquasecurity/trivy-action@0.24.0
uses: aquasecurity/trivy-action@0.29.0
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
with:
Expand Down Expand Up @@ -397,7 +397,7 @@ jobs:
echo "image=$image" >> $GITHUB_OUTPUT
- name: Trivy scanning
if: steps.check-build-and-push.outputs.enable == 'true' && steps.check-ghcr.outputs.enable == 'true' && steps.ghcr-tag.outputs.tags != 0
uses: aquasecurity/trivy-action@0.24.0
uses: aquasecurity/trivy-action@0.29.0
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
with:
Expand Down
83 changes: 34 additions & 49 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Scheduled Trivy Scan
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * 1'
- cron: "0 10 * * 1"

jobs:
trivy:
Expand All @@ -17,21 +17,21 @@ jobs:

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

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

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

Expand All @@ -64,46 +64,31 @@ jobs:
echo ${{ env.SUMMARY }}
- name: Send Slack Notification
uses: slackapi/slack-github-action@v1.27.0
uses: slackapi/slack-github-action@v2.0.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "Trivy scan results",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Trivy scan results for sofie-core-${{ matrix.image }}:latest"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":thisisfine: ${{ env.SUMMARY }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Read the full scan results on Github"
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": ":github: Scan results",
"emoji": true
},
"value": "workflow_run",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_id": "button-action"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
text: "Trivy scan results"
blocks:
- type: "header"
text:
type: "plain_text"
text: "Trivy scan results for sofie-core-${{ matrix.image }}:latest"
- type: "section"
text:
type: "mrkdwn"
text: ":thisisfine: ${{ env.SUMMARY }}"
- type: "section"
text:
type: "mrkdwn"
text: "Read the full scan results on Github"
accessory:
type: "button"
text:
type: "plain_text"
text: ":github: Scan results"
emoji: true
value: "workflow_run"
url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
action_id: "button-action"
8 changes: 7 additions & 1 deletion DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Follow these instructions to start up Sofie Core in development mode. (For produ
```bash
git clone -b master https://github.com/nrkno/sofie-core.git
cd sofie-core
yarn
yarn start
```

Expand Down Expand Up @@ -136,9 +137,14 @@ Then submit this as a PR.

### ConfigManifests

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

## Blueprint Migrations

In R52, the replacement flow of `validateConfig` and `applyConfig` was extended to the system blueprint
It is no longer recommended to use the old migrations flow for system blueprints.

### ExpectedMediaItems

These are used for Media-manager which is no longer being developed.
Expand Down
2 changes: 1 addition & 1 deletion meteor/__mocks__/webapp.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const WebAppMock = {
rawConnectHandlers: {
rawHandlers: {
use: (): void => {
// No web server to setup
},
Expand Down
27 changes: 13 additions & 14 deletions meteor/server/Connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,19 @@ function traceConnections() {
}, 1000)
}

Meteor.startup(() => {
Meteor.startup(async () => {
// Reset the connection status of the devices
deferAsync(async () => {
await PeripheralDevices.updateAsync(
{
connected: true,
lastSeen: { $lt: getCurrentTime() - 60 * 1000 },
},
{
$set: {
connected: false,
},

await PeripheralDevices.updateAsync(
{
connected: true,
lastSeen: { $lt: getCurrentTime() - 60 * 1000 },
},
{
$set: {
connected: false,
},
{ multi: true }
)
})
},
{ multi: true }
)
})
2 changes: 1 addition & 1 deletion meteor/server/api/deviceTriggers/RundownsObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Rundowns } from '../../collections'
import { literal } from '@sofie-automation/corelib/dist/lib'
import { MongoFieldSpecifierOnesStrict } from '@sofie-automation/corelib/dist/mongo'
import { DBRundown } from '@sofie-automation/corelib/dist/dataModel/Rundown'
import { PromiseDebounce } from '../../publications/lib/debounce'
import { PromiseDebounce } from '../../publications/lib/PromiseDebounce'

const REACTIVITY_DEBOUNCE = 20

Expand Down
2 changes: 1 addition & 1 deletion meteor/server/api/deviceTriggers/StudioObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ContentCache } from './reactiveContentCache'
import { RundownContentObserver } from './RundownContentObserver'
import { RundownsObserver } from './RundownsObserver'
import { RundownPlaylists, Rundowns, ShowStyleBases } from '../../collections'
import { PromiseDebounce } from '../../publications/lib/debounce'
import { PromiseDebounce } from '../../publications/lib/PromiseDebounce'
import { MinimalMongoCursor } from '../../collections/implementations/asyncCollection'

type ChangedHandler = (showStyleBaseId: ShowStyleBaseId, cache: ContentCache) => () => void
Expand Down
3 changes: 3 additions & 0 deletions meteor/server/api/deviceTriggers/triggersContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class MeteorTriggersCollectionWrapper<DBInterface extends { _id: ProtectedString
selector: MongoQuery<DBInterface>,
options?: FindOptions<DBInterface>
): Promise<Array<DBInterface>> {
// Note: the _computation is not used, since we are not using Tracker server-side
return this.#collection.findFetchAsync(selector, options)
}

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

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

Expand Down
4 changes: 4 additions & 0 deletions meteor/server/api/ingest/ingestCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import {
} from '@sofie-automation/corelib/dist/dataModel/NrcsIngestDataCache'
import { groupByToMap } from '@sofie-automation/corelib/dist/lib'

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

Expand Down
3 changes: 2 additions & 1 deletion meteor/server/api/rest/koa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ Meteor.startup(() => {
)

// Expose the API at the url
WebApp.rawConnectHandlers.use((req, res) => {
WebApp.rawHandlers.use((req, res) => {
const transaction = profiler.startTransaction(`${req.method}:${req.url}`, 'http.incoming')
if (transaction) {
transaction.setLabel('url', `${req.url}`)
transaction.setLabel('method', `${req.method}`)

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

0 comments on commit 20aee34

Please sign in to comment.