diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 332b64b4..91340770 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,7 +85,7 @@ jobs: name: codecov - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: runner.os == 'ubuntu-latest' with: name: vrealize-developer-tools-${{steps.version_step.outputs.version_build}}.vsix diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 18287516..6e7fcf17 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -70,7 +70,7 @@ jobs: MINISIGN_PASSWORD: ${{ secrets.RELEASE_MINISIGN_PASS }} - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: vrealize-developer-tools-${{steps.version_step.outputs.version}} path: | diff --git a/extension/src/client/command/RunAction.ts b/extension/src/client/command/RunAction.ts index 0973fc6d..49c1ec32 100644 --- a/extension/src/client/command/RunAction.ts +++ b/extension/src/client/command/RunAction.ts @@ -280,7 +280,6 @@ class ActionRunner { } this.logger.info(`Running workflow ${RUN_SCRIPT_WORKFLOW_ID} (vRO ${this.vroVersion})`) - const supportsSysLog = semver.gt(this.vroVersion, "7.3.1") const params = [ { name: "script", @@ -288,13 +287,6 @@ class ActionRunner { value: { string: { value: fileContent } } - }, - { - name: "printInOutput", - type: "boolean", - value: { - boolean: { value: !supportsSysLog } - } } ] @@ -416,11 +408,15 @@ abstract class FetchSysLogsStrategy extends FetchLogsStrategy { protected abstract getLogMessages(): Promise async printMessages(): Promise { + if (Logger.level === "off") { + return + } const timestamp = Date.now() - 10000 // 10sec earlier const logs = await this.getLogMessages() logs.forEach(logMessage => { const timestamp = moment(logMessage.timestamp).format("YYYY-MM-DD HH:mm:ss.SSS ZZ") - const msg = `[${timestamp}] [${logMessage.severity}] ${logMessage.description}` + const origin = !logMessage.origin ? "" : `[${logMessage.origin}] ` + const msg = `[${timestamp}] ${origin}[${logMessage.severity}] ${logMessage.description}` if (!this.printedMessages.has(msg)) { this.log(msg) this.printedMessages.add(msg) @@ -455,7 +451,7 @@ class FetchLogsPre76 extends FetchSysLogsStrategy { return this.restClient.getWorkflowLogsPre76( RUN_SCRIPT_WORKFLOW_ID, this.executionToken, - "debug", + Logger.level, this.lastTimestamp ) } @@ -475,7 +471,7 @@ class FetchLogsPost76 extends FetchSysLogsStrategy { return this.restClient.getWorkflowLogsPost76( RUN_SCRIPT_WORKFLOW_ID, this.executionToken, - "debug", + Logger.level, this.lastTimestamp ) } diff --git a/packages/node/vrdt-common/src/logger.ts b/packages/node/vrdt-common/src/logger.ts index a8b3724e..38eb0ab7 100644 --- a/packages/node/vrdt-common/src/logger.ts +++ b/packages/node/vrdt-common/src/logger.ts @@ -37,6 +37,13 @@ export default class Logger { } } + /** + * Configured log level. + */ + static get level(): LogLevel { + return Logger.logLevel + } + debug(message: string, data?: any): void { if (this.channel && Logger.logLevel === "debug") { this.channel.debug(this.format("DEBUG", message, data)) diff --git a/packages/node/vrdt-common/src/rest/VroRestClient.ts b/packages/node/vrdt-common/src/rest/VroRestClient.ts index 10f4155b..98499975 100644 --- a/packages/node/vrdt-common/src/rest/VroRestClient.ts +++ b/packages/node/vrdt-common/src/rest/VroRestClient.ts @@ -321,8 +321,7 @@ export class VroRestClient { "GET", `workflows/${workflowId}/executions/${executionId}/syslogs` + `?conditions=severity=${severity}` + - `&conditions=timestamp${encodeURIComponent(">")}${timestamp}` + - "&conditions=type=system" + `&conditions=timestamp${encodeURIComponent(">")}${timestamp}` ) const messages: LogMessage[] = [] @@ -335,7 +334,8 @@ export class VroRestClient { messages.push({ timestamp: e["time-stamp"], severity: e.severity, - description + description, + origin: e.origin }) } diff --git a/packages/node/vrdt-common/src/rest/vro-model.ts b/packages/node/vrdt-common/src/rest/vro-model.ts index ab6d810e..e5e05402 100644 --- a/packages/node/vrdt-common/src/rest/vro-model.ts +++ b/packages/node/vrdt-common/src/rest/vro-model.ts @@ -15,6 +15,7 @@ export interface LogMessage { timestamp: string severity: string description: string + origin?: string } export interface Version {