Skip to content

Commit

Permalink
Merge branch 'release52' into feat/templateAdlibs
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rogers committed Nov 13, 2024
2 parents 89d7eca + 799ab71 commit 50bc344
Show file tree
Hide file tree
Showing 1,412 changed files with 38,813 additions and 17,097 deletions.
24 changes: 19 additions & 5 deletions .github/PULL-REQUEST-TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,27 @@ What is the new behavior?
-->


## Testing Instructions
## Testing
<!--
Please provide some instructions and other information for how to verify that the feature works.
When you add a feature, you should also provide relevant unit tests, in order to
* ensure that the feature works as expected
* ensure that the feature will continue to work in the future
-->

- [ ] I have added one or more unit tests for this PR
- [ ] I have updated the relevant unit tests
- [ ] No unit test changes are needed for this PR

### Affected areas

<!--
Please provide some details on what areas of the system that are affected by this PR.
This is useful for testers to know where to focus their testing efforts.
Examples:
* "Do a Take for a part that contains an adlib, verify that the adlib plays out."
* "Open the Switchboard panel and toggle a route, verify that the route toggles in the GUI."
* "This feature also affects 'feature X', so that needs to be tested for regressions as well."
* This PR affects the playout logic in general.
* This PR affects the timing calculation in the Rundown during playout.
* This PR affects the NRC/MOS integration
*
-->


Expand Down
63 changes: 48 additions & 15 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,18 @@ jobs:
run: |
cd meteor
yarn inject-git-hash
- name: Prepare webui for meteor build
if: steps.check-build-and-push.outputs.enable == 'true'
run: |
rm -Rf meteor/public
cp -R packages/webui/dist meteor/public
- name: Meteor Build
if: steps.check-build-and-push.outputs.enable == 'true'
run: |
cd meteor
NODE_OPTIONS="--max-old-space-size=4096" METEOR_DEBUG_BUILD=1 meteor build --allow-superuser --directory .
mv bundle/programs/web.browser/assets/ bundle/programs/web.browser/app/assets/ || true
- name: Meteor Bundle NPM Build
if: steps.check-build-and-push.outputs.enable == 'true'
run: |
Expand All @@ -212,7 +219,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to GHCR
if: steps.check-build-and-push.outputs.enable == 'true' && steps.check-ghcr.outputs.enable == 'true' && steps.ghcr-tag.outputs.tags != 0
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ./meteor/Dockerfile.circle
Expand All @@ -223,7 +230,7 @@ jobs:
github-token: ${{ github.token }}
- name: Build and push to DockerHub
if: steps.check-build-and-push.outputs.enable == 'true' && steps.dockerhub.outputs.dockerhub-publish == '1'
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ./meteor/Dockerfile.circle
Expand All @@ -239,7 +246,9 @@ 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/[email protected]
uses: aquasecurity/[email protected]
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
with:
image-ref: "${{ steps.trivy-image.outputs.image }}"
format: "table"
Expand Down Expand Up @@ -362,7 +371,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to GHCR
if: steps.check-build-and-push.outputs.enable == 'true' && steps.check-ghcr.outputs.enable == 'true' && steps.ghcr-tag.outputs.tags != 0
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./packages
file: ./packages/${{ matrix.gateway-name }}/Dockerfile.circle
Expand All @@ -372,7 +381,7 @@ jobs:
tags: "${{ steps.ghcr-tag.outputs.tags }}"
- name: Build and push to DockerHub
if: steps.check-build-and-push.outputs.enable == 'true' && steps.dockerhub.outputs.dockerhub-publish == '1'
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./packages
file: ./packages/${{ matrix.gateway-name }}/Dockerfile.circle
Expand All @@ -388,7 +397,9 @@ 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/[email protected]
uses: aquasecurity/[email protected]
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
with:
image-ref: "${{ steps.trivy-image.outputs.image }}"
format: "table"
Expand Down Expand Up @@ -422,9 +433,11 @@ jobs:
- mos-gateway
- corelib
- shared-lib
- meteor-lib
- job-worker
- openapi
- live-status-gateway
- webui

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -467,7 +480,7 @@ jobs:
- blueprints-integration
- server-core-integration
- shared-lib
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [14.x, 18.x, 20.x, 22.x]
include:
# include additional configs, to run certain packages only for a certain version of node
- node-version: 14.x
Expand All @@ -477,19 +490,28 @@ jobs:
package-name: job-worker
send-coverage: true
# manual openapi to avoid testing for 14.x
- node-version: 16.x
package-name: openapi
- node-version: 18.x
package-name: openapi
- node-version: 20.x
package-name: openapi
- node-version: 22.x
package-name: openapi
# No tests for the gateways yet
# - node-version: 18.x
# package-name: playout-gateway
# - node-version: 18.x
# package-name: mos-gateway
- node-version: 18.x
package-name: live-status-gateway
send-coverage: true
- node-version: 18.x
package-name: webui
# manual meteor-lib as it only needs a couple of versions
- node-version: 18.x
package-name: meteor-lib
send-coverage: true
- node-version: 14.x
package-name: meteor-lib

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -520,7 +542,7 @@ jobs:
env:
CI: true
- name: Send coverage
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'))))
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'))))
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -569,13 +591,17 @@ jobs:
yarn
env:
CI: true
- name: Run generator
- name: Build OpenAPI client library
run: |
cd packages/openapi
yarn build
env:
CI: true
- name: Generate OpenAPI docs and server
run: |
cd packages/openapi
yarn gendocs
yarn genserver
yarn genclient:ts
env:
CI: true

Expand Down Expand Up @@ -622,7 +648,7 @@ jobs:
CI: true
- name: Publish
if: github.ref == 'refs/heads/master' # always publish for just the master branch
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/documentation/build
Expand Down Expand Up @@ -664,7 +690,7 @@ jobs:
else
# make dependencies of `determine-npm-tag` available
yarn install --mode=skip-build
cd packages
PACKAGE_NAME="@sofie-automation/shared-lib"
PUBLISHED_VERSION=$(yarn npm info --json $PACKAGE_NAME | jq -c '.version' -r)
Expand All @@ -682,6 +708,13 @@ jobs:
yarn build
env:
CI: true
- name: Build OpenAPI client library
if: ${{ steps.do-publish.outputs.tag }}
run: |
cd packages/openapi
yarn build
env:
CI: true
- name: Modify dependencies to use npm packages
run: node scripts/prepublish.js
- name: Publish to NPM
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/prerelease-libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- blueprints-integration
- server-core-integration
- shared-lib
node-version: [14.x, 16.x, 18.x, 20.x]
node-version: [14.x, 18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -131,6 +131,14 @@ jobs:
yarn build
env:
CI: true

- name: Build OpenAPI client library
if: ${{ steps.do-publish.outputs.publish }}
run: |
cd packages/openapi
yarn build
env:
CI: true
- name: Modify dependencies to use npm packages
run: node scripts/prepublish.js
- name: Publish to NPM
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/prune-container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

jobs:
prune-container-images:
if: ${{ github.repository_owner == 'nrkno' }}

uses: nrkno/sofie-github-workflows/.github/workflows/prune-container-images.yml@main
strategy:
max-parallel: 1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/prune-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ on:

jobs:
prune-tags:
if: ${{ github.repository_owner == 'nrkno' }}

name: Prune tags
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'nrkno' }}
if: ${{ github.repository_owner == 'nrkno' && !github.event.pull_request.head.repo.fork }}
timeout-minutes: 15

steps:
- uses: actions/checkout@v4
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,29 @@ on:

jobs:
trivy:
if: ${{ github.repository_owner == 'nrkno' }}

name: Trivy scan
runs-on: ubuntu-latest
strategy:
matrix:
image: ["server-core", "playout-gateway", "mos-gateway"]
timeout-minutes: 15

steps:
- name: Run Trivy vulnerability scanner (json)
uses: aquasecurity/[email protected]
uses: aquasecurity/[email protected]
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'

- name: Run Trivy vulnerability scanner (table)
uses: aquasecurity/[email protected]
uses: aquasecurity/[email protected]
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'
Expand All @@ -36,7 +44,9 @@ jobs:
echo $CODE_BLOCK >> $GITHUB_STEP_SUMMARY
- name: Run Trivy in GitHub SBOM mode and submit results to Dependency Graph
uses: aquasecurity/[email protected]
uses: aquasecurity/[email protected]
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
with:
format: 'github'
output: 'dependency-results-${{ matrix.image }}.sbom.json'
Expand All @@ -54,7 +64,7 @@ jobs:
echo ${{ env.SUMMARY }}
- name: Send Slack Notification
uses: slackapi/slack-github-action@v1.25.0
uses: slackapi/slack-github-action@v1.27.0
with:
payload: |
{
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json.default
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"packages/shared-lib",
"packages/job-worker",
"packages/openapi",
"packages/live-status-gateway"
"packages/live-status-gateway",
"packages/webui"
],
"prettier.enable": true,
"sonarlint.connectedMode.project": { "projectKey": "nrkno_sofie-core" },
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ This repository uses the following branches:
* **_master_** is our main branch. We consider it stable and it is used in production.
* The **_releaseXX_** branches are our in-development branches. When a release is ready, we decide to “freeze” that branch and create a new **_releaseXX+1_** branch.

We encourage you to base your contributions on the latest **_releaseXX_** branch, alternatively the **_master_** branch or a recently frozen **_releaseXX_** branch. The [_Sofie Releases_](https://nrkno.github.io/sofie-core/releases) page collects the status and timeline of the releases.
We require contributions to be based based on the latest **_release\*_** branch.
The [_Sofie Releases_](https://nrkno.github.io/sofie-core/releases) page collects the status and timeline of the releases.
11 changes: 8 additions & 3 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ Follow these instructions to start up Sofie Core in development mode. (For produ

### Prerequisites

- Install [Node.js](https://nodejs.org) 18 (14 should also work) (using [nvm](https://github.com/nvm-sh/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows) is the recommended way to install Node.js)
- If on Windows: `npm install --global windows-build-tools`
- Install [Meteor](https://www.meteor.com/install) (`npm install --global meteor`)
- Install [Node.js](https://nodejs.org) 14 (using [nvm](https://github.com/nvm-sh/nvm) or [nvm-windows](https://github.com/coreybutler/nvm-windows) is the recommended way to install Node.js)
- Install [Meteor](https://www.meteor.com/install) (`npm install --global meteor@2`)
- Install [Node.js](https://nodejs.org) 18 (using the same method you used above, you can uninstall node 14 if needed)
- Install an older version of corepack (`npm install --global [email protected]`)
- Enable [corepack](https://nodejs.org/api/corepack.html#corepack) (`corepack enable`) as administrator/root. If `corepack` is not found, you may need to install it first with `npm install --global corepack`

- If on Windows, you may need to `npm install --global windows-build-tools` but this is not always necessary

### Quick Start

```bash
Expand All @@ -33,6 +36,8 @@ yarn start

> 💡 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.
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`

### Slightly more Involved Start

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

0 comments on commit 50bc344

Please sign in to comment.