From 550e8936cdbc464052d39c0efd5e60d3ece3a70d Mon Sep 17 00:00:00 2001 From: Johan Nyman Date: Mon, 22 Jan 2024 11:47:23 +0100 Subject: [PATCH 1/2] fix: refactor and fix issue with (wrongly) thown error "Error: Bad input data: content.filePath not set!" --- .../worker/src/worker/accessorHandlers/atem.ts | 10 +++++++--- .../worker/src/worker/accessorHandlers/fileShare.ts | 11 +++++++---- .../worker/src/worker/accessorHandlers/http.ts | 9 ++++++--- .../worker/src/worker/accessorHandlers/httpProxy.ts | 12 +++++++----- .../src/worker/accessorHandlers/localFolder.ts | 12 ++++++++---- 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/shared/packages/worker/src/worker/accessorHandlers/atem.ts b/shared/packages/worker/src/worker/accessorHandlers/atem.ts index 660b08d6..9339a7d6 100644 --- a/shared/packages/worker/src/worker/accessorHandlers/atem.ts +++ b/shared/packages/worker/src/worker/accessorHandlers/atem.ts @@ -45,11 +45,12 @@ export class ATEMAccessorHandle extends GenericAccessorHandle extends GenericAccessorHandle extends GenericAccessorHandle { diff --git a/shared/packages/worker/src/worker/accessorHandlers/fileShare.ts b/shared/packages/worker/src/worker/accessorHandlers/fileShare.ts index 34c2d182..02c2776b 100644 --- a/shared/packages/worker/src/worker/accessorHandlers/fileShare.ts +++ b/shared/packages/worker/src/worker/accessorHandlers/fileShare.ts @@ -72,12 +72,12 @@ export class FileShareAccessorHandle extends GenericFileAccessorHandle this.originalFolderPath = this.accessor.folderPath this.actualFolderPath = this.originalFolderPath // To be overwritten later + this.content = content // Verify content data: if (!content.onlyContainerAccess) { - if (!content.filePath && !this.accessor.filePath) - throw new Error('Bad input data: content.filePath not set!') + if (!this._getFilePath()) + throw new Error('Bad input data: neither content.filePath nor accessor.filePath are set!') } - this.content = content if (workOptions.removeDelay && typeof workOptions.removeDelay !== 'number') throw new Error('Bad input data: workOptions.removeDelay is not a number!') @@ -380,7 +380,7 @@ export class FileShareAccessorHandle extends GenericFileAccessorHandle get filePath(): string { if (this.content.onlyContainerAccess) throw new Error('onlyContainerAccess is set!') - const filePath = this.accessor.filePath || this.content.filePath + const filePath = this._getFilePath() if (!filePath) throw new Error(`FileShareAccessor: filePath not set!`) return filePath } @@ -619,6 +619,9 @@ export class FileShareAccessorHandle extends GenericFileAccessorHandle } return { success: true } } + private _getFilePath(): string | undefined { + return this.accessor.filePath || this.content.filePath + } } interface MappedDriveLetters { [driveLetter: string]: string diff --git a/shared/packages/worker/src/worker/accessorHandlers/http.ts b/shared/packages/worker/src/worker/accessorHandlers/http.ts index f76e83b6..fd73ad6f 100644 --- a/shared/packages/worker/src/worker/accessorHandlers/http.ts +++ b/shared/packages/worker/src/worker/accessorHandlers/http.ts @@ -45,10 +45,10 @@ export class HTTPAccessorHandle extends GenericAccessorHandle extends GenericAccessorHandle extends GenericAccessorHandle extends GenericAccessorHandle extends GenericAccessorHandle extends GenericAccessorHandle extends GenericFileAccessorHand ) { super(worker, accessorId, accessor, content, LocalFolderAccessorHandle.type) + this.content = content // Verify content data: if (!content.onlyContainerAccess) { - if (!content.filePath && !content.path && !this.accessor.filePath) - throw new Error('Bad input data: content.filePath nor content.path not set!') + if (!this._getFilePath()) + throw new Error('Bad input data: neither accessor.filePath, content.filePath nor content.path are set!') } - this.content = content if (workOptions.removeDelay && typeof workOptions.removeDelay !== 'number') throw new Error('Bad input data: workOptions.removeDelay is not a number!') @@ -334,10 +334,11 @@ export class LocalFolderAccessorHandle extends GenericFileAccessorHand get orgFolderPath(): string { return this.folderPath } + /** Local path to the Package, ie the File */ get filePath(): string { if (this.content.onlyContainerAccess) throw new Error('onlyContainerAccess is set!') - const filePath = this.accessor.filePath || this.content.filePath || this.content.path + const filePath = this._getFilePath() if (!filePath) throw new Error(`LocalFolderAccessor: filePath not set!`) return filePath } @@ -366,4 +367,7 @@ export class LocalFolderAccessorHandle extends GenericFileAccessorHand } return { success: true } } + private _getFilePath(): string | undefined { + return this.accessor.filePath || this.content.filePath || this.content.path + } } From 3a5df89215410b6eb625ce4a9dd37963ebb6a905 Mon Sep 17 00:00:00 2001 From: Johan Nyman Date: Mon, 22 Jan 2024 11:55:38 +0100 Subject: [PATCH 2/2] v1.43.1 --- CHANGELOG.md | 11 +++++++++++ apps/appcontainer-node/app/CHANGELOG.md | 8 ++++++++ apps/appcontainer-node/app/package.json | 4 ++-- apps/appcontainer-node/packages/generic/CHANGELOG.md | 8 ++++++++ apps/appcontainer-node/packages/generic/package.json | 4 ++-- apps/package-manager/app/CHANGELOG.md | 8 ++++++++ apps/package-manager/app/package.json | 4 ++-- apps/package-manager/packages/generic/CHANGELOG.md | 8 ++++++++ apps/package-manager/packages/generic/package.json | 6 +++--- apps/single-app/app/CHANGELOG.md | 8 ++++++++ apps/single-app/app/package.json | 8 ++++---- apps/worker/app/CHANGELOG.md | 8 ++++++++ apps/worker/app/package.json | 4 ++-- apps/worker/packages/generic/CHANGELOG.md | 8 ++++++++ apps/worker/packages/generic/package.json | 4 ++-- lerna.json | 2 +- shared/packages/expectationManager/CHANGELOG.md | 8 ++++++++ shared/packages/expectationManager/package.json | 4 ++-- shared/packages/worker/CHANGELOG.md | 11 +++++++++++ shared/packages/worker/package.json | 2 +- tests/internal-tests/CHANGELOG.md | 8 ++++++++ tests/internal-tests/package.json | 8 ++++---- 22 files changed, 119 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab0846f5..c7921ab2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + + +### Bug Fixes + +* refactor and fix issue with (wrongly) thown error "Error: Bad input data: content.filePath not set!" ([550e893](https://github.com/nrkno/tv-automation-package-manager/commit/550e8936cdbc464052d39c0efd5e60d3ece3a70d)) + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) diff --git a/apps/appcontainer-node/app/CHANGELOG.md b/apps/appcontainer-node/app/CHANGELOG.md index f294c7b0..238c740f 100644 --- a/apps/appcontainer-node/app/CHANGELOG.md +++ b/apps/appcontainer-node/app/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + +**Note:** Version bump only for package @appcontainer-node/app + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) **Note:** Version bump only for package @appcontainer-node/app diff --git a/apps/appcontainer-node/app/package.json b/apps/appcontainer-node/app/package.json index eebb699f..8ca10a7a 100644 --- a/apps/appcontainer-node/app/package.json +++ b/apps/appcontainer-node/app/package.json @@ -1,6 +1,6 @@ { "name": "@appcontainer-node/app", - "version": "1.43.0", + "version": "1.43.1", "description": "AppContainer-Node.js", "private": true, "scripts": { @@ -14,7 +14,7 @@ "nexe": "^3.3.7" }, "dependencies": { - "@appcontainer-node/generic": "1.43.0" + "@appcontainer-node/generic": "1.43.1" }, "prettier": "@sofie-automation/code-standard-preset/.prettierrc.json", "engines": { diff --git a/apps/appcontainer-node/packages/generic/CHANGELOG.md b/apps/appcontainer-node/packages/generic/CHANGELOG.md index cca856c6..03e86cc6 100644 --- a/apps/appcontainer-node/packages/generic/CHANGELOG.md +++ b/apps/appcontainer-node/packages/generic/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + +**Note:** Version bump only for package @appcontainer-node/generic + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) diff --git a/apps/appcontainer-node/packages/generic/package.json b/apps/appcontainer-node/packages/generic/package.json index 581a5607..c1a8ebed 100644 --- a/apps/appcontainer-node/packages/generic/package.json +++ b/apps/appcontainer-node/packages/generic/package.json @@ -1,6 +1,6 @@ { "name": "@appcontainer-node/generic", - "version": "1.43.0", + "version": "1.43.1", "private": true, "main": "dist/index.js", "types": "dist/index.d.ts", @@ -11,7 +11,7 @@ }, "dependencies": { "@sofie-package-manager/api": "1.43.0", - "@sofie-package-manager/worker": "1.43.0", + "@sofie-package-manager/worker": "1.43.1", "underscore": "^1.12.0" }, "devDependencies": { diff --git a/apps/package-manager/app/CHANGELOG.md b/apps/package-manager/app/CHANGELOG.md index da3e0df4..c25ac076 100644 --- a/apps/package-manager/app/CHANGELOG.md +++ b/apps/package-manager/app/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + +**Note:** Version bump only for package @package-manager/app + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) **Note:** Version bump only for package @package-manager/app diff --git a/apps/package-manager/app/package.json b/apps/package-manager/app/package.json index 6a027180..ff788225 100644 --- a/apps/package-manager/app/package.json +++ b/apps/package-manager/app/package.json @@ -1,6 +1,6 @@ { "name": "@package-manager/app", - "version": "1.43.0", + "version": "1.43.1", "private": true, "scripts": { "build": "yarn rimraf dist && yarn build:main", @@ -13,7 +13,7 @@ "nexe": "^3.3.7" }, "dependencies": { - "@package-manager/generic": "1.43.0" + "@package-manager/generic": "1.43.1" }, "prettier": "@sofie-automation/code-standard-preset/.prettierrc.json", "engines": { diff --git a/apps/package-manager/packages/generic/CHANGELOG.md b/apps/package-manager/packages/generic/CHANGELOG.md index ae9f5a56..2377f1ff 100644 --- a/apps/package-manager/packages/generic/CHANGELOG.md +++ b/apps/package-manager/packages/generic/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + +**Note:** Version bump only for package @package-manager/generic + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) **Note:** Version bump only for package @package-manager/generic diff --git a/apps/package-manager/packages/generic/package.json b/apps/package-manager/packages/generic/package.json index 678c88b4..a1ec8bd3 100644 --- a/apps/package-manager/packages/generic/package.json +++ b/apps/package-manager/packages/generic/package.json @@ -1,6 +1,6 @@ { "name": "@package-manager/generic", - "version": "1.43.0", + "version": "1.43.1", "private": true, "main": "dist/index.js", "types": "dist/index.d.ts", @@ -15,8 +15,8 @@ "dependencies": { "@parcel/watcher": "^2.3.0", "@sofie-package-manager/api": "1.43.0", - "@sofie-package-manager/expectation-manager": "1.43.0", - "@sofie-package-manager/worker": "1.43.0", + "@sofie-package-manager/expectation-manager": "1.43.1", + "@sofie-package-manager/worker": "1.43.1", "data-store": "^4.0.3", "deep-extend": "^0.6.0", "fast-clone": "^1.5.13", diff --git a/apps/single-app/app/CHANGELOG.md b/apps/single-app/app/CHANGELOG.md index d9fc5186..78d52d0d 100644 --- a/apps/single-app/app/CHANGELOG.md +++ b/apps/single-app/app/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + +**Note:** Version bump only for package @single-app/app + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) **Note:** Version bump only for package @single-app/app diff --git a/apps/single-app/app/package.json b/apps/single-app/app/package.json index 23de64a4..8088429a 100644 --- a/apps/single-app/app/package.json +++ b/apps/single-app/app/package.json @@ -1,6 +1,6 @@ { "name": "@single-app/app", - "version": "1.43.0", + "version": "1.43.1", "description": "Package Manager, http-proxy etc.. all in one application", "private": true, "scripts": { @@ -14,12 +14,12 @@ "nexe": "^3.3.7" }, "dependencies": { - "@appcontainer-node/generic": "1.43.0", + "@appcontainer-node/generic": "1.43.1", "@http-server/generic": "1.43.0", - "@package-manager/generic": "1.43.0", + "@package-manager/generic": "1.43.1", "@quantel-http-transformer-proxy/generic": "1.43.0", "@sofie-package-manager/api": "1.43.0", - "@sofie-package-manager/worker": "1.43.0", + "@sofie-package-manager/worker": "1.43.1", "@sofie-package-manager/workforce": "1.43.0", "underscore": "^1.12.0" }, diff --git a/apps/worker/app/CHANGELOG.md b/apps/worker/app/CHANGELOG.md index a4a1e261..5bae546c 100644 --- a/apps/worker/app/CHANGELOG.md +++ b/apps/worker/app/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + +**Note:** Version bump only for package @worker/app + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) **Note:** Version bump only for package @worker/app diff --git a/apps/worker/app/package.json b/apps/worker/app/package.json index a3c6aa8f..d9e9717e 100644 --- a/apps/worker/app/package.json +++ b/apps/worker/app/package.json @@ -1,6 +1,6 @@ { "name": "@worker/app", - "version": "1.43.0", + "version": "1.43.1", "description": "Boilerplace", "private": true, "scripts": { @@ -15,7 +15,7 @@ "nexe": "^3.3.7" }, "dependencies": { - "@worker/generic": "1.43.0" + "@worker/generic": "1.43.1" }, "prettier": "@sofie-automation/code-standard-preset/.prettierrc.json", "engines": { diff --git a/apps/worker/packages/generic/CHANGELOG.md b/apps/worker/packages/generic/CHANGELOG.md index 2935a447..4387185a 100644 --- a/apps/worker/packages/generic/CHANGELOG.md +++ b/apps/worker/packages/generic/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + +**Note:** Version bump only for package @worker/generic + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) **Note:** Version bump only for package @worker/generic diff --git a/apps/worker/packages/generic/package.json b/apps/worker/packages/generic/package.json index b38e92ee..0944af14 100644 --- a/apps/worker/packages/generic/package.json +++ b/apps/worker/packages/generic/package.json @@ -1,6 +1,6 @@ { "name": "@worker/generic", - "version": "1.43.0", + "version": "1.43.1", "private": true, "main": "dist/index.js", "types": "dist/index.d.ts", @@ -11,7 +11,7 @@ }, "dependencies": { "@sofie-package-manager/api": "1.43.0", - "@sofie-package-manager/worker": "1.43.0" + "@sofie-package-manager/worker": "1.43.1" }, "prettier": "@sofie-automation/code-standard-preset/.prettierrc.json", "engines": { diff --git a/lerna.json b/lerna.json index 851c4884..7a1fb18a 100644 --- a/lerna.json +++ b/lerna.json @@ -4,6 +4,6 @@ "apps/**", "tests/**" ], - "version": "1.43.0", + "version": "1.43.1", "npmClient": "yarn" } diff --git a/shared/packages/expectationManager/CHANGELOG.md b/shared/packages/expectationManager/CHANGELOG.md index f3f0b3a1..eb08497b 100644 --- a/shared/packages/expectationManager/CHANGELOG.md +++ b/shared/packages/expectationManager/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + +**Note:** Version bump only for package @sofie-package-manager/expectation-manager + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) **Note:** Version bump only for package @sofie-package-manager/expectation-manager diff --git a/shared/packages/expectationManager/package.json b/shared/packages/expectationManager/package.json index 4166f2c6..b4bd57b3 100644 --- a/shared/packages/expectationManager/package.json +++ b/shared/packages/expectationManager/package.json @@ -1,6 +1,6 @@ { "name": "@sofie-package-manager/expectation-manager", - "version": "1.43.0", + "version": "1.43.1", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", @@ -14,7 +14,7 @@ }, "dependencies": { "@sofie-package-manager/api": "1.43.0", - "@sofie-package-manager/worker": "1.43.0", + "@sofie-package-manager/worker": "1.43.1", "@supercharge/promise-pool": "^2.4.0", "underscore": "^1.12.0" }, diff --git a/shared/packages/worker/CHANGELOG.md b/shared/packages/worker/CHANGELOG.md index 8bcd3f11..34377335 100644 --- a/shared/packages/worker/CHANGELOG.md +++ b/shared/packages/worker/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + + +### Bug Fixes + +* refactor and fix issue with (wrongly) thown error "Error: Bad input data: content.filePath not set!" ([550e893](https://github.com/nrkno/tv-automation-package-manager/commit/550e8936cdbc464052d39c0efd5e60d3ece3a70d)) + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) **Note:** Version bump only for package @sofie-package-manager/worker diff --git a/shared/packages/worker/package.json b/shared/packages/worker/package.json index 9007f8de..6d030a8d 100644 --- a/shared/packages/worker/package.json +++ b/shared/packages/worker/package.json @@ -1,6 +1,6 @@ { "name": "@sofie-package-manager/worker", - "version": "1.43.0", + "version": "1.43.1", "main": "dist/index.js", "types": "dist/index.d.ts", "license": "MIT", diff --git a/tests/internal-tests/CHANGELOG.md b/tests/internal-tests/CHANGELOG.md index 44812fb2..8638a401 100644 --- a/tests/internal-tests/CHANGELOG.md +++ b/tests/internal-tests/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.43.1](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0...v1.43.1) (2024-01-22) + +**Note:** Version bump only for package @tests/internal-tests + + + + + # [1.43.0](https://github.com/nrkno/tv-automation-package-manager/compare/v1.43.0-alpha.2...v1.43.0) (2024-01-11) **Note:** Version bump only for package @tests/internal-tests diff --git a/tests/internal-tests/package.json b/tests/internal-tests/package.json index 591214e7..b206cd2c 100644 --- a/tests/internal-tests/package.json +++ b/tests/internal-tests/package.json @@ -1,6 +1,6 @@ { "name": "@tests/internal-tests", - "version": "1.43.0", + "version": "1.43.1", "description": "Internal tests", "private": true, "scripts": { @@ -15,10 +15,10 @@ }, "dependencies": { "@http-server/generic": "1.43.0", - "@package-manager/generic": "1.43.0", + "@package-manager/generic": "1.43.1", "@sofie-package-manager/api": "1.43.0", - "@sofie-package-manager/expectation-manager": "1.43.0", - "@sofie-package-manager/worker": "1.43.0", + "@sofie-package-manager/expectation-manager": "1.43.1", + "@sofie-package-manager/worker": "1.43.1", "@sofie-package-manager/workforce": "1.43.0", "underscore": "^1.12.0", "windows-network-drive": "^4.0.1"