Skip to content

Commit a19ab10

Browse files
author
Mint de Wit
committed
Merge remote-tracking branch 'nrk/release52' into feat/quickLoop
2 parents 6950fea + 479f696 commit a19ab10

File tree

1,222 files changed

+24443
-10365
lines changed

Some content is hidden

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

1,222 files changed

+24443
-10365
lines changed

.github/workflows/node.yaml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,18 @@ jobs:
184184
run: |
185185
cd meteor
186186
yarn inject-git-hash
187+
- name: Prepare webui for meteor build
188+
if: steps.check-build-and-push.outputs.enable == 'true'
189+
run: |
190+
rm -Rf meteor/public
191+
cp -R packages/webui/dist meteor/public
187192
- name: Meteor Build
188193
if: steps.check-build-and-push.outputs.enable == 'true'
189194
run: |
190195
cd meteor
191196
NODE_OPTIONS="--max-old-space-size=4096" METEOR_DEBUG_BUILD=1 meteor build --allow-superuser --directory .
197+
mv bundle/programs/web.browser/assets/ bundle/programs/web.browser/app/assets/ || true
198+
192199
- name: Meteor Bundle NPM Build
193200
if: steps.check-build-and-push.outputs.enable == 'true'
194201
run: |
@@ -422,9 +429,11 @@ jobs:
422429
- mos-gateway
423430
- corelib
424431
- shared-lib
432+
- meteor-lib
425433
- job-worker
426434
- openapi
427435
- live-status-gateway
436+
- webui
428437

429438
steps:
430439
- uses: actions/checkout@v4
@@ -467,7 +476,7 @@ jobs:
467476
- blueprints-integration
468477
- server-core-integration
469478
- shared-lib
470-
node-version: [14.x, 16.x, 18.x, 20.x]
479+
node-version: [14.x, 18.x, 20.x, 22.x]
471480
include:
472481
# include additional configs, to run certain packages only for a certain version of node
473482
- node-version: 14.x
@@ -477,19 +486,28 @@ jobs:
477486
package-name: job-worker
478487
send-coverage: true
479488
# manual openapi to avoid testing for 14.x
480-
- node-version: 16.x
481-
package-name: openapi
482489
- node-version: 18.x
483490
package-name: openapi
484491
- node-version: 20.x
485492
package-name: openapi
493+
- node-version: 22.x
494+
package-name: openapi
486495
# No tests for the gateways yet
487496
# - node-version: 18.x
488497
# package-name: playout-gateway
489498
# - node-version: 18.x
490499
# package-name: mos-gateway
491500
- node-version: 18.x
492501
package-name: live-status-gateway
502+
send-coverage: true
503+
- node-version: 18.x
504+
package-name: webui
505+
# manual meteor-lib as it only needs a couple of versions
506+
- node-version: 18.x
507+
package-name: meteor-lib
508+
send-coverage: true
509+
- node-version: 14.x
510+
package-name: meteor-lib
493511

494512
steps:
495513
- uses: actions/checkout@v4
@@ -520,7 +538,7 @@ jobs:
520538
env:
521539
CI: true
522540
- name: Send coverage
523-
if: (matrix.node-version == '16.x' || matrix.send-coverage == true) && ((github.event_name == 'pull_request') && ((!startsWith(github.head_ref, 'release'))) || ((github.event_name == 'push') && (!startsWith(github.ref_name, 'release'))))
541+
if: (matrix.node-version == '18.x' || matrix.send-coverage == true) && ((github.event_name == 'pull_request') && ((!startsWith(github.head_ref, 'release'))) || ((github.event_name == 'push') && (!startsWith(github.ref_name, 'release'))))
524542
uses: codecov/codecov-action@v4
525543
env:
526544
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -682,6 +700,21 @@ jobs:
682700
yarn build
683701
env:
684702
CI: true
703+
- name: Generate OpenAPI client library
704+
if: ${{ steps.do-publish.outputs.tag }}
705+
uses: hatamiarash7/[email protected]
706+
with:
707+
generator: typescript-fetch
708+
openapi-file: ./packages/openapi/api/actions.yaml
709+
output-dir: ./packages/openapi/client/ts
710+
command-args: -p supportsES6=true
711+
- name: Build OpenAPI client library
712+
if: ${{ steps.do-publish.outputs.tag }}
713+
run: |
714+
cd packages/openapi
715+
yarn build:main
716+
env:
717+
CI: true
685718
- name: Modify dependencies to use npm packages
686719
run: node scripts/prepublish.js
687720
- name: Publish to NPM

.github/workflows/prerelease-libs.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- blueprints-integration
5454
- server-core-integration
5555
- shared-lib
56-
node-version: [14.x, 16.x, 18.x, 20.x]
56+
node-version: [14.x, 18.x, 20.x, 22.x]
5757

5858
steps:
5959
- uses: actions/checkout@v4
@@ -131,6 +131,21 @@ jobs:
131131
yarn build
132132
env:
133133
CI: true
134+
- name: Generate OpenAPI client library
135+
if: ${{ steps.do-publish.outputs.tag }}
136+
uses: hatamiarash7/[email protected]
137+
with:
138+
generator: typescript-fetch
139+
openapi-file: ./packages/openapi/api/actions.yaml
140+
output-dir: ./packages/openapi/client/ts
141+
command-args: -p supportsES6=true
142+
- name: Build OpenAPI client library
143+
if: ${{ steps.do-publish.outputs.tag }}
144+
run: |
145+
cd packages/openapi
146+
yarn build:main
147+
env:
148+
CI: true
134149
- name: Modify dependencies to use npm packages
135150
run: node scripts/prepublish.js
136151
- name: Publish to NPM

.github/workflows/sonar.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
name: SonarCloud
1414
runs-on: ubuntu-latest
1515
if: ${{ github.repository_owner == 'nrkno' && !github.event.pull_request.head.repo.fork }}
16+
timeout-minutes: 15
1617

1718
steps:
1819
- uses: actions/checkout@v4

.github/workflows/trivy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
strategy:
1212
matrix:
1313
image: ["server-core", "playout-gateway", "mos-gateway"]
14+
timeout-minutes: 15
15+
1416
steps:
1517
- name: Run Trivy vulnerability scanner (json)
1618
uses: aquasecurity/[email protected]
@@ -54,7 +56,7 @@ jobs:
5456
echo ${{ env.SUMMARY }}
5557
5658
- name: Send Slack Notification
57-
uses: slackapi/slack-github-action@v1.26.0
59+
uses: slackapi/slack-github-action@v1.27.0
5860
with:
5961
payload: |
6062
{

DEVELOPER.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ yarn start
3636

3737
> 💡 First startup may take a while, especially on Windows. To speed things up, consider adding `%LOCALAPPDATA%\.meteor` and the directory where you cloned `server-core` to your Windows Defender virus protection exclusions.
3838
39+
The Sofie ui (served by Vite) can be accessed at `http://localhost:3005`. The meteor http server can be access directly at `http://localhost:3000`
40+
3941
### Slightly more Involved Start
4042

4143
1. Clone the repository (for development, it is recommended to base your work on the latest unstable release branch)

meteor/.eslintrc.js

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,43 +56,20 @@ const tsBase = {
5656
}
5757

5858
module.exports = {
59-
extends: [...commonExtends, 'plugin:react/recommended'],
60-
plugins: [...commonPlugins, 'react'],
59+
extends: [...commonExtends],
60+
plugins: [...commonPlugins],
6161
rules: {
6262
'prettier/prettier': 'error',
6363
},
6464
env: { es2017: true },
6565
parserOptions: { sourceType: 'module', ecmaVersion: 2018 },
66-
settings: {
67-
react: {
68-
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
69-
},
70-
},
66+
settings: {},
7167
overrides: [
7268
// Note: these replace the values defined above, so make sure to extend them if they are needed
7369
{
7470
files: ['*.ts'],
7571
...tsBase,
7672
},
77-
{
78-
files: ['*.tsx'],
79-
...tsBase,
80-
extends: [...tsBase.extends, 'plugin:react/recommended'],
81-
parserOptions: {
82-
...tsBase.parserOptions,
83-
ecmaFeatures: {
84-
jsx: true, // Allows for the parsing of JSX
85-
},
86-
},
87-
rules: {
88-
...tsBase.rules,
89-
'node/no-extraneous-import': 'off', // because there are a lot of them as dev-dependencies
90-
'node/no-missing-import': 'off', // erroring on every single import
91-
'react/prop-types': 'off', // we don't use this
92-
'@typescript-eslint/no-empty-interface': 'off', // many prop/state types are {}
93-
'@typescript-eslint/promise-function-async': 'off', // event handlers can't be async
94-
},
95-
},
9673
{
9774
files: ['*.js'],
9875
env: {

meteor/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ src/**/*.js.map
55
coverage
66
settings.json
77
server/_force_restart.js
8+
public/
89

910
# Ignore TV2-features:
1011
client/styles/tv2

meteor/Dockerfile

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
# syntax=docker/dockerfile:experimental
2+
3+
# BUILD WEBUI
4+
FROM node:18
5+
COPY packages /opt/core/packages
6+
WORKDIR /opt/core/packages
7+
8+
RUN rm -R *-gateway documentation openapi
9+
RUN corepack enable
10+
RUN yarn install && yarn build
11+
12+
# Install production dependencies for the worker
13+
# HACK:
14+
# RUN yarn workspaces focus --production @sofie-automation/job-worker @sofie-automation/corelib
15+
216
# BUILD IMAGE
317
FROM meteor/node:14.21.4
418
RUN curl "https://install.meteor.com/?release=2.13.3" | sh
@@ -9,17 +23,18 @@ ENV NODE_ENV anythingButProduction
923

1024
# Prepare the packages
1125
COPY package.json /opt/core/package.json
12-
COPY packages /opt/core/packages
13-
WORKDIR /opt/core/packages
14-
RUN rm -R *-gateway documentation openapi
15-
RUN corepack enable
16-
RUN yarn install && yarn build
26+
COPY --from=0 /opt/core/packages /opt/core/packages
1727

1828
# Add the meteor source
1929
COPY meteor /opt/core/meteor
2030
COPY scripts /opt/core/scripts
2131
WORKDIR /opt/core/meteor
2232

33+
# move the webui to the correct place
34+
RUN rm -Rf /opt/core/meteor/public
35+
RUN cp -R /opt/core/packages/webui/dist /opt/core/meteor/public
36+
RUN rm -R /opt/core/packages/webui
37+
2338
# Force meteor to setup the runtime
2439
RUN meteor --version --allow-superuser
2540
RUN meteor corepack enable
@@ -31,9 +46,8 @@ RUN --mount=type=cache,target=/opt/core/meteor/.meteor/local NODE_OPTIONS="--max
3146
WORKDIR /opt/bundle/programs/server/
3247
RUN npm install
3348

34-
# Install production dependencies for the worker
35-
WORKDIR /opt/core/packages
36-
RUN yarn workspaces focus --production @sofie-automation/job-worker @sofie-automation/corelib
49+
# meteor does something weird with these files
50+
RUN mv /opt/bundle/programs/web.browser/assets /opt/bundle/programs/web.browser/app/assets || true
3751

3852
# DEPLOY IMAGE
3953
FROM alpine:3.19
@@ -60,11 +74,8 @@ ENV PATH $DIR_NODE/v$NODE_VERSION/bin:$PATH
6074
# confirm installation
6175
RUN node -v && npm -v
6276

63-
COPY --from=0 /opt/bundle /opt/core
77+
COPY --from=1 /opt/bundle /opt/core
6478
COPY meteor/docker-entrypoint.sh /opt
6579

66-
# Tell meteor where the worker code is located
67-
ENV WORKER_EXEC_DIR=/opt/packages/job-worker
68-
6980
WORKDIR /opt/core/
7081
CMD ["/opt/docker-entrypoint.sh"]

meteor/__mocks__/_extendJest.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import { UserError, UserErrorMessage } from '@sofie-automation/corelib/dist/erro
22
import { Meteor } from 'meteor/meteor'
33
import { clone } from '@sofie-automation/corelib/dist/lib'
44
import { stringifyError } from '@sofie-automation/shared-lib/dist/lib/stringifyError'
5-
import '../server/api/logger'
65
import _ from 'underscore'
7-
import { ClientAPI } from '../lib/api/client'
6+
import { ClientAPI } from '@sofie-automation/meteor-lib/dist/api/client'
87

98
// Include this file in to get access to the extended functions
109

meteor/__mocks__/_setupMocks.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { setLogLevel } from '../server/logging'
22
import { Fiber } from './Fibers'
33
import { resetRandomId } from './random'
44
import { makeCompatible } from 'meteor-promise'
5-
import { LogLevel } from '../lib/lib'
5+
import { LogLevel } from '../server/lib/tempLib'
66
import { SupressLogMessages } from './suppressLogging'
77

88
// This file is run before all tests start.
@@ -34,8 +34,6 @@ jest.mock('meteor/webapp', (...args) => require('./webapp').setup(args), { virtu
3434
jest.mock('../server/api/integration/slack', (...args) => require('./slack').setup(args), { virtual: true })
3535
jest.mock('../server/worker/worker', (...args) => require('./worker').setup(args), { virtual: true })
3636

37-
require('../server/api/logger.ts')
38-
3937
SupressLogMessages.init()
4038

4139
beforeEach(() => {

0 commit comments

Comments
 (0)