diff --git a/.vsts/common/generate-sbom.yml b/.vsts/common/generate-sbom.yml new file mode 100644 index 0000000000..941760298d --- /dev/null +++ b/.vsts/common/generate-sbom.yml @@ -0,0 +1,6 @@ +steps: + - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: "SBOM Generation" + inputs: + BuildDropPath: ./release + diff --git a/.vsts/darwin/ci.yml b/.vsts/darwin/ci.yml index 94285bc1f1..add8622a2d 100644 --- a/.vsts/darwin/ci.yml +++ b/.vsts/darwin/ci.yml @@ -5,6 +5,7 @@ steps: . "$(Agent.WorkFolder)/.venv/batchexplorer/bin/activate" npm run build-and-pack displayName: Build and pack + - template: ../common/generate-sbom.yml - template: ../common/publish-artifacts.yml parameters: folder: darwin diff --git a/.vsts/distribution.yml b/.vsts/distribution.yml index 7c38f2f583..06447848da 100644 --- a/.vsts/distribution.yml +++ b/.vsts/distribution.yml @@ -2,7 +2,9 @@ jobs: - job: Linux pool: - vmImage: ubuntu-18.04 + name: Azure-Pipelines-EO-Batch-Explorer + demands: + - ImageOverride -equals BatchExplorerBuildImage-Linux steps: - template: ./linux/distribution.yml @@ -10,11 +12,16 @@ jobs: pool: vmImage: macOS-10.15 demands: xcode + variables: + - name: EOCompliance-Mac + value: true steps: - template: ./darwin/distribution.yml - job: Windows pool: - vmImage: vs2017-win2016 + name: Azure-Pipelines-EO-Batch-Explorer + demands: + - ImageOverride -equals BatchExplorerBuildImage-Windows steps: - template: ./win/distribution.yml diff --git a/.vsts/linux/ci.yml b/.vsts/linux/ci.yml index 3b326a76f5..926cc79169 100644 --- a/.vsts/linux/ci.yml +++ b/.vsts/linux/ci.yml @@ -31,6 +31,8 @@ steps: - script: npm run lint displayName: Lint + - template: ../common/generate-sbom.yml + - template: ../common/publish-artifacts.yml parameters: folder: linux diff --git a/.vsts/pipelines.yml b/.vsts/pipelines.yml index 3c4bb05c0d..fd6c81755c 100644 --- a/.vsts/pipelines.yml +++ b/.vsts/pipelines.yml @@ -2,27 +2,38 @@ name: $(SourceBranch)$(Rev:.r) jobs: - job: Linux pool: - vmImage: ubuntu-18.04 + name: Azure-Pipelines-EO-Batch-Explorer + demands: + - ImageOverride -equals BatchExplorerBuildImage-Linux steps: - - template: ./linux/ci.yml + - template: ./linux/ci.yml - job: MacOS pool: vmImage: macOS-10.15 demands: xcode + variables: + - name: EOCompliance-Mac + value: true steps: - - template: ./darwin/ci.yml + - template: ./darwin/ci.yml - job: Windows pool: - vmImage: windows-2019 + name: Azure-Pipelines-EO-Batch-Explorer + demands: + - ImageOverride -equals BatchExplorerBuildImage-Windows + variables: + Packaging.EnableSBOMSigning: true steps: - template: ./win/ci.yml - job: RegisterDependencies displayName: Register dependencies pool: - vmImage: vs2017-win2016 + name: Azure-Pipelines-EO-Batch-Explorer + demands: + - ImageOverride -equals BatchExplorerBuildImage-Windows condition: ne(variables['Build.Reason'], 'PullRequest') variables: EnableDetectorPip: true @@ -30,4 +41,4 @@ jobs: steps: - template: ./win/win-dependencies.yml - task: ComponentGovernanceComponentDetection@0 - displayName: 'Component Detection' + displayName: "Component Detection" diff --git a/.vsts/update-en-loc.yml b/.vsts/update-en-loc.yml index 0aa85caaec..8c790b7358 100644 --- a/.vsts/update-en-loc.yml +++ b/.vsts/update-en-loc.yml @@ -2,7 +2,9 @@ variables: locdir: $(Build.ArtifactStagingDirectory)/BatchExplorer pool: - vmImage: ubuntu-20.04 + name: Azure-Pipelines-EO-Batch-Explorer + demands: + - ImageOverride -equals BatchExplorerBuildImage-Linux steps: - task: NodeTool@0 inputs: diff --git a/.vsts/win/ci.yml b/.vsts/win/ci.yml index 6f1fdcd766..b7c6e7c243 100644 --- a/.vsts/win/ci.yml +++ b/.vsts/win/ci.yml @@ -1,7 +1,7 @@ steps: # Static analysis before build - task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2 - displayName: 'Run CredScan' + displayName: "Run CredScan" inputs: suppressionsFile: test/cred-scan-exclude.json toolMajorVersion: V2 @@ -21,18 +21,19 @@ steps: displayName: Running spectron - task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@3 - displayName: 'AntiMalware Scanner' + displayName: "AntiMalware Scanner" inputs: EnableServices: true - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2 - displayName: 'Publish Security Analysis Logs' + displayName: "Publish Security Analysis Logs" - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1 - displayName: 'Post Analysis' + displayName: "Post Analysis" inputs: CredScan: true + - template: ../common/generate-sbom.yml - template: ../common/publish-artifacts.yml parameters: diff --git a/package-lock.json b/package-lock.json index 6a12b898af..70b801ba8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "inflection": "^1.12.0", "js-yaml": "^3.14.0", "jschardet": "^2.2.1", - "keytar": "^5.6.0", + "keytar": "^7.7.0", "load-json-file": "^5.3.0", "luxon": "^1.24.1", "make-dir": "^2.1.0", @@ -3658,9 +3658,9 @@ "dev": true }, "node_modules/are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", "dependencies": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -13872,15 +13872,20 @@ "dev": true }, "node_modules/keytar": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/keytar/-/keytar-5.6.0.tgz", - "integrity": "sha512-ueulhshHSGoryfRXaIvTj0BV1yB0KddBGhGoqCxSN9LR1Ks1GKuuCdVhF+2/YOs5fMl6MlTI9On1a4DHDXoTow==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/keytar/-/keytar-7.7.0.tgz", + "integrity": "sha512-YEY9HWqThQc5q5xbXbRwsZTh2PJ36OSYRjSv3NN2xf5s5dpLTjEZnC2YikR29OaVybf9nQ0dJ/80i40RS97t/A==", "hasInstallScript": true, "dependencies": { - "nan": "2.14.1", - "prebuild-install": "5.3.3" + "node-addon-api": "^3.0.0", + "prebuild-install": "^6.0.0" } }, + "node_modules/keytar/node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" + }, "node_modules/keyv": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz", @@ -15144,7 +15149,9 @@ "node_modules/nan": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", + "dev": true, + "optional": true }, "node_modules/nanomatch": { "version": "1.2.13", @@ -15373,11 +15380,6 @@ "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==", "dev": true }, - "node_modules/noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" - }, "node_modules/normalize-package-data": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz", @@ -16858,25 +16860,23 @@ } }, "node_modules/prebuild-install": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.3.tgz", - "integrity": "sha512-GV+nsUXuPW2p8Zy7SarF/2W/oiK8bFQgJcncoJ0d7kRpekEA0ftChjfEaF9/Y+QJEc/wFR7RAEa8lYByuUIe2g==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", + "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", "dependencies": { "detect-libc": "^1.0.3", "expand-template": "^2.0.3", "github-from-package": "0.0.0", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", "napi-build-utils": "^1.0.1", - "node-abi": "^2.7.0", - "noop-logger": "^0.1.1", + "node-abi": "^2.21.0", "npmlog": "^4.0.1", "pump": "^3.0.0", "rc": "^1.2.7", "simple-get": "^3.0.3", "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0", - "which-pm-runs": "^1.0.0" + "tunnel-agent": "^0.6.0" }, "bin": { "prebuild-install": "bin.js" @@ -23687,17 +23687,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "node_modules/which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" - }, "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "dependencies": { - "string-width": "^1.0.2 || 2" + "string-width": "^1.0.2 || 2 || 3 || 4" } }, "node_modules/widest-line": { @@ -27143,9 +27138,9 @@ "dev": true }, "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -35279,12 +35274,19 @@ "dev": true }, "keytar": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/keytar/-/keytar-5.6.0.tgz", - "integrity": "sha512-ueulhshHSGoryfRXaIvTj0BV1yB0KddBGhGoqCxSN9LR1Ks1GKuuCdVhF+2/YOs5fMl6MlTI9On1a4DHDXoTow==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/keytar/-/keytar-7.7.0.tgz", + "integrity": "sha512-YEY9HWqThQc5q5xbXbRwsZTh2PJ36OSYRjSv3NN2xf5s5dpLTjEZnC2YikR29OaVybf9nQ0dJ/80i40RS97t/A==", "requires": { - "nan": "2.14.1", - "prebuild-install": "5.3.3" + "node-addon-api": "^3.0.0", + "prebuild-install": "^6.0.0" + }, + "dependencies": { + "node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" + } } }, "keyv": { @@ -36324,7 +36326,9 @@ "nan": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", + "dev": true, + "optional": true }, "nanomatch": { "version": "1.2.13", @@ -36532,11 +36536,6 @@ "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==", "dev": true }, - "noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" - }, "normalize-package-data": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz", @@ -37708,25 +37707,23 @@ "dev": true }, "prebuild-install": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.3.tgz", - "integrity": "sha512-GV+nsUXuPW2p8Zy7SarF/2W/oiK8bFQgJcncoJ0d7kRpekEA0ftChjfEaF9/Y+QJEc/wFR7RAEa8lYByuUIe2g==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz", + "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==", "requires": { "detect-libc": "^1.0.3", "expand-template": "^2.0.3", "github-from-package": "0.0.0", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", "napi-build-utils": "^1.0.1", - "node-abi": "^2.7.0", - "noop-logger": "^0.1.1", + "node-abi": "^2.21.0", "npmlog": "^4.0.1", "pump": "^3.0.0", "rc": "^1.2.7", "simple-get": "^3.0.3", "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0", - "which-pm-runs": "^1.0.0" + "tunnel-agent": "^0.6.0" } }, "prelude-ls": { @@ -43157,17 +43154,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" - }, "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "requires": { - "string-width": "^1.0.2 || 2" + "string-width": "^1.0.2 || 2 || 3 || 4" } }, "widest-line": { diff --git a/package.json b/package.json index 67df00aa15..3b01af52f8 100644 --- a/package.json +++ b/package.json @@ -195,7 +195,7 @@ "inflection": "^1.12.0", "js-yaml": "^3.14.0", "jschardet": "^2.2.1", - "keytar": "^5.6.0", + "keytar": "^7.7.0", "load-json-file": "^5.3.0", "luxon": "^1.24.1", "make-dir": "^2.1.0", diff --git a/test/spectron/test-app-start.spec.ts b/test/spectron/test-app-start.spec.ts index 5aa797457f..2a6dba7dee 100644 --- a/test/spectron/test-app-start.spec.ts +++ b/test/spectron/test-app-start.spec.ts @@ -28,17 +28,20 @@ describe("Bundled application is starting correctly", () => { } }); - it("Show the splash screen, auth window then login", async () => { + it("Show the splash screen, auth window, then login", async () => { await delay(2_000); // Splash screen + Auth window + Main window - expect(await app.client.getWindowCount()).toEqual(3); + expect(await app.client.getWindowCount()).toEqual(3, + "should have had 3 windows"); await switchToWindow(app, WindowType.main); - expect(await app.browserWindow.isVisible()).toBe(false); + expect(await app.browserWindow.isVisible()).toBe(false, + "browser window shouldn't be visible"); await switchToWindow(app, WindowType.splash); - expect(await app.browserWindow.isVisible()).toBe(true); + expect(await app.browserWindow.isVisible()).toBe(true, + "browser window should be visible"); expect(await app.browserWindow.getBounds()).toEqual(jasmine.objectContaining({ width: 340, height: 340, @@ -52,7 +55,7 @@ describe("Bundled application is starting correctly", () => { expect(await app.browserWindow.getBounds()).toEqual(jasmine.objectContaining({ width: 800, height: 700, - })); + }), "browser window should be 800x700"); await signIn(app.client); await app.client.waitUntil(async () => { @@ -61,7 +64,8 @@ describe("Bundled application is starting correctly", () => { await switchToWindow(app, WindowType.main); - expect(await app.browserWindow.isVisible()).toBe(true); + expect(await app.browserWindow.isVisible()).toBe(true, + "browser window should be visible"); expect(await app.browserWindow.getTitle()).toEqual("Batch Explorer"); await app.client.waitUntilTextExists("bl-account-list .quick-list-row-title", "0prodtest", 60_000); @@ -132,7 +136,7 @@ async function switchToWindow(app: Application, type: WindowType) { } } throw new Error(`Could not find window ${type}`); - } +} function windowMatcher(type: WindowType) { switch (type) {