Skip to content

Commit 0b5412a

Browse files
committed
Merge branch 'upstream/release52' into upstream/peripheral-device-settings-from-blueprints
2 parents 878214b + dd5010a commit 0b5412a

File tree

132 files changed

+2505
-4050
lines changed

Some content is hidden

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

132 files changed

+2505
-4050
lines changed

DEVELOPER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ However, one usage by AdlibActions for their userDataManifest remains as this is
142142

143143
## Blueprint Migrations
144144

145-
In R49, a replacement flow was added consisting of `validateConfig` and `applyConfig`.
146-
It is no longer recommended to use the old migrations flow for showstyle and studio blueprints.
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.
147147

148148
### ExpectedMediaItems
149149

meteor/__mocks__/defaultCollectionObjects.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ export function defaultStudio(_id: StudioId): DBStudio {
105105
mappingsWithOverrides: wrapDefaultObject({}),
106106
supportedShowStyleBase: [],
107107
blueprintConfigWithOverrides: wrapDefaultObject({}),
108-
settings: {
108+
settingsWithOverrides: wrapDefaultObject({
109109
frameRate: 25,
110110
mediaPreviewsUrl: '',
111111
minimumTakeSpan: DEFAULT_MINIMUM_TAKE_SPAN,
112112
fallbackPartDuration: DEFAULT_FALLBACK_PART_DURATION,
113113
allowHold: false,
114114
allowPieceDirectPlay: false,
115115
enableBuckets: false,
116-
},
116+
}),
117117
_rundownVersionHash: '',
118118
routeSetsWithOverrides: wrapDefaultObject({}),
119119
routeSetExclusivityGroupsWithOverrides: wrapDefaultObject({}),

meteor/__mocks__/helpers/database.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,25 @@ export async function setupMockCore(doc?: Partial<ICoreSystem>): Promise<ICoreSy
170170
version: '0.0.0',
171171
previousVersion: '0.0.0',
172172
serviceMessages: {},
173+
settingsWithOverrides: wrapDefaultObject({
174+
cron: {
175+
casparCGRestart: {
176+
enabled: true,
177+
},
178+
storeRundownSnapshots: {
179+
enabled: false,
180+
},
181+
},
182+
support: {
183+
message: '',
184+
},
185+
evaluationsMessage: {
186+
enabled: false,
187+
heading: '',
188+
message: '',
189+
},
190+
}),
191+
lastBlueprintConfig: undefined,
173192
}
174193
const coreSystem = _.extend(defaultCore, doc)
175194
await CoreSystem.removeAsync(SYSTEM_ID)
@@ -367,7 +386,6 @@ export async function setupMockStudioBlueprint(
367386
},
368387

369388
studioConfigSchema: '{}' as any,
370-
studioMigrations: [],
371389
getBaseline: () => {
372390
return {
373391
timelineObjects: [],
@@ -424,7 +442,6 @@ export async function setupMockShowStyleBlueprint(
424442
},
425443

426444
showStyleConfigSchema: '{}' as any,
427-
showStyleMigrations: [],
428445
getShowStyleVariantId: (): string | null => {
429446
return SHOW_STYLE_VARIANT_ID
430447
},

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/__tests__/api/serviceMessages/serviceMessagesApi.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from '@sofie-automation/meteor-lib/dist/collections/CoreSystem'
1010
import { CoreSystem } from '../../../collections'
1111
import { SupressLogMessages } from '../../../../__mocks__/suppressLogging'
12+
import { wrapDefaultObject } from '@sofie-automation/corelib/dist/settings/objectWithOverrides'
1213

1314
function convertExternalToServiceMessage(message: ExternalServiceMessage): ServiceMessage {
1415
return {
@@ -42,6 +43,8 @@ const fakeCoreSystem: ICoreSystem = {
4243
version: '3',
4344
previousVersion: null,
4445
serviceMessages: {},
46+
settingsWithOverrides: wrapDefaultObject({} as any),
47+
lastBlueprintConfig: undefined,
4548
}
4649

4750
describe('Service messages internal API', () => {

meteor/server/__tests__/cronjobs.test.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import '../../__mocks__/_extendJest'
22
import { runAllTimers, waitUntil } from '../../__mocks__/helpers/jest'
33
import { MeteorMock } from '../../__mocks__/meteor'
44
import { logger } from '../logging'
5-
import { getRandomId, getRandomString, protectString } from '../lib/tempLib'
5+
import { getRandomId, getRandomString, literal, protectString } from '../lib/tempLib'
66
import { SnapshotType } from '@sofie-automation/meteor-lib/dist/collections/Snapshots'
77
import { IBlueprintPieceType, PieceLifespan, StatusCode, TSR } from '@sofie-automation/blueprints-integration'
88
import {
@@ -64,26 +64,36 @@ import {
6464
import { DBSegment } from '@sofie-automation/corelib/dist/dataModel/Segment'
6565
import { Settings } from '../Settings'
6666
import { SofieIngestCacheType } from '@sofie-automation/corelib/dist/dataModel/SofieIngestDataCache'
67+
import { ObjectOverrideSetOp } from '@sofie-automation/corelib/dist/settings/objectWithOverrides'
6768

6869
describe('cronjobs', () => {
6970
let env: DefaultEnvironment
7071
let rundownId: RundownId
7172

72-
beforeAll(async () => {
73-
env = await setupDefaultStudioEnvironment()
74-
75-
const o = await setupDefaultRundownPlaylist(env)
76-
rundownId = o.rundownId
77-
73+
async function setCasparCGCronEnabled(enabled: boolean) {
7874
await CoreSystem.updateAsync(
7975
{},
8076
{
81-
$set: {
82-
'cron.casparCGRestart.enabled': true,
77+
// This is a little bit of a hack, as it will result in duplicate ops, but it's fine for unit tests
78+
$push: {
79+
'settingsWithOverrides.overrides': literal<ObjectOverrideSetOp>({
80+
op: 'set',
81+
path: 'cron.casparCGRestart.enabled',
82+
value: enabled,
83+
}),
8384
},
8485
},
8586
{ multi: true }
8687
)
88+
}
89+
90+
beforeAll(async () => {
91+
env = await setupDefaultStudioEnvironment()
92+
93+
const o = await setupDefaultRundownPlaylist(env)
94+
rundownId = o.rundownId
95+
96+
await setCasparCGCronEnabled(true)
8797

8898
jest.useFakeTimers()
8999
// set time to 2020/07/19 00:00 Local Time
@@ -597,15 +607,7 @@ describe('cronjobs', () => {
597607
})
598608
test('Does not attempt to restart CasparCG when job is disabled', async () => {
599609
await createMockPlayoutGatewayAndDevices(Date.now()) // Some time after the threshold
600-
await CoreSystem.updateAsync(
601-
{},
602-
{
603-
$set: {
604-
'cron.casparCGRestart.enabled': false,
605-
},
606-
},
607-
{ multi: true }
608-
)
610+
await setCasparCGCronEnabled(false)
609611
;(logger.info as jest.Mock).mockClear()
610612
// set time to 2020/07/{date} 04:05 Local Time, should be more than 24 hours after 2020/07/19 00:00 UTC
611613
mockCurrentTime = new Date(2020, 6, date++, 4, 5, 0).getTime()

meteor/server/api/blueprints/__tests__/api.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ describe('Test blueprint management api', () => {
5555
showStyleConfigSchema: JSONBlobStringify({}),
5656

5757
databaseVersion: {
58-
showStyle: {},
59-
studio: {},
6058
system: undefined,
6159
},
6260

@@ -238,7 +236,6 @@ describe('Test blueprint management api', () => {
238236
TSRVersion: '0.0.0',
239237

240238
// studioConfigManifest: [],
241-
// studioMigrations: [],
242239
// getBaseline: (context: IStudioContext): TSRTimelineObjBase[] => {
243240
// return []
244241
// },

meteor/server/api/blueprints/__tests__/lib.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export function generateFakeBlueprint(
1717
integrationVersion: '0.0.0',
1818
TSRVersion: '0.0.0',
1919
studioConfigManifest: [],
20-
studioMigrations: [],
2120
getBaseline: () => {
2221
return {
2322
timelineObjects: [],
@@ -43,8 +42,6 @@ export function generateFakeBlueprint(
4342
showStyleConfigSchema: JSONBlobStringify({}),
4443

4544
databaseVersion: {
46-
showStyle: {},
47-
studio: {},
4845
system: undefined,
4946
},
5047

0 commit comments

Comments
 (0)