From 1227e9b83a732d9781e2bb9c4c4141336c1281a3 Mon Sep 17 00:00:00 2001 From: Volker Scheuber Date: Sun, 21 May 2023 20:18:42 -0500 Subject: [PATCH 01/27] reset arm64 runner to use node 16 --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index efff3acf8..50b68c5d8 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -456,7 +456,7 @@ jobs: runs-on: self-hosted strategy: matrix: - node-version: [18] + node-version: [16] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - name: Checkout repository From 1b9b3fe3bb308bfd7f831314ea2858851a4d9f4f Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 22 May 2023 01:15:32 +0000 Subject: [PATCH 02/27] Updated changelog for release v0.24.1-0 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be319083e..d4f349535 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.24.1-0] - 2023-05-22 + ### Added - Support for authorization policies, policy sets, and resource types through new `authz` commands: @@ -1170,7 +1172,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed problem with adding connection profiles - Miscellaneous bug fixes -[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1...HEAD +[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1-0...HEAD + +[0.24.1-0]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1...v0.24.1-0 [0.24.1]: https://github.com/rockcarver/frodo-cli/compare/v0.24.0...v0.24.1 From da4949ac434068f3a9abed604ab8c3cd0a255daa Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 22 May 2023 01:15:47 +0000 Subject: [PATCH 03/27] ci: version bump to v0.24.1-0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b7d2dfe4..5f5478acb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rockcarver/frodo-cli", - "version": "0.24.1", + "version": "0.24.1-0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rockcarver/frodo-cli", - "version": "0.24.1", + "version": "0.24.1-0", "license": "MIT", "dependencies": { "@rockcarver/frodo-lib": "0.19.1", diff --git a/package.json b/package.json index b7ef3aa99..07ec1002e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rockcarver/frodo-cli", - "version": "0.24.0", + "version": "0.24.1-0", "type": "module", "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.", "keywords": [ From d75604e40f59d26adf8aef0f3f059c123107bcdb Mon Sep 17 00:00:00 2001 From: Volker Scheuber Date: Sun, 21 May 2023 20:21:06 -0500 Subject: [PATCH 04/27] reset version and changelog to 0.24.0 --- CHANGELOG.md | 2 -- package.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4f349535..74263e562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.24.1-0] - 2023-05-22 - ### Added - Support for authorization policies, policy sets, and resource types through new `authz` commands: diff --git a/package.json b/package.json index 07ec1002e..b7ef3aa99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rockcarver/frodo-cli", - "version": "0.24.1-0", + "version": "0.24.0", "type": "module", "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.", "keywords": [ From 9f0eba34f070cf6b1382eb211e20725273df6de5 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 22 May 2023 01:28:54 +0000 Subject: [PATCH 05/27] Updated changelog for release v0.24.1 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74263e562..ca682fe10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.24.1] - 2023-05-22 + ### Added - Support for authorization policies, policy sets, and resource types through new `authz` commands: @@ -1170,7 +1172,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed problem with adding connection profiles - Miscellaneous bug fixes -[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1-0...HEAD +[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1...HEAD + +[0.24.1]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1-0...v0.24.1 [0.24.1-0]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1...v0.24.1-0 From 22709dd3f16da8f9fdeaf93c65ac2e05581a389d Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 22 May 2023 01:29:07 +0000 Subject: [PATCH 06/27] ci: version bump to v0.24.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f5478acb..7b7d2dfe4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rockcarver/frodo-cli", - "version": "0.24.1-0", + "version": "0.24.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rockcarver/frodo-cli", - "version": "0.24.1-0", + "version": "0.24.1", "license": "MIT", "dependencies": { "@rockcarver/frodo-lib": "0.19.1", diff --git a/package.json b/package.json index b7ef3aa99..fcc8a33f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rockcarver/frodo-cli", - "version": "0.24.0", + "version": "0.24.1", "type": "module", "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.", "keywords": [ From 78f21493e18246f756dc7317d855ecdd7c025af2 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 22 May 2023 01:30:55 +0000 Subject: [PATCH 07/27] ci: version bump to v0.24.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b7d2dfe4..29e3690b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rockcarver/frodo-cli", - "version": "0.24.1", + "version": "0.24.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rockcarver/frodo-cli", - "version": "0.24.1", + "version": "0.24.2", "license": "MIT", "dependencies": { "@rockcarver/frodo-lib": "0.19.1", diff --git a/package.json b/package.json index fcc8a33f4..a5c69c46a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rockcarver/frodo-cli", - "version": "0.24.1", + "version": "0.24.2", "type": "module", "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.", "keywords": [ From ce0930a29884e05f2239f9854f6a905288ee5666 Mon Sep 17 00:00:00 2001 From: Volker Scheuber Date: Mon, 22 May 2023 23:30:33 -0500 Subject: [PATCH 08/27] update changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca682fe10..d4545d37e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.24.1] - 2023-05-22 +## [0.24.2] - 2023-05-22 ### Added @@ -67,6 +67,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - \#214: Fixed a regression introduced in #186, which 'swallowed' `frodo` command exit codes and resulted in always exiting with 0 even if a `frodo` command returned with a different exit code. +## [0.24.1] - 2023-05-22 [YANKED] + +## [0.24.1-0] - 2023-05-22 [YANKED] + ## [0.24.0] - 2023-05-21 [YANKED] ## [0.23.1-8] - 2023-05-21 From 4d48f129a28a982668784d9d7b40f8f26ce14b03 Mon Sep 17 00:00:00 2001 From: Volker Scheuber Date: Thu, 25 May 2023 13:38:51 -0500 Subject: [PATCH 09/27] implements rockcarver/frodo-lib#248 - Refactor logging api/ops and move cli functions into frodo-cli --- src/cli/logging/logs-fetch.ts | 3 +- src/cli/logging/logs-list.ts | 3 +- src/cli/logging/logs-tail.ts | 3 +- src/ops/LogOps.ts | 152 ++++++++++++++++++++++++++++++++++ src/utils/Config.ts | 6 +- 5 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 src/ops/LogOps.ts diff --git a/src/cli/logging/logs-fetch.ts b/src/cli/logging/logs-fetch.ts index 9b6e5a91d..1c3e3aa6c 100644 --- a/src/cli/logging/logs-fetch.ts +++ b/src/cli/logging/logs-fetch.ts @@ -9,8 +9,9 @@ import { } from '@rockcarver/frodo-lib'; import * as config from '../../utils/Config'; import { printMessage } from '../../utils/Console'; +import { fetchLogs, provisionCreds } from '../../ops/LogOps'; -const { provisionCreds, fetchLogs, resolveLevel } = Log; +const { resolveLevel } = Log; const { getConnectionProfile, saveConnectionProfile } = ConnectionProfile; const { getTokens } = Authenticate; diff --git a/src/cli/logging/logs-list.ts b/src/cli/logging/logs-list.ts index e50af270a..e41fe7545 100644 --- a/src/cli/logging/logs-list.ts +++ b/src/cli/logging/logs-list.ts @@ -6,8 +6,9 @@ import { state, } from '@rockcarver/frodo-lib'; import { printMessage, verboseMessage } from '../../utils/Console'; +import { provisionCreds } from '../../ops/LogOps'; -const { provisionCreds, getLogSources } = Log; +const { getLogSources } = Log; const { getConnectionProfile, saveConnectionProfile } = ConnectionProfile; const { getTokens } = Authenticate; diff --git a/src/cli/logging/logs-tail.ts b/src/cli/logging/logs-tail.ts index 8b512b403..4cfa45012 100644 --- a/src/cli/logging/logs-tail.ts +++ b/src/cli/logging/logs-tail.ts @@ -9,8 +9,9 @@ import { } from '@rockcarver/frodo-lib'; import * as config from '../../utils/Config'; import { printMessage } from '../../utils/Console'; +import { provisionCreds, tailLogs } from '../../ops/LogOps'; -const { provisionCreds, tailLogs, resolveLevel } = Log; +const { resolveLevel } = Log; const { getConnectionProfile, saveConnectionProfile } = ConnectionProfile; const { getTokens } = Authenticate; diff --git a/src/ops/LogOps.ts b/src/ops/LogOps.ts new file mode 100644 index 000000000..69d13aa62 --- /dev/null +++ b/src/ops/LogOps.ts @@ -0,0 +1,152 @@ +import { LogEventPayloadSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes'; +import { printMessage, verboseMessage } from '../utils/Console'; +import { Log, state } from '@rockcarver/frodo-lib'; + +const { + getDefaultNoiseFilter, + tail, + fetch, + getLogApiKeys, + resolvePayloadLevel, + createAPIKeyAndSecret, +} = Log; + +export async function tailLogs( + source: string, + levels: string[], + txid: string, + cookie: string, + nf: string[] +) { + try { + const logsObject = await tail(source, cookie); + let filteredLogs = []; + const noiseFilter = nf == null ? getDefaultNoiseFilter() : nf; + if (Array.isArray(logsObject.result)) { + filteredLogs = logsObject.result.filter( + (el) => + !noiseFilter.includes( + (el.payload as LogEventPayloadSkeleton).logger + ) && + !noiseFilter.includes(el.type) && + (levels[0] === 'ALL' || levels.includes(resolvePayloadLevel(el))) && + (typeof txid === 'undefined' || + txid === null || + (el.payload as LogEventPayloadSkeleton).transactionId?.includes( + txid + )) + ); + } + + filteredLogs.forEach((e) => { + printMessage(JSON.stringify(e), 'data'); + }); + + setTimeout(() => { + tailLogs(source, levels, txid, logsObject.pagedResultsCookie, nf); + }, 5000); + return null; + } catch (e) { + printMessage(`tail ERROR: tail data error - ${e}`, 'error'); + return `tail ERROR: tail data error - ${e}`; + } +} + +export async function provisionCreds() { + try { + let keyName = `frodo-${state.getUsername()}`; + try { + const keys = await getLogApiKeys(); + for (const key of keys) { + if (key.name === keyName) { + // append current timestamp to name if the named key already exists + keyName = `${keyName}-${new Date().toISOString()}`; + } + } + try { + const resp = await createAPIKeyAndSecret(keyName); + if (resp.name !== keyName) { + printMessage( + `create keys ERROR: could not create log API key ${keyName}`, + 'error' + ); + return null; + } + verboseMessage( + `Created a new log API key [${keyName}] in ${state.getHost()}` + ); + return resp; + } catch (error) { + printMessage( + `create keys ERROR: create keys call returned ${error}`, + 'error' + ); + return null; + } + } catch (error) { + printMessage(`get keys ERROR: get keys call returned ${error}`, 'error'); + } + } catch (e) { + printMessage(`create keys ERROR: create keys data error - ${e}`, 'error'); + return null; + } +} + +export async function fetchLogs( + source: string, + startTs: string, + endTs: string, + levels: string[], + txid: string, + ffString: string, + cookie: string, + nf: string[] +) { + try { + const logsObject = await fetch(source, startTs, endTs, cookie); + let filteredLogs = []; + const noiseFilter = nf == null ? getDefaultNoiseFilter() : nf; + if (Array.isArray(logsObject.result)) { + filteredLogs = logsObject.result.filter( + (el) => + !noiseFilter.includes( + (el.payload as LogEventPayloadSkeleton).logger + ) && + !noiseFilter.includes(el.type) && + (levels[0] === 'ALL' || levels.includes(resolvePayloadLevel(el))) && + (typeof txid === 'undefined' || + txid === null || + (el.payload as LogEventPayloadSkeleton).transactionId?.includes( + txid + )) + ); + } + + filteredLogs.forEach((e) => { + const log = JSON.stringify(e, null, 2); + if (ffString) { + if (log.includes(ffString)) { + printMessage(log, 'data'); + } + } else { + printMessage(log, 'data'); + } + }); + if (logsObject.pagedResultsCookie != null) { + await fetchLogs( + source, + startTs, + endTs, + levels, + txid, + ffString, + logsObject.pagedResultsCookie, + nf + ); + } + return null; + } catch (e) { + printMessage(`fetch ERROR: fetch data error - ${e}`, 'error'); + return `fetch ERROR: fetch data error - ${e}`; + } +} diff --git a/src/utils/Config.ts b/src/utils/Config.ts index 07a3e53b1..94d01b4d8 100644 --- a/src/utils/Config.ts +++ b/src/utils/Config.ts @@ -4,7 +4,7 @@ import { Log } from '@rockcarver/frodo-lib'; import { printMessage } from './Console'; -const { defaultNoiseFilter } = Log; +const { getDefaultNoiseFilter } = Log; export const FRODO_CONFIG_PATH_KEY = 'FRODO_CONFIG_PATH'; export const FRODO_LOG_NOISEFILTER_FILENAME = 'LoggingNoiseFilter.json'; @@ -29,12 +29,12 @@ export function getNoiseFilters(defaults: boolean): Array { const filename = `${getConfigPath()}/${FRODO_LOG_NOISEFILTER_FILENAME}`; if (defaults) { printMessage(`Using default logging noise filters.`, 'info'); - return defaultNoiseFilter(); + return getDefaultNoiseFilter(); } let noiseFilter = getCustomNoiseFilters(); if (noiseFilter.length == 0) { printMessage(`No custom noise filters defined. Using defaults.`, 'info'); - noiseFilter = defaultNoiseFilter(); + noiseFilter = getDefaultNoiseFilter(); try { fs.writeFileSync(filename, JSON.stringify(noiseFilter, null, 2)); printMessage( From a41bcb40e8b48acd460269bd28f7a84ef17fa9de Mon Sep 17 00:00:00 2001 From: Volker Scheuber Date: Thu, 25 May 2023 13:50:11 -0500 Subject: [PATCH 10/27] implements rockcarver/frodo-lib#248 - Refactor logging api/ops and move cli functions into frodo-cli --- src/cli/conn/conn-save.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cli/conn/conn-save.ts b/src/cli/conn/conn-save.ts index 513c76ae7..b1822b3c8 100644 --- a/src/cli/conn/conn-save.ts +++ b/src/cli/conn/conn-save.ts @@ -3,14 +3,13 @@ import { Option } from 'commander'; import { Authenticate, ConnectionProfile, - Log, ServiceAccount, state, constants, } from '@rockcarver/frodo-lib'; -const { provisionCreds } = Log; import { verboseMessage, printMessage } from '../../utils/Console'; import { addExistingServiceAccount } from '../../ops/ConnectionProfileOps.js'; +import { provisionCreds } from '../../ops/LogOps'; const { getTokens } = Authenticate; const { saveConnectionProfile, addNewServiceAccount } = ConnectionProfile; From c9e4414adb08901f685c0de5fbd5ff5de9e35a12 Mon Sep 17 00:00:00 2001 From: Volker Scheuber Date: Thu, 25 May 2023 14:12:12 -0500 Subject: [PATCH 11/27] update to frodo-lib 0.19.2 --- CHANGELOG.md | 4 ++++ package-lock.json | 8 ++++---- package.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4545d37e..d2ae9b460 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update to frodo-lib 0.19.2 + ## [0.24.2] - 2023-05-22 ### Added diff --git a/package-lock.json b/package-lock.json index 29e3690b7..50e6d55fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.24.2", "license": "MIT", "dependencies": { - "@rockcarver/frodo-lib": "0.19.1", + "@rockcarver/frodo-lib": "0.19.2", "chokidar": "^3.5.3", "cli-progress": "^3.11.2", "cli-table3": "^0.6.3", @@ -2899,9 +2899,9 @@ } }, "node_modules/@rockcarver/frodo-lib": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/@rockcarver/frodo-lib/-/frodo-lib-0.19.1.tgz", - "integrity": "sha512-oG27WbGtwDcwiWA287fKUyNpbo1vkXK+VHa2NJfSeUu+dBkl6KgdIKADvoi9AjcRqlyELKKlQ7Z3qLwwKRRutA==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@rockcarver/frodo-lib/-/frodo-lib-0.19.2.tgz", + "integrity": "sha512-02gzQiaQLAc1Pi3Sg/uUNZJmL9Hh3sb3e1s/uZMVbiKmowbJ3pLtlG+olLwihd6HSCd0suWE5LZzXBF2yVQZmA==", "dependencies": { "@pollyjs/adapter-node-http": "^6.0.5", "@pollyjs/core": "^6.0.5", diff --git a/package.json b/package.json index a5c69c46a..effe8dc9c 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ ] }, "dependencies": { - "@rockcarver/frodo-lib": "0.19.1", + "@rockcarver/frodo-lib": "0.19.2", "chokidar": "^3.5.3", "cli-progress": "^3.11.2", "cli-table3": "^0.6.3", From 9a2e950563f05adc4850b73df3e0ad9eb07227a8 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Thu, 25 May 2023 19:26:59 +0000 Subject: [PATCH 12/27] Updated changelog for release v0.24.3 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2ae9b460..d59b60c48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.24.3] - 2023-05-25 + ### Changed - Update to frodo-lib 0.19.2 @@ -1180,7 +1182,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed problem with adding connection profiles - Miscellaneous bug fixes -[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1...HEAD +[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.24.3...HEAD + +[0.24.3]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1...v0.24.3 [0.24.1]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1-0...v0.24.1 From a1b06f658f5bfe350d207e7c435468b7dae15e4d Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Thu, 25 May 2023 19:27:12 +0000 Subject: [PATCH 13/27] ci: version bump to v0.24.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 50e6d55fd..1eada40c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rockcarver/frodo-cli", - "version": "0.24.2", + "version": "0.24.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rockcarver/frodo-cli", - "version": "0.24.2", + "version": "0.24.3", "license": "MIT", "dependencies": { "@rockcarver/frodo-lib": "0.19.2", diff --git a/package.json b/package.json index effe8dc9c..8fa843f94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rockcarver/frodo-cli", - "version": "0.24.2", + "version": "0.24.3", "type": "module", "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.", "keywords": [ From 7dccf8180da71b6337274621f8a3acd48adc9e09 Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Sun, 28 May 2023 07:51:47 -0600 Subject: [PATCH 14/27] Remove references to gulp --- babel.config.cjs.json | 7 +++++++ package.json | 23 ++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 babel.config.cjs.json diff --git a/babel.config.cjs.json b/babel.config.cjs.json new file mode 100644 index 000000000..aaaed21e8 --- /dev/null +++ b/babel.config.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "./babel.config.esm.json", + "plugins": [ + ["@babel/plugin-transform-modules-commonjs", { "importInterop": "babel" }], + ["babel-plugin-transform-import-meta"] + ] +} diff --git a/package.json b/package.json index 8fa843f94..2eb2d9e67 100644 --- a/package.json +++ b/package.json @@ -29,15 +29,25 @@ }, "main": "esm/launch.js", "scripts": { - "test": "npx tsc && node --experimental-vm-modules node_modules/jest/bin/jest.js", + "rockcarver-frodo-lib": "find src -type f -name \"*.ts\" -exec sed -i \"s#@trivir/frodo-lib#@rockcarver/frodo-lib#g\" {} + && sed -i \"s/@trivir\\/frodo-lib\\//@rockcarver\\/frodo-lib\\//g\" package.json", + "trivir-frodo-lib": "npm uninstall @rockcarver/frodo-lib && npm install @trivir/frodo-lib && find src -type f -name \"*.ts\" -exec sed -i \"s#@rockcarver/frodo-lib#@trivir/frodo-lib#g\" {} + && sed -i \"s/@rockcarver\\/frodo-lib\\//@trivir\\/frodo-lib\\//g\" package.json", + "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", "test:local": "npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js", "test:debug": "node --no-warnings --experimental-vm-modules --experimental-specifier-resolution=node node_modules/jest/bin/jest.js --verbose=true --silent=false", "lint": "npx eslint --ext .ts --ignore-path .gitignore .", "lint:fix": "npx eslint --fix --ext .ts --ignore-path .gitignore .", - "build": "npx tsc && npx gulp", - "build:local": "npx tsc && npx gulp build-local", - "build:binary": "npx tsc && npx gulp build-binary", - "watch": "npx gulp watch" + "build": "tsc && npm run build:local && npm run build:binary", + "clean-esm": "rimraf esm", + "transpile-esm": "babel --out-dir esm --extensions \".ts\" --source-maps --config-file ./babel.config.esm.json src", + "build:local": "tsc && npm run clean-esm && npm run transpile-esm", + "dist-clean": "rimraf dist/src", + "dist-package": "json -f package.json -e \"delete this.type; this.main = 'src/app.js'; this.bin.frodo = './src/app.js';\" > dist/package.json", + "dist-install": "cd dist && npm install", + "dist-transpile": "babel --out-dir dist/src --extensions \".ts\" --source-maps --config-file ./babel.config.cjs.json src", + "dist-pkg": "pkg -C Gzip -t node18 -o dist/bin/frodo dist", + "build:binary": "tsc && npm run dist-clean && npm run dist-package && npm run dist-install && npm run dist-transpile && npm run dist-pkg", + "link-frodo-lib": "npm link ../frodo-lib", + "watch": "npm run link-frodo-lib && babel --watch --out-dir esm --extensions \".ts\" --source-maps --config-file ./babel.config.esm.json src" }, "jest": { "testTimeout": 30000 @@ -116,6 +126,7 @@ "yesno": "^0.4.0" }, "devDependencies": { + "@babel/cli": "^7.21.5", "@babel/eslint-parser": "^7.18.9", "@babel/plugin-syntax-import-assertions": "^7.20.0", "@babel/plugin-transform-modules-commonjs": "^7.19.6", @@ -144,9 +155,11 @@ "gulp-rename": "^2.0.0", "gulp-sourcemaps": "^3.0.0", "jest": "^29.3.1", + "json": "^11.0.0", "map-stream": "^0.0.7", "pkg": "^5.8.0", "prettier": "^2.7.1", + "rimraf": "^5.0.1", "typescript": "^4.9.3" } } From 269db13e06dbe79aad78a8a97fa23bfe0fdff5e4 Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Sun, 28 May 2023 07:53:02 -0600 Subject: [PATCH 15/27] Add workflow for TriVir build --- .github/workflows/trivir.yml | 484 +++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 485 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/trivir.yml diff --git a/.github/workflows/trivir.yml b/.github/workflows/trivir.yml new file mode 100644 index 000000000..57e77c66a --- /dev/null +++ b/.github/workflows/trivir.yml @@ -0,0 +1,484 @@ +name: 'Frodo CLI Release Pipeline' + +on: + push: + branches: + - 'trivir' + workflow_dispatch: + +env: + NODE_VERSION: 18 + +jobs: + build: + name: 'Build' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: TriVir changes + run: | + npm run trivir-frodo-lib + npm ci + + - name: 'Prepare Version Bump' + id: version-bump + uses: 'phips28/gh-action-bump-version@master' + with: + version-type: 'prerelease' + major-wording: 'MAJOR RELEASE' + minor-wording: 'MINOR RELEASE' + patch-wording: 'PATCH RELEASE' + rc-wording: '' + tag-prefix: 'v' + default: prerelease + preid: 'trivir' + bump-policy: 'ignore' + skip-commit: 'true' + skip-tag: 'true' + skip-push: 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: 'Version From Tag' + id: version-from-tag + run: echo "::set-output name=version::$(echo '${{ steps.version-bump.outputs.newTag }}' | sed 's/v//')" + + - name: Build frodo-cli + run: | + npm run build:local + + - name: Build frodo-cli cjs + run: | + npm run dist-package + npm run dist-transpile + + - name: Lint + run: | + npm run lint + + - name: Type Check + run: | + npx tsc + + - name: Security Audit + run: | + npm audit --omit=dev + + - uses: actions/upload-artifact@v3 + with: + name: build + path: | + package.json + package-lock.json + esm + dist + + outputs: + newTag: ${{ steps.version-bump.outputs.newTag }} + newVersion: ${{ steps.version-from-tag.outputs.version }} + preRelease: ${{ contains(steps.version-bump.outputs.newTag, '-') }} + + smoke-tests: + name: 'Smoke Tests' + needs: build + # You must use a Linux environment when using service containers or container jobs + runs-on: ubuntu-latest +# strategy: +# matrix: +# node-version: [20, 18, 16, 14] +# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ +# +# # Service containers to run with `smoke-tests` +# services: +# # Label used to access the service container +# squid: +# # Docker Hub image +# image: ubuntu/squid +# # +# ports: +# # Maps tcp port 3128 on the host to the same port in the service container +# - 3128:3128 +# + steps: + - name: Checkout repository + uses: actions/checkout@v3 +# +# - name: Use Node.js ${{ matrix.node-version }} +# uses: actions/setup-node@v2 +# with: +# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ +# node-version: ${{ matrix.node-version }} +# cache: 'npm' +# +# # Update npm for older node versions to avoid errors with npm ci due to newer package-lock.json format +# # TODO: conditionally update npm when it is older than the required version +# - name: Update npm +# run: npm install -g npm +# +# - uses: actions/download-artifact@v3 +# with: +# name: build +# +# - name: Install dependencies +# run: npm ci +# +# - name: Install frodo-cli globally +# run: npm i -g +# +# - name: CLI Help Tests +# run: | +# npm test +# +# - name: Version Test +# run: | +# frodo -v +# +# - name: Direct Tests +# env: +# FIDC_TENANT_URL: ${{ secrets.FIDC_TENANT_URL }} +# FIDC_TENANT_ADMIN_USERNAME: ${{ secrets.FIDC_TENANT_ADMIN_USERNAME }} +# FIDC_TENANT_ADMIN_PASSWORD: ${{ secrets.FIDC_TENANT_ADMIN_PASSWORD }} +# run: | +# frodo conn add "$FIDC_TENANT_URL" "$FIDC_TENANT_ADMIN_USERNAME" "$FIDC_TENANT_ADMIN_PASSWORD" +# frodo info "$FIDC_TENANT_URL" +# +# - name: Proxy Tests +# env: +# HTTPS_PROXY: 'http://127.0.0.1:3128' +# FIDC_TENANT_URL: ${{ secrets.FIDC_TENANT_URL }} +# FIDC_TENANT_ADMIN_USERNAME: ${{ secrets.FIDC_TENANT_ADMIN_USERNAME }} +# FIDC_TENANT_ADMIN_PASSWORD: ${{ secrets.FIDC_TENANT_ADMIN_PASSWORD }} +# run: | +# frodo conn add "$FIDC_TENANT_URL" "$FIDC_TENANT_ADMIN_USERNAME" "$FIDC_TENANT_ADMIN_PASSWORD" +# frodo info "$FIDC_TENANT_URL" + + release: +# needs: [build, linux-binary-release, linux-arm64-binary-release, macos-binary-release, npm-release, windows-binary-release] + needs: [build, linux-binary-release, macos-binary-release, npm-release, windows-binary-release] + name: 'Release' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: actions/download-artifact@v3 + with: + name: build + + - uses: actions/download-artifact@v3 + with: + name: dist + + - name: 'Github SHA' + id: github-sha + run: echo ${{ github.sha }} > Release.txt + + - name: Update Changelog + uses: thomaseizinger/keep-a-changelog-new-release@1.3.0 + with: + tag: ${{ needs.build.outputs.newTag }} + + - name: 'Output Changelog' + run: cat CHANGELOG.md + + - name: 'Release Header' + id: release-header + run: echo "header=$(echo `grep '## \\[${{ needs.build.outputs.newVersion }}] -' CHANGELOG.md | sed 's/## //' | sed 's/\\[//' | sed 's/]//'`)" >> "$GITHUB_OUTPUT" + + - name: 'Extract Release Notes' + id: extract-release-notes + uses: 'dahlia/submark@main' + with: + input-file: 'CHANGELOG.md' + heading-level: 2 + heading-title-text: '${{ steps.release-header.outputs.header }}' + ignore-case: true + omit-heading: true + + - name: Commit updated changelog and version + id: commit-changelog + #TODO: Figure out what values we should use for user.name and user.email + run: | + git config user.name "Automated Version Bump" + git config user.email "gh-action-bump-version@users.noreply.github.com" + git add CHANGELOG.md package.json + git commit --message "Updated changelog and version for release ${{ needs.build.outputs.newTag }}" + git push + + - name: Release + uses: softprops/action-gh-release@v1 + with: + name: Frodo CLI ${{ needs.build.outputs.newVersion }} + tag_name: ${{ needs.build.outputs.newTag }} + body: ${{ steps.extract-release-notes.outputs.output-text }} + prerelease: ${{ needs.build.outputs.preRelease }} + generate_release_notes: ${{ contains(needs.build.outputs.newTag, '-') }} + files: | + CHANGELOG.md + LICENSE + Release.txt + frodo-linux-${{ needs.build.outputs.newVersion }}.zip + frodo-macos-${{ needs.build.outputs.newVersion }}.zip + frodo-win-${{ needs.build.outputs.newVersion }}.zip +# frodo-linux-arm64-${{ needs.build.outputs.newVersion }}.zip + token: ${{ secrets.GITHUB_TOKEN }} + + npm-release: + # npm-release only needs the build job but since it is inconvenient to unpublish an npm we want this job to run last + # needs: [build, linux-binary-release, linux-arm64-binary-release, macos-binary-release, windows-binary-release] + needs: [build, linux-binary-release, macos-binary-release, windows-binary-release] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - uses: actions/download-artifact@v3 + with: + name: build + + - name: Install dependencies + run: npm ci + + - name: Pre-Release + if: ${{ fromJSON(needs.build.outputs.preRelease) }} + uses: JS-DevTools/npm-publish@v1 + with: + access: public + tag: 'next' + token: ${{ secrets.NPM_ACCESS_TOKEN }} + + - name: Release + if: ${{ ! fromJSON(needs.build.outputs.preRelease) }} + uses: JS-DevTools/npm-publish@v1 + with: + access: public + token: ${{ secrets.NPM_ACCESS_TOKEN }} + + - name: Add next tag + if: ${{ ! fromJSON(needs.build.outputs.preRelease) }} + run: | + export INPUT_TOKEN=${{ secrets.NPM_ACCESS_TOKEN }} + npm whoami + npm dist-tag add @trivir/frodo-cli@${{ needs.build.outputs.newVersion }} next + + macos-binary-release: + needs: [build, smoke-tests] + runs-on: macos-latest + timeout-minutes: 15 + steps: + - name: Install the Apple certificate + env: + DEVELOPMENT_CERTIFICATE_DATA: ${{ secrets.DEVELOPMENT_CERTIFICATE_DATA }} + DEVELOPMENT_CERTIFICATE_PASSPHRASE: ${{ secrets.DEVELOPMENT_CERTIFICATE_PASSPHRASE }} + INTERMEDIATE_CERTIFICATE_DATA: ${{ secrets.INTERMEDIATE_CERTIFICATE_DATA }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + run: | + # create variables + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + INTERMEDIATE_CERTIFICATE_PATH=$RUNNER_TEMP/intermediate_certificate.p12 + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + + # import certificates from secrets + echo -n "$DEVELOPMENT_CERTIFICATE_DATA" | base64 --decode --output $CERTIFICATE_PATH + echo -n "$INTERMEDIATE_CERTIFICATE_DATA" | base64 --decode --output $INTERMEDIATE_CERTIFICATE_PATH + + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$DEVELOPMENT_CERTIFICATE_PASSPHRASE" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + #security import $INTERMEDIATE_CERTIFICATE_PATH -P "$DEVELOPMENT_CERTIFICATE_PASSPHRASE" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - uses: actions/download-artifact@v3 + with: + name: build + + - name: Install root dependencies + run: npm ci + + - name: Install dist dependencies + run: npm run dist-install + + - name: Build + run: npm run dist-pkg + + # + # Fail early on failing tests. + # + - name: 'Test' + run: | + dist/bin/frodo -v + dist/bin/frodo journey -h + dist/bin/frodo journey export -h + + # + # Re-sign the application with the "Developer ID" certificate. + # + - name: Sign distribution binary + working-directory: ./dist/bin + run: "codesign -f -s 'Developer ID Application' --timestamp --deep frodo" + # run: "codesign -f -s 'Developer ID Application: Volker Scheuber (AV6L99G8W9)' --timestamp --deep frodo" + + # + # Zip up the app and add it to the GitHub Release as a + # downloadable asset. + # + + - name: Package for Distribution + run: ditto -V -c -k --keepParent "dist/bin/frodo" "dist/frodo-macos-${{ needs.build.outputs.newVersion }}.zip" + + - uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/frodo-macos-${{ needs.build.outputs.newVersion }}.zip + + linux-binary-release: + needs: [build, smoke-tests] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - uses: actions/download-artifact@v3 + with: + name: build + + - name: Install root dependencies + run: npm ci + + - name: Install dist dependencies + run: npm run dist-install + + - name: Build + run: npm run dist-pkg + + # + # Fail early on failing tests. + # + - name: 'Test' + run: | + dist/bin/frodo -v + dist/bin/frodo journey -h + dist/bin/frodo journey export -h + + - name: Archive distribution binary + run: zip -r -Z bzip2 dist/frodo-linux-${{ needs.build.outputs.newVersion }}.zip . -i dist/bin/frodo + + - uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/frodo-linux-${{ needs.build.outputs.newVersion }}.zip + + linux-arm64-binary-release: + if: false + needs: [build, smoke-tests] + runs-on: self-hosted + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - uses: actions/download-artifact@v3 + with: + name: build + + - name: Install root dependencies + run: npm ci + + - name: Install dist dependencies + run: npm run dist-install + + - name: Build + run: npm run dist-pkg + + # + # Fail early on failing tests. + # + - name: 'Test' + run: | + dist/bin/frodo -v + dist/bin/frodo journey -h + dist/bin/frodo journey export -h + + - name: Archive distribution binary + run: zip -r -Z bzip2 dist/frodo-linux-arm64-${{ needs.build.outputs.newVersion }}.zip . -i dist/bin/frodo + + - uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/frodo-linux-arm64-${{ needs.build.outputs.newVersion }}.zip + + windows-binary-release: + needs: [build, smoke-tests] + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - uses: actions/download-artifact@v3 + with: + name: build + + - name: Install root dependencies + run: npm ci + + - name: Install dist dependencies + run: npm run dist-install + + - name: Build + run: npm run dist-pkg + + # + # Fail early on failing tests. + # + - name: 'Test' + run: | + dist/bin/frodo.exe -v + dist/bin/frodo.exe journey -h + dist/bin/frodo.exe journey export -h + + - name: Archive distribution binary + run: 7z a -tzip dist/frodo-win-${{ needs.build.outputs.newVersion }}.zip dist/bin/frodo.exe + + - uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/frodo-win-${{ needs.build.outputs.newVersion }}.zip diff --git a/package.json b/package.json index 2eb2d9e67..c14a8e8cf 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@rockcarver/frodo-cli", + "name": "@trivir/frodo-cli", "version": "0.24.3", "type": "module", "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.", From cefabf41092d1e335a8f227c688cc73cbe9e1301 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Mon, 29 May 2023 15:45:26 +0000 Subject: [PATCH 16/27] Updated changelog and version for release v0.24.4-trivir.0 --- CHANGELOG.md | 18 +++++++++++++++++- package.json | 10 +++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d59b60c48..d5168bea0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.24.4-trivir.0] - 2023-05-30 + +## [0.24.4-trivir.0] - 2023-05-30 + +## [0.24.4-trivir.0] - 2023-05-29 + +## [0.24.4-trivir.0] - 2023-05-29 + ## [0.24.3] - 2023-05-25 ### Changed @@ -1182,7 +1190,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed problem with adding connection profiles - Miscellaneous bug fixes -[Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v0.24.3...HEAD +[Unreleased]: https://github.com/trivir/frodo-cli/compare/v0.24.4-trivir.0...HEAD + +[0.24.4-trivir.0]: https://github.com/trivir/frodo-cli/compare/v0.24.4-trivir.0...v0.24.4-trivir.0 + +[0.24.4-trivir.0]: https://github.com/trivir/frodo-cli/compare/v0.24.4-trivir.0...v0.24.4-trivir.0 + +[0.24.4-trivir.0]: https://github.com/trivir/frodo-cli/compare/v0.24.4-trivir.0...v0.24.4-trivir.0 + +[0.24.4-trivir.0]: https://github.com/trivir/frodo-cli/compare/v0.24.3...v0.24.4-trivir.0 [0.24.3]: https://github.com/rockcarver/frodo-cli/compare/v0.24.1...v0.24.3 diff --git a/package.json b/package.json index c14a8e8cf..230a921d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@trivir/frodo-cli", - "version": "0.24.3", + "version": "0.24.4-trivir.0", "type": "module", "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.", "keywords": [ @@ -97,9 +97,9 @@ }, "pkg": { "assets": [ - "node_modules/@rockcarver/frodo-lib/cjs/ops/templates/*.json", - "node_modules/@rockcarver/frodo-lib/cjs/ops/templates/**/*.json", - "node_modules/@rockcarver/frodo-lib/mocks/**/*.har" + "node_modules/@trivir/frodo-lib/cjs/ops/templates/*.json", + "node_modules/@trivir/frodo-lib/cjs/ops/templates/**/*.json", + "node_modules/@trivir/frodo-lib/mocks/**/*.har" ], "scripts": [ "src/cli/**/*.js", @@ -109,7 +109,7 @@ ] }, "dependencies": { - "@rockcarver/frodo-lib": "0.19.2", + "@trivir/frodo-lib": "^0.19.3-trivir.0", "chokidar": "^3.5.3", "cli-progress": "^3.11.2", "cli-table3": "^0.6.3", From 32a4e5f73a8f713b36774f094f4e894ba28e5140 Mon Sep 17 00:00:00 2001 From: Automated Version Bump Date: Tue, 30 May 2023 05:18:27 +0000 Subject: [PATCH 17/27] Updated changelog and version for release v0.24.4-trivir.1 --- CHANGELOG.md | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5168bea0..d167f3ad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.24.4-trivir.1] - 2023-05-30 + ## [0.24.4-trivir.0] - 2023-05-30 ## [0.24.4-trivir.0] - 2023-05-30 @@ -1190,7 +1192,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed problem with adding connection profiles - Miscellaneous bug fixes -[Unreleased]: https://github.com/trivir/frodo-cli/compare/v0.24.4-trivir.0...HEAD +[Unreleased]: https://github.com/trivir/frodo-cli/compare/v0.24.4-trivir.1...HEAD + +[0.24.4-trivir.1]: https://github.com/trivir/frodo-cli/compare/v0.24.4-trivir.0...v0.24.4-trivir.1 [0.24.4-trivir.0]: https://github.com/trivir/frodo-cli/compare/v0.24.4-trivir.0...v0.24.4-trivir.0 diff --git a/package.json b/package.json index 230a921d2..fe5c3e09d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@trivir/frodo-cli", - "version": "0.24.4-trivir.0", + "version": "0.24.4-trivir.1", "type": "module", "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.", "keywords": [ From e78bd7031b562422db96f59324af9e8fdf7486c0 Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Tue, 30 May 2023 08:54:20 -0600 Subject: [PATCH 18/27] Remove deprecated actions/commands --- .github/workflows/trivir.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trivir.yml b/.github/workflows/trivir.yml index 57e77c66a..7ed61891d 100644 --- a/.github/workflows/trivir.yml +++ b/.github/workflows/trivir.yml @@ -48,7 +48,7 @@ jobs: - name: 'Version From Tag' id: version-from-tag - run: echo "::set-output name=version::$(echo '${{ steps.version-bump.outputs.newTag }}' | sed 's/v//')" + run: echo "version=$(echo '${{ steps.version-bump.outputs.newTag }}' | sed 's/v//')" >> "$GITHUB_OUTPUT" - name: Build frodo-cli run: | @@ -111,7 +111,7 @@ jobs: uses: actions/checkout@v3 # # - name: Use Node.js ${{ matrix.node-version }} -# uses: actions/setup-node@v2 +# uses: actions/setup-node@v3 # with: # # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ # node-version: ${{ matrix.node-version }} From 380694928d456b12826f0ef6f1b7c295aff1d483 Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Tue, 30 May 2023 08:54:41 -0600 Subject: [PATCH 19/27] Remove git checkouts for binary releases --- .github/workflows/trivir.yml | 37 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/.github/workflows/trivir.yml b/.github/workflows/trivir.yml index 7ed61891d..705bd07bb 100644 --- a/.github/workflows/trivir.yml +++ b/.github/workflows/trivir.yml @@ -232,6 +232,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} npm-release: + if: false # npm-release only needs the build job but since it is inconvenient to unpublish an npm we want this job to run last # needs: [build, linux-binary-release, linux-arm64-binary-release, macos-binary-release, windows-binary-release] needs: [build, linux-binary-release, macos-binary-release, windows-binary-release] @@ -305,18 +306,15 @@ jobs: #security import $INTERMEDIATE_CERTIFICATE_PATH -P "$DEVELOPMENT_CERTIFICATE_PASSPHRASE" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH security list-keychain -d user -s $KEYCHAIN_PATH - - name: Checkout repository - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: build - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - uses: actions/download-artifact@v3 - with: - name: build - - name: Install root dependencies run: npm ci @@ -360,18 +358,15 @@ jobs: needs: [build, smoke-tests] runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: build - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - uses: actions/download-artifact@v3 - with: - name: build - - name: Install root dependencies run: npm ci @@ -403,18 +398,15 @@ jobs: needs: [build, smoke-tests] runs-on: self-hosted steps: - - name: Checkout repository - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: build - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - uses: actions/download-artifact@v3 - with: - name: build - - name: Install root dependencies run: npm ci @@ -445,18 +437,15 @@ jobs: needs: [build, smoke-tests] runs-on: windows-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: build - uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - uses: actions/download-artifact@v3 - with: - name: build - - name: Install root dependencies run: npm ci From bdac3387a98e7c9a59c637ce375442e03b26b72e Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Sun, 4 Jun 2023 07:37:17 -0600 Subject: [PATCH 20/27] Simplify dist/binary build --- .github/workflows/trivir.yml | 32 +++++++++++++------------------- package.json | 25 ++++++++++++------------- 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/.github/workflows/trivir.yml b/.github/workflows/trivir.yml index 705bd07bb..ee5ff991c 100644 --- a/.github/workflows/trivir.yml +++ b/.github/workflows/trivir.yml @@ -55,21 +55,16 @@ jobs: npm run build:local - name: Build frodo-cli cjs - run: | - npm run dist-package - npm run dist-transpile + run: npm run dist-transpile - name: Lint - run: | - npm run lint + run: npm run lint - name: Type Check - run: | - npx tsc + run: npx tsc - name: Security Audit - run: | - npm audit --omit=dev + run: npm audit --omit=dev - uses: actions/upload-artifact@v3 with: @@ -78,7 +73,7 @@ jobs: package.json package-lock.json esm - dist + cjs outputs: newTag: ${{ steps.version-bump.outputs.newTag }} @@ -276,6 +271,7 @@ jobs: npm dist-tag add @trivir/frodo-cli@${{ needs.build.outputs.newVersion }} next macos-binary-release: + if: false needs: [build, smoke-tests] runs-on: macos-latest timeout-minutes: 15 @@ -367,12 +363,9 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - name: Install root dependencies + - name: Install dependencies run: npm ci - - name: Install dist dependencies - run: npm run dist-install - - name: Build run: npm run dist-pkg @@ -381,17 +374,17 @@ jobs: # - name: 'Test' run: | - dist/bin/frodo -v - dist/bin/frodo journey -h - dist/bin/frodo journey export -h + ./frodo -v + ./frodo journey -h + ./frodo journey export -h - name: Archive distribution binary - run: zip -r -Z bzip2 dist/frodo-linux-${{ needs.build.outputs.newVersion }}.zip . -i dist/bin/frodo + run: zip -r -Z bzip2 frodo-linux-${{ needs.build.outputs.newVersion }}.zip . -i ./frodo - uses: actions/upload-artifact@v3 with: name: dist - path: dist/frodo-linux-${{ needs.build.outputs.newVersion }}.zip + path: frodo-linux-${{ needs.build.outputs.newVersion }}.zip linux-arm64-binary-release: if: false @@ -434,6 +427,7 @@ jobs: path: dist/frodo-linux-arm64-${{ needs.build.outputs.newVersion }}.zip windows-binary-release: + if: false needs: [build, smoke-tests] runs-on: windows-latest steps: diff --git a/package.json b/package.json index fe5c3e09d..367ba4d1b 100644 --- a/package.json +++ b/package.json @@ -40,12 +40,10 @@ "clean-esm": "rimraf esm", "transpile-esm": "babel --out-dir esm --extensions \".ts\" --source-maps --config-file ./babel.config.esm.json src", "build:local": "tsc && npm run clean-esm && npm run transpile-esm", - "dist-clean": "rimraf dist/src", - "dist-package": "json -f package.json -e \"delete this.type; this.main = 'src/app.js'; this.bin.frodo = './src/app.js';\" > dist/package.json", - "dist-install": "cd dist && npm install", - "dist-transpile": "babel --out-dir dist/src --extensions \".ts\" --source-maps --config-file ./babel.config.cjs.json src", - "dist-pkg": "pkg -C Gzip -t node18 -o dist/bin/frodo dist", - "build:binary": "tsc && npm run dist-clean && npm run dist-package && npm run dist-install && npm run dist-transpile && npm run dist-pkg", + "dist-clean": "rimraf cjs", + "dist-transpile": "babel --out-dir cjs --extensions \".ts\" --source-maps --config-file ./babel.config.cjs.json src && echo {\\\"type\\\": \\\"commonjs\\\"} > cjs/package.json", + "dist-pkg": "pkg -C Gzip -t node18 --config package.json -o frodo cjs/app.js", + "build:binary": "tsc && npm run dist-clean && npm run dist-transpile && npm run dist-pkg", "link-frodo-lib": "npm link ../frodo-lib", "watch": "npm run link-frodo-lib && babel --watch --out-dir esm --extensions \".ts\" --source-maps --config-file ./babel.config.esm.json src" }, @@ -97,15 +95,16 @@ }, "pkg": { "assets": [ - "node_modules/@trivir/frodo-lib/cjs/ops/templates/*.json", - "node_modules/@trivir/frodo-lib/cjs/ops/templates/**/*.json", - "node_modules/@trivir/frodo-lib/mocks/**/*.har" + "package.json", + "node_modules/@rockcarver/frodo-lib/cjs/ops/templates/*.json", + "node_modules/@rockcarver/frodo-lib/cjs/ops/templates/**/*.json", + "node_modules/@rockcarver/frodo-lib/mocks/**/*.har" ], "scripts": [ - "src/cli/**/*.js", - "src/ops/**/*.js", - "src/storage/**/*.js", - "src/utils/**/*.js" + "cjs/cli/**/*.js", + "cjs/ops/**/*.js", + "cjs/storage/**/*.js", + "cjs/utils/**/*.js" ] }, "dependencies": { From e9e92da11952020e38658788cbde6d46d953cb7c Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Sun, 4 Jun 2023 08:23:16 -0600 Subject: [PATCH 21/27] Simplify zip command --- .github/workflows/trivir.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trivir.yml b/.github/workflows/trivir.yml index ee5ff991c..b8227eb3d 100644 --- a/.github/workflows/trivir.yml +++ b/.github/workflows/trivir.yml @@ -379,7 +379,7 @@ jobs: ./frodo journey export -h - name: Archive distribution binary - run: zip -r -Z bzip2 frodo-linux-${{ needs.build.outputs.newVersion }}.zip . -i ./frodo + run: zip -Z bzip2 frodo-linux-${{ needs.build.outputs.newVersion }}.zip frodo - uses: actions/upload-artifact@v3 with: From 59806ae7956706ac1f8be1117b6bfbaa1b57e337 Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Sun, 4 Jun 2023 08:30:15 -0600 Subject: [PATCH 22/27] Update Windows and MacOS builds --- .github/workflows/trivir.yml | 49 ++++++++++++++---------------------- 1 file changed, 19 insertions(+), 30 deletions(-) diff --git a/.github/workflows/trivir.yml b/.github/workflows/trivir.yml index b8227eb3d..2b5a98295 100644 --- a/.github/workflows/trivir.yml +++ b/.github/workflows/trivir.yml @@ -271,7 +271,6 @@ jobs: npm dist-tag add @trivir/frodo-cli@${{ needs.build.outputs.newVersion }} next macos-binary-release: - if: false needs: [build, smoke-tests] runs-on: macos-latest timeout-minutes: 15 @@ -311,12 +310,9 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - name: Install root dependencies + - name: Install dependencies run: npm ci - - name: Install dist dependencies - run: npm run dist-install - - name: Build run: npm run dist-pkg @@ -325,15 +321,15 @@ jobs: # - name: 'Test' run: | - dist/bin/frodo -v - dist/bin/frodo journey -h - dist/bin/frodo journey export -h + ./frodo -v + ./frodo journey -h + ./frodo journey export -h # # Re-sign the application with the "Developer ID" certificate. # - name: Sign distribution binary - working-directory: ./dist/bin + # working-directory: ./dist/bin run: "codesign -f -s 'Developer ID Application' --timestamp --deep frodo" # run: "codesign -f -s 'Developer ID Application: Volker Scheuber (AV6L99G8W9)' --timestamp --deep frodo" @@ -343,12 +339,12 @@ jobs: # - name: Package for Distribution - run: ditto -V -c -k --keepParent "dist/bin/frodo" "dist/frodo-macos-${{ needs.build.outputs.newVersion }}.zip" + run: ditto -V -c -k "frodo" "frodo-macos-${{ needs.build.outputs.newVersion }}.zip" - uses: actions/upload-artifact@v3 with: name: dist - path: dist/frodo-macos-${{ needs.build.outputs.newVersion }}.zip + path: frodo-macos-${{ needs.build.outputs.newVersion }}.zip linux-binary-release: needs: [build, smoke-tests] @@ -400,12 +396,9 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - name: Install root dependencies + - name: Install dependencies run: npm ci - - name: Install dist dependencies - run: npm run dist-install - - name: Build run: npm run dist-pkg @@ -414,20 +407,19 @@ jobs: # - name: 'Test' run: | - dist/bin/frodo -v - dist/bin/frodo journey -h - dist/bin/frodo journey export -h + ./frodo -v + ./frodo journey -h + ./frodo journey export -h - name: Archive distribution binary - run: zip -r -Z bzip2 dist/frodo-linux-arm64-${{ needs.build.outputs.newVersion }}.zip . -i dist/bin/frodo + run: zip -Z bzip2 frodo-linux-arm64-${{ needs.build.outputs.newVersion }}.zip . -i frodo - uses: actions/upload-artifact@v3 with: name: dist - path: dist/frodo-linux-arm64-${{ needs.build.outputs.newVersion }}.zip + path: frodo-linux-arm64-${{ needs.build.outputs.newVersion }}.zip windows-binary-release: - if: false needs: [build, smoke-tests] runs-on: windows-latest steps: @@ -440,12 +432,9 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - name: Install root dependencies + - name: Install dependencies run: npm ci - - name: Install dist dependencies - run: npm run dist-install - - name: Build run: npm run dist-pkg @@ -454,14 +443,14 @@ jobs: # - name: 'Test' run: | - dist/bin/frodo.exe -v - dist/bin/frodo.exe journey -h - dist/bin/frodo.exe journey export -h + frodo.exe -v + frodo.exe journey -h + frodo.exe journey export -h - name: Archive distribution binary - run: 7z a -tzip dist/frodo-win-${{ needs.build.outputs.newVersion }}.zip dist/bin/frodo.exe + run: 7z a -tzip frodo-win-${{ needs.build.outputs.newVersion }}.zip frodo.exe - uses: actions/upload-artifact@v3 with: name: dist - path: dist/frodo-win-${{ needs.build.outputs.newVersion }}.zip + path: frodo-win-${{ needs.build.outputs.newVersion }}.zip From bde1afb6d3084063071ab992c93574aa63d2f70a Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Sun, 4 Jun 2023 08:40:47 -0600 Subject: [PATCH 23/27] Fix Windows relative path --- .github/workflows/trivir.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/trivir.yml b/.github/workflows/trivir.yml index 2b5a98295..9715b3de3 100644 --- a/.github/workflows/trivir.yml +++ b/.github/workflows/trivir.yml @@ -443,9 +443,9 @@ jobs: # - name: 'Test' run: | - frodo.exe -v - frodo.exe journey -h - frodo.exe journey export -h + ./frodo.exe -v + ./frodo.exe journey -h + ./frodo.exe journey export -h - name: Archive distribution binary run: 7z a -tzip frodo-win-${{ needs.build.outputs.newVersion }}.zip frodo.exe From 37d9ad01fb51c12f8bd5b748cef345979c7637a5 Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Sun, 4 Jun 2023 11:07:00 -0600 Subject: [PATCH 24/27] Standardize script naming --- .github/workflows/trivir.yml | 13 +++++-------- package.json | 8 ++++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/trivir.yml b/.github/workflows/trivir.yml index 9715b3de3..8acb6b4f9 100644 --- a/.github/workflows/trivir.yml +++ b/.github/workflows/trivir.yml @@ -50,12 +50,11 @@ jobs: id: version-from-tag run: echo "version=$(echo '${{ steps.version-bump.outputs.newTag }}' | sed 's/v//')" >> "$GITHUB_OUTPUT" - - name: Build frodo-cli - run: | - npm run build:local + - name: Build frodo-cli esm + run: npm run transpile-esm - name: Build frodo-cli cjs - run: npm run dist-transpile + run: npm run transpile-cjs - name: Lint run: npm run lint @@ -128,12 +127,10 @@ jobs: # run: npm i -g # # - name: CLI Help Tests -# run: | -# npm test +# run: npm test # # - name: Version Test -# run: | -# frodo -v +# run: frodo -v # # - name: Direct Tests # env: diff --git a/package.json b/package.json index 367ba4d1b..93d042c2c 100644 --- a/package.json +++ b/package.json @@ -39,11 +39,11 @@ "build": "tsc && npm run build:local && npm run build:binary", "clean-esm": "rimraf esm", "transpile-esm": "babel --out-dir esm --extensions \".ts\" --source-maps --config-file ./babel.config.esm.json src", - "build:local": "tsc && npm run clean-esm && npm run transpile-esm", - "dist-clean": "rimraf cjs", - "dist-transpile": "babel --out-dir cjs --extensions \".ts\" --source-maps --config-file ./babel.config.cjs.json src && echo {\\\"type\\\": \\\"commonjs\\\"} > cjs/package.json", + "build:local": "tsc && npm run clean-esm && npm run transpile-esm && npm run clean-cjs && npm run transpile-cjs", + "clean-cjs": "rimraf cjs", + "transpile-cjs": "babel --out-dir cjs --extensions \".ts\" --source-maps --config-file ./babel.config.cjs.json src && echo {\\\"type\\\": \\\"commonjs\\\"} > cjs/package.json", "dist-pkg": "pkg -C Gzip -t node18 --config package.json -o frodo cjs/app.js", - "build:binary": "tsc && npm run dist-clean && npm run dist-transpile && npm run dist-pkg", + "build:binary": "tsc && npm run clean-cjs && npm run transpile-cjs && npm run dist-pkg", "link-frodo-lib": "npm link ../frodo-lib", "watch": "npm run link-frodo-lib && babel --watch --out-dir esm --extensions \".ts\" --source-maps --config-file ./babel.config.esm.json src" }, From 60c5005848137a6c5790e01edc9cf355fd237a5f Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Sun, 4 Jun 2023 12:59:44 -0600 Subject: [PATCH 25/27] Remove npx from calls to eslint --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 93d042c2c..d9580872e 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,8 @@ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", "test:local": "npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js", "test:debug": "node --no-warnings --experimental-vm-modules --experimental-specifier-resolution=node node_modules/jest/bin/jest.js --verbose=true --silent=false", - "lint": "npx eslint --ext .ts --ignore-path .gitignore .", - "lint:fix": "npx eslint --fix --ext .ts --ignore-path .gitignore .", + "lint": "eslint --ext .ts --ignore-path .gitignore .", + "lint:fix": "eslint --fix --ext .ts --ignore-path .gitignore .", "build": "tsc && npm run build:local && npm run build:binary", "clean-esm": "rimraf esm", "transpile-esm": "babel --out-dir esm --extensions \".ts\" --source-maps --config-file ./babel.config.esm.json src", From e32bf3a902869d0ba044626b1fc2b93b604d7d0f Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Mon, 5 Jun 2023 07:18:09 -0600 Subject: [PATCH 26/27] Add trigger for pull requests --- .github/workflows/trivir.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/trivir.yml b/.github/workflows/trivir.yml index 8acb6b4f9..67c491307 100644 --- a/.github/workflows/trivir.yml +++ b/.github/workflows/trivir.yml @@ -3,7 +3,10 @@ name: 'Frodo CLI Release Pipeline' on: push: branches: - - 'trivir' + - trivir + pull_request: + branches: + - trivir workflow_dispatch: env: @@ -152,6 +155,7 @@ jobs: # frodo info "$FIDC_TENANT_URL" release: + if: github.event_name != 'pull_request' # needs: [build, linux-binary-release, linux-arm64-binary-release, macos-binary-release, npm-release, windows-binary-release] needs: [build, linux-binary-release, macos-binary-release, npm-release, windows-binary-release] name: 'Release' @@ -225,6 +229,7 @@ jobs: npm-release: if: false + # if: github.event_name != 'pull_request' # npm-release only needs the build job but since it is inconvenient to unpublish an npm we want this job to run last # needs: [build, linux-binary-release, linux-arm64-binary-release, macos-binary-release, windows-binary-release] needs: [build, linux-binary-release, macos-binary-release, windows-binary-release] From bc301299f782812d8fdf7e24466524c044f51c92 Mon Sep 17 00:00:00 2001 From: Huston Franklin Date: Mon, 5 Jun 2023 07:41:59 -0600 Subject: [PATCH 27/27] Test commit --- src/app.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app.ts b/src/app.ts index de9b68218..911055e12 100755 --- a/src/app.ts +++ b/src/app.ts @@ -33,6 +33,8 @@ const { initConnectionProfiles } = ConnectionProfile; '-v, --version' ); + console.log('test branch'); + printMessage(await getVersions(true), 'text', false); await initConnectionProfiles();