From 534798f944ae79136e74b453a7780b172a3760d4 Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Wed, 23 Sep 2026 14:21:22 +0530 Subject: [PATCH 01/15] Add VIPM lock generation workflow --- .github/workflows/vipm-lock-refresh.yml | 67 +++++++++++++++++++++++++ scripts/apply-vipc/vipm.toml | 22 ++++++++ 2 files changed, 89 insertions(+) create mode 100644 .github/workflows/vipm-lock-refresh.yml create mode 100644 scripts/apply-vipc/vipm.toml diff --git a/.github/workflows/vipm-lock-refresh.yml b/.github/workflows/vipm-lock-refresh.yml new file mode 100644 index 00000000..02d57cfd --- /dev/null +++ b/.github/workflows/vipm-lock-refresh.yml @@ -0,0 +1,67 @@ +name: Refresh VIPM Lock + +on: + pull_request: + branches: [actions] + paths: + - scripts/apply-vipc/vipm.toml + - .github/workflows/vipm-lock-refresh.yml + workflow_dispatch: + +permissions: + contents: read + +jobs: + refresh-vipm-lock: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 + - name: Generate vipm.lock + shell: bash + env: + VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} + VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} + VIPM_EMAIL: ${{ secrets.VIPM_EMAIL }} + run: | + set -euo pipefail + + docker run --rm \ + --volume "${PWD}:/workspace" \ + --workdir /workspace \ + -e VIPM_SERIAL_NUMBER="${VIPM_SERIAL_NUMBER}" \ + -e VIPM_FULL_NAME="${VIPM_FULL_NAME}" \ + -e VIPM_EMAIL="${VIPM_EMAIL}" \ + nationalinstruments/labview:latest-linux \ + bash -s <<'VIPM_SCRIPT' + set -euo pipefail + + apt-get update + apt-get install -y wget ca-certificates xvfb + + if ! command -v vipm >/dev/null 2>&1; then + wget -O /tmp/vipm.deb "https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb" + apt-get install -y /tmp/vipm.deb + fi + + export DISPLAY=:99 + export VIPM_TIMEOUT=500 + Xvfb "$DISPLAY" -screen 0 1280x720x24 -ac +extension GLX +render -noreset >/tmp/xvfb.log 2>&1 & + + vipm --version + + if [ -n "${VIPM_SERIAL_NUMBER:-}" ]; then + vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL" + fi + + vipm package-list-refresh + cd scripts/apply-vipc + vipm lock + VIPM_SCRIPT + + test -f scripts/apply-vipc/vipm.lock + - name: Upload vipm.lock artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: vipm-lock + path: scripts/apply-vipc/vipm.lock + if-no-files-found: error \ No newline at end of file diff --git a/scripts/apply-vipc/vipm.toml b/scripts/apply-vipc/vipm.toml new file mode 100644 index 00000000..bd6a7334 --- /dev/null +++ b/scripts/apply-vipc/vipm.toml @@ -0,0 +1,22 @@ +[project] +name = "runner-dependencies" +labview-version = 2021 +labview-bitness = 64 + +[dependencies] +astemes_lib_lunit = "1.10.7.3" +hse_lib_git_api = "2.3.4.176" +jki_lib_serialization = "1.0.1.14" +jki_lib_state_machine = "2024.0.3.23" +jki_lib_unicode = "1.0.0.7" +jki_lib_vipm_api = "2020.0.3.80" +jki_rsc_toolkits_palette = "1.1-1" +oglib_array = "6.0.1.20" +oglib_error = "6.0.0.26" +oglib_file = "6.0.2.28" +oglib_lvdata = "6.0.0.45" +oglib_lvzip = "5.0.9-1" +sas_workshops_lib_lunit_for_g_cli = "1.1.1.54" +sas_workshops_lib_lvbuildspec_for_g_cli = "1.2.1.104" +sas_workshops_lib_vipb_builder_for_g_cli = "1.1.6.46" +wiresmith_technology_lib_g_cli = "3.0.1.98" \ No newline at end of file From edbfb7abf0da9a1e3a49fb2b4726a15cbd16e707 Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Wed, 23 Sep 2026 14:35:52 +0530 Subject: [PATCH 02/15] Add VIPM lock generation workflow --- .github/workflows/vipm-lock-refresh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vipm-lock-refresh.yml b/.github/workflows/vipm-lock-refresh.yml index 02d57cfd..38497cbf 100644 --- a/.github/workflows/vipm-lock-refresh.yml +++ b/.github/workflows/vipm-lock-refresh.yml @@ -25,7 +25,7 @@ jobs: run: | set -euo pipefail - docker run --rm \ + docker run --rm -i \ --volume "${PWD}:/workspace" \ --workdir /workspace \ -e VIPM_SERIAL_NUMBER="${VIPM_SERIAL_NUMBER}" \ From 0bedc95b7449c4aa8fe795d24de25906abc4217e Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Wed, 23 Sep 2026 17:02:49 +0530 Subject: [PATCH 03/15] Fix the refresh command --- .github/workflows/vipm-lock-refresh.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/vipm-lock-refresh.yml b/.github/workflows/vipm-lock-refresh.yml index 38497cbf..0910dddb 100644 --- a/.github/workflows/vipm-lock-refresh.yml +++ b/.github/workflows/vipm-lock-refresh.yml @@ -53,7 +53,6 @@ jobs: vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL" fi - vipm package-list-refresh cd scripts/apply-vipc vipm lock VIPM_SCRIPT From 3fa9382f5db4014376a851497106660c57066d64 Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Thu, 24 Sep 2026 15:13:17 +0530 Subject: [PATCH 04/15] Fix vipm.lock cache refresh and add reusable VIPM lock/dependency-update workflows - Fix vipm-lock-refresh.yml: run 'vipm refresh --labview-version --labview-bitness' before 'vipm lock' so a clean runner has a populated repository cache (root cause of 'Could not load repository cache' failures). - Extract refresh-vipm-lock and update-vipm-dependencies into reusable composite actions + workflow_call workflows so other repos can generate/check their own vipm.lock and get automated dependency-update PRs, instead of ni/open-source doing it on their behalf. - Rebuild both actions on the repo's existing dispatcher convention (action.yml -> common-dispatch.ps1 -> Invoke-OSAction.ps1 -> OpenSourceActions.psm1 adapters -> scripts/* leaf scripts), matching build-spec-docker-linux; regenerated dispatchers.json via scripts/derive-dispatcher-registry.ts. - reusable-vipm-lock.yml and reusable-vipm-update.yml now open a PR (peter-evans/create-pull-request@v8.1.1) with the changed vipm.lock/vipm.toml instead of uploading an artifact. - Split vipm-lock-refresh.yml into a read-only pull_request check job and a write-and-PR job on push/workflow_dispatch, avoiding opening a PR from within a PR run. - Fix update-vipm-dependencies.sh: a failed 'vipm add' for any package now fails the job before vipm lock/PR instead of being swallowed as a warning. - Bump OpenSourceActions module to 1.1.1 (1.1.0 for the two new adapters, 1.1.1 for the failure-handling fix) and update FunctionsToExport/ReleaseNotes. --- .github/workflows/reusable-vipm-lock.yml | 72 ++++++++++ .github/workflows/reusable-vipm-update.yml | 67 +++++++++ .github/workflows/vipm-dependency-update.yml | 18 +++ .github/workflows/vipm-lock-refresh.yml | 90 +++++------- actions/OpenSourceActions.psd1 | 5 +- actions/OpenSourceActions.psm1 | 93 ++++++++++++ dispatchers.json | 127 +++++++++++++++++ refresh-vipm-lock/action.yml | 74 ++++++++++ scripts/refresh-vipm-lock/RefreshVipmLock.ps1 | 134 ++++++++++++++++++ .../refresh-vipm-lock/refresh-vipm-lock.sh | 52 +++++++ .../UpdateVipmDependencies.ps1 | 120 ++++++++++++++++ .../update-vipm-dependencies.sh | 76 ++++++++++ update-vipm-dependencies/action.yml | 69 +++++++++ 13 files changed, 942 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/reusable-vipm-lock.yml create mode 100644 .github/workflows/reusable-vipm-update.yml create mode 100644 .github/workflows/vipm-dependency-update.yml create mode 100644 refresh-vipm-lock/action.yml create mode 100644 scripts/refresh-vipm-lock/RefreshVipmLock.ps1 create mode 100644 scripts/refresh-vipm-lock/refresh-vipm-lock.sh create mode 100644 scripts/update-vipm-dependencies/UpdateVipmDependencies.ps1 create mode 100644 scripts/update-vipm-dependencies/update-vipm-dependencies.sh create mode 100644 update-vipm-dependencies/action.yml diff --git a/.github/workflows/reusable-vipm-lock.yml b/.github/workflows/reusable-vipm-lock.yml new file mode 100644 index 00000000..a2639a6c --- /dev/null +++ b/.github/workflows/reusable-vipm-lock.yml @@ -0,0 +1,72 @@ +name: Reusable - Refresh VIPM Lock + +on: + workflow_call: + inputs: + working_directory: + description: 'Path (relative to the caller repo root) containing vipm.toml.' + required: true + type: string + labview_version: + description: 'LabVIEW version (YYYY) matching the [project] section of vipm.toml.' + required: true + type: string + labview_bitness: + description: '"32" or "64" bitness matching the [project] section of vipm.toml.' + required: true + type: string + check_only: + description: 'If true, verifies vipm.lock is in sync instead of writing it.' + required: false + type: boolean + default: false + pr_branch: + description: 'Branch name to push vipm.lock updates to.' + required: false + type: string + default: 'automation/vipm-lock-refresh' + pr_labels: + description: 'Comma-separated labels to apply to the generated PR.' + required: false + type: string + default: 'dependencies' + secrets: + VIPM_SERIAL_NUMBER: + required: false + VIPM_FULL_NAME: + required: false + VIPM_EMAIL: + required: false + +permissions: + contents: write + pull-requests: write + +jobs: + refresh-vipm-lock: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 + - uses: ni/open-source/refresh-vipm-lock@main + with: + working_directory: ${{ inputs.working_directory }} + labview_version: ${{ inputs.labview_version }} + labview_bitness: ${{ inputs.labview_bitness }} + check_only: ${{ inputs.check_only }} + vipm_serial_number: ${{ secrets.VIPM_SERIAL_NUMBER }} + vipm_full_name: ${{ secrets.VIPM_FULL_NAME }} + vipm_email: ${{ secrets.VIPM_EMAIL }} + # Opens/updates a PR only when vipm.lock actually changed; no-ops otherwise. Skipped for --check runs, which never write. + - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 + if: ${{ !inputs.check_only }} + with: + commit-message: 'chore(deps): refresh vipm.lock' + title: 'chore(deps): refresh vipm.lock' + body: | + Automated `vipm.lock` refresh generated by `ni/open-source`'s reusable + `reusable-vipm-lock.yml` workflow. + + Review the `vipm.lock` diff before merging. + branch: ${{ inputs.pr_branch }} + add-paths: ${{ inputs.working_directory }}/vipm.lock + labels: ${{ inputs.pr_labels }} diff --git a/.github/workflows/reusable-vipm-update.yml b/.github/workflows/reusable-vipm-update.yml new file mode 100644 index 00000000..9816d736 --- /dev/null +++ b/.github/workflows/reusable-vipm-update.yml @@ -0,0 +1,67 @@ +name: Reusable - Update VIPM Dependencies + +on: + workflow_call: + inputs: + working_directory: + description: 'Path (relative to the caller repo root) containing vipm.toml.' + required: true + type: string + labview_version: + description: 'LabVIEW version (YYYY) matching the [project] section of vipm.toml.' + required: true + type: string + labview_bitness: + description: '"32" or "64" bitness matching the [project] section of vipm.toml.' + required: true + type: string + pr_branch: + description: 'Branch name to push dependency updates to.' + required: false + type: string + default: 'automation/vipm-dependency-update' + pr_labels: + description: 'Comma-separated labels to apply to the generated PR.' + required: false + type: string + default: 'dependencies' + secrets: + VIPM_SERIAL_NUMBER: + required: false + VIPM_FULL_NAME: + required: false + VIPM_EMAIL: + required: false + +permissions: + contents: write + pull-requests: write + +jobs: + update-vipm-dependencies: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 + - uses: ni/open-source/update-vipm-dependencies@main + with: + working_directory: ${{ inputs.working_directory }} + labview_version: ${{ inputs.labview_version }} + labview_bitness: ${{ inputs.labview_bitness }} + vipm_serial_number: ${{ secrets.VIPM_SERIAL_NUMBER }} + vipm_full_name: ${{ secrets.VIPM_FULL_NAME }} + vipm_email: ${{ secrets.VIPM_EMAIL }} + # Opens/updates a PR only when vipm.toml or vipm.lock actually changed; no-ops otherwise. + - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 + with: + commit-message: 'chore(deps): update VIPM package dependencies' + title: 'chore(deps): update VIPM package dependencies' + body: | + Automated dependency update generated by `ni/open-source`'s reusable + `reusable-vipm-update.yml` workflow. + + Review the `vipm.toml` / `vipm.lock` diff before merging. + branch: ${{ inputs.pr_branch }} + add-paths: | + ${{ inputs.working_directory }}/vipm.toml + ${{ inputs.working_directory }}/vipm.lock + labels: ${{ inputs.pr_labels }} diff --git a/.github/workflows/vipm-dependency-update.yml b/.github/workflows/vipm-dependency-update.yml new file mode 100644 index 00000000..08fa3f25 --- /dev/null +++ b/.github/workflows/vipm-dependency-update.yml @@ -0,0 +1,18 @@ +name: Scheduled VIPM Dependency Update + +on: + schedule: + - cron: '0 6 * * 1' # Every Monday 06:00 UTC + workflow_dispatch: + +jobs: + update-vipm-dependencies: + uses: ./.github/workflows/reusable-vipm-update.yml + with: + working_directory: scripts/apply-vipc + labview_version: '2021' + labview_bitness: '64' + secrets: + VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} + VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} + VIPM_EMAIL: ${{ secrets.VIPM_EMAIL }} diff --git a/.github/workflows/vipm-lock-refresh.yml b/.github/workflows/vipm-lock-refresh.yml index 0910dddb..02690207 100644 --- a/.github/workflows/vipm-lock-refresh.yml +++ b/.github/workflows/vipm-lock-refresh.yml @@ -6,61 +6,43 @@ on: paths: - scripts/apply-vipc/vipm.toml - .github/workflows/vipm-lock-refresh.yml + - .github/workflows/reusable-vipm-lock.yml + - refresh-vipm-lock/action.yml + push: + branches: [actions] + paths: + - scripts/apply-vipc/vipm.toml workflow_dispatch: -permissions: - contents: read - jobs: + # PRs only verify vipm.lock is in sync - read-only, no commits/PRs opened here. + check-vipm-lock: + if: github.event_name == 'pull_request' + permissions: + contents: read + uses: ./.github/workflows/reusable-vipm-lock.yml + with: + working_directory: scripts/apply-vipc + labview_version: '2021' + labview_bitness: '64' + check_only: true + secrets: + VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} + VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} + VIPM_EMAIL: ${{ secrets.VIPM_EMAIL }} + + # After merge (or manual dispatch), actually refresh vipm.lock and open a PR if it drifted. refresh-vipm-lock: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 - - name: Generate vipm.lock - shell: bash - env: - VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} - VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} - VIPM_EMAIL: ${{ secrets.VIPM_EMAIL }} - run: | - set -euo pipefail - - docker run --rm -i \ - --volume "${PWD}:/workspace" \ - --workdir /workspace \ - -e VIPM_SERIAL_NUMBER="${VIPM_SERIAL_NUMBER}" \ - -e VIPM_FULL_NAME="${VIPM_FULL_NAME}" \ - -e VIPM_EMAIL="${VIPM_EMAIL}" \ - nationalinstruments/labview:latest-linux \ - bash -s <<'VIPM_SCRIPT' - set -euo pipefail - - apt-get update - apt-get install -y wget ca-certificates xvfb - - if ! command -v vipm >/dev/null 2>&1; then - wget -O /tmp/vipm.deb "https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb" - apt-get install -y /tmp/vipm.deb - fi - - export DISPLAY=:99 - export VIPM_TIMEOUT=500 - Xvfb "$DISPLAY" -screen 0 1280x720x24 -ac +extension GLX +render -noreset >/tmp/xvfb.log 2>&1 & - - vipm --version - - if [ -n "${VIPM_SERIAL_NUMBER:-}" ]; then - vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL" - fi - - cd scripts/apply-vipc - vipm lock - VIPM_SCRIPT - - test -f scripts/apply-vipc/vipm.lock - - name: Upload vipm.lock artifact - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 - with: - name: vipm-lock - path: scripts/apply-vipc/vipm.lock - if-no-files-found: error \ No newline at end of file + if: github.event_name != 'pull_request' + permissions: + contents: write + pull-requests: write + uses: ./.github/workflows/reusable-vipm-lock.yml + with: + working_directory: scripts/apply-vipc + labview_version: '2021' + labview_bitness: '64' + secrets: + VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} + VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} + VIPM_EMAIL: ${{ secrets.VIPM_EMAIL }} \ No newline at end of file diff --git a/actions/OpenSourceActions.psd1 b/actions/OpenSourceActions.psd1 index a9e703b0..5aa36b95 100644 --- a/actions/OpenSourceActions.psd1 +++ b/actions/OpenSourceActions.psd1 @@ -1,6 +1,6 @@ @{ RootModule = 'OpenSourceActions.psm1' - ModuleVersion = '1.0.0' + ModuleVersion = '1.1.1' GUID = '8c0a64c5-6a52-4d7e-9f74-8f79f21f1b2c' Author = 'LabVIEW Community CI/CD' CompanyName = 'LabVIEW Community' @@ -25,6 +25,7 @@ 'Invoke-MissingInProject' 'Invoke-ModifyVIPBDisplayInfo' 'Invoke-PrepareLabVIEWSource' + 'Invoke-RefreshVipmLock' 'Invoke-RenameFile' 'Invoke-RestoreSetupLVSource' 'Invoke-RevertDevelopmentMode' @@ -34,6 +35,7 @@ 'Invoke-SetupLabview' 'Invoke-SetupLunit' 'Invoke-SetupNipm' + 'Invoke-UpdateVipmDependencies' 'Invoke-ViaLvDocker' ) @@ -41,6 +43,7 @@ PSData = @{ ReleaseNotes = @( '1.0.0 - Initial release: adapters for apply-vipc, build-lvlibp, missing-in-project, run-unit-tests; Format-UnitTestReport helper; discovery flags; DryRun; cross-platform g-cli support.' + '1.1.1 - Fix: update-vipm-dependencies now fails the job (instead of warning and continuing) when any package cannot be resolved/updated, so a partial dependency bump never reaches vipm.lock or a PR.' ) } } diff --git a/actions/OpenSourceActions.psm1 b/actions/OpenSourceActions.psm1 index fd12abd9..71bd21c4 100644 --- a/actions/OpenSourceActions.psm1 +++ b/actions/OpenSourceActions.psm1 @@ -776,6 +776,99 @@ function Invoke-SetupNipm { return $result } +# Generates or checks vipm.lock from vipm.toml using the VIPM CLI in a Linux Docker container. +# WorkingDirectory: Path (relative to the repo root) containing vipm.toml. +# LabVIEWVersion: LabVIEW version (YYYY) matching the [project] section of vipm.toml. +# LabVIEWBitness: "32" or "64" bitness matching the [project] section of vipm.toml. +# CheckOnly: If set, runs `vipm lock --check` instead of writing vipm.lock. +# VipmSerialNumber: VIPM Pro serial number (omit to skip activation). +# VipmFullName: Name used for VIPM Pro activation. +# VipmEmail: Email used for VIPM Pro activation. +# VipmDebUrl: URL for the VIPM Linux .deb package. +# DockerImage: Docker image name (default: "nationalinstruments/labview"). +# ImageTag: Docker image tag (default: "latest-linux"). +# DryRun: If set, prints the command instead of executing it. +function Invoke-RefreshVipmLock { + [CmdletBinding()] + param( + [Parameter(Mandatory)] [string] $WorkingDirectory, + [Parameter(Mandatory)] [string] $LabVIEWVersion, + [Parameter(Mandatory)] [string] $LabVIEWBitness, + [switch] $CheckOnly, + [Parameter()] [string] $VipmSerialNumber = "", + [Parameter()] [string] $VipmFullName = "", + [Parameter()] [string] $VipmEmail = "", + [Parameter()] [string] $VipmDebUrl = "https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb", + [Parameter()] [string] $DockerImage = "nationalinstruments/labview", + [Parameter()] [string] $ImageTag = "latest-linux", + [switch] $DryRun + ) + Write-Information "Invoking RefreshVipmLock" -InformationAction Continue + + $result = Invoke-OpenSourceActionScript ` + -ScriptSegments @('refresh-vipm-lock', 'RefreshVipmLock.ps1') ` + -Arguments @{ + WorkingDirectory = $WorkingDirectory + LabVIEWVersion = $LabVIEWVersion + LabVIEWBitness = $LabVIEWBitness + CheckOnly = $CheckOnly + VipmSerialNumber = $VipmSerialNumber + VipmFullName = $VipmFullName + VipmEmail = $VipmEmail + VipmDebUrl = $VipmDebUrl + DockerImage = $DockerImage + ImageTag = $ImageTag + } ` + -DryRun:$DryRun + + return $result +} + +# Bumps every dependency in vipm.toml to its latest available version and regenerates vipm.lock. +# WorkingDirectory: Path (relative to the repo root) containing vipm.toml. +# LabVIEWVersion: LabVIEW version (YYYY) matching the [project] section of vipm.toml. +# LabVIEWBitness: "32" or "64" bitness matching the [project] section of vipm.toml. +# VipmSerialNumber: VIPM Pro serial number (`vipm add` requires Community or Professional edition). +# VipmFullName: Name used for VIPM Pro activation. +# VipmEmail: Email used for VIPM Pro activation. +# VipmDebUrl: URL for the VIPM Linux .deb package. +# DockerImage: Docker image name (default: "nationalinstruments/labview"). +# ImageTag: Docker image tag (default: "latest-linux"). +# DryRun: If set, prints the command instead of executing it. +function Invoke-UpdateVipmDependencies { + [CmdletBinding()] + param( + [Parameter(Mandatory)] [string] $WorkingDirectory, + [Parameter(Mandatory)] [string] $LabVIEWVersion, + [Parameter(Mandatory)] [string] $LabVIEWBitness, + [Parameter()] [string] $VipmSerialNumber = "", + [Parameter()] [string] $VipmFullName = "", + [Parameter()] [string] $VipmEmail = "", + [Parameter()] [string] $VipmDebUrl = "https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb", + [Parameter()] [string] $DockerImage = "nationalinstruments/labview", + [Parameter()] [string] $ImageTag = "latest-linux", + [switch] $DryRun + ) + Write-Information "Invoking UpdateVipmDependencies" -InformationAction Continue + + $result = Invoke-OpenSourceActionScript ` + -ScriptSegments @('update-vipm-dependencies', 'UpdateVipmDependencies.ps1') ` + -Arguments @{ + WorkingDirectory = $WorkingDirectory + LabVIEWVersion = $LabVIEWVersion + LabVIEWBitness = $LabVIEWBitness + VipmSerialNumber = $VipmSerialNumber + VipmFullName = $VipmFullName + VipmEmail = $VipmEmail + VipmDebUrl = $VipmDebUrl + DockerImage = $DockerImage + ImageTag = $ImageTag + } ` + -DryRun:$DryRun + + return $result +} + # Runs VI Analyzer tests using LabVIEW Docker container. # ConfigPath: Path to VI Analyzer configuration file (.viancfg) or LabVIEW files (.vi, .ctl, .llb). If empty, generates from changed files. # TemplatePath: Path to .viancfg template (required when generating config dynamically). diff --git a/dispatchers.json b/dispatchers.json index 126b4f7a..08350816 100644 --- a/dispatchers.json +++ b/dispatchers.json @@ -728,6 +728,72 @@ } } }, + "Invoke-RefreshVipmLock": { + "description": "Generates or checks vipm.lock from vipm.toml using the VIPM CLI in a Linux Docker container. WorkingDirectory: Path (relative to the repo root) containing vipm.toml. LabVIEWVersion: LabVIEW version (YYYY) matching the [project] section of vipm.toml. LabVIEWBitness: \"32\" or \"64\" bitness matching the [project] section of vipm.toml. CheckOnly: If set, runs `vipm lock --check` instead of writing vipm.lock. VipmSerialNumber: VIPM Pro serial number (omit to skip activation). VipmFullName: Name used for VIPM Pro activation. VipmEmail: Email used for VIPM Pro activation. VipmDebUrl: URL for the VIPM Linux .deb package. DockerImage: Docker image name (default: \"nationalinstruments/labview\"). ImageTag: Docker image tag (default: \"latest-linux\"). DryRun: If set, prints the command instead of executing it.", + "parameters": { + "CheckOnly": { + "type": "boolean", + "required": false, + "description": "If set, runs `vipm lock --check` instead of writing vipm" + }, + "DockerImage": { + "type": "string", + "required": false, + "default": "nationalinstruments/labview", + "description": "Docker image name (default: \"nationalinstruments/labview\")" + }, + "DryRun": { + "type": "boolean", + "required": false, + "description": "If set, prints the command instead of executing it" + }, + "ImageTag": { + "type": "string", + "required": false, + "default": "latest-linux", + "description": "Docker image tag (default: \"latest-linux\")" + }, + "LabVIEWBitness": { + "type": "string", + "required": true, + "description": "\"32\" or \"64\" bitness matching the [project] section of vipm" + }, + "LabVIEWVersion": { + "type": "string", + "required": true, + "description": "LabVIEW version (YYYY) matching the [project] section of vipm" + }, + "VipmDebUrl": { + "type": "string", + "required": false, + "default": "https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb", + "description": "URL for the VIPM Linux" + }, + "VipmEmail": { + "type": "string", + "required": false, + "default": "", + "description": "Email used for VIPM Pro activation" + }, + "VipmFullName": { + "type": "string", + "required": false, + "default": "", + "description": "Name used for VIPM Pro activation" + }, + "VipmSerialNumber": { + "type": "string", + "required": false, + "default": "", + "description": "VIPM Pro serial number (omit to skip activation)" + }, + "WorkingDirectory": { + "type": "string", + "required": true, + "description": "Path (relative to the repo root) containing vipm" + } + } + }, "Invoke-RenameFile": { "description": "Renames a file on disk. CurrentFilename: Existing path to the file. NewFilename: New path for the file. DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.", "parameters": { @@ -963,6 +1029,67 @@ } } }, + "Invoke-UpdateVipmDependencies": { + "description": "Bumps every dependency in vipm.toml to its latest available version and regenerates vipm.lock. WorkingDirectory: Path (relative to the repo root) containing vipm.toml. LabVIEWVersion: LabVIEW version (YYYY) matching the [project] section of vipm.toml. LabVIEWBitness: \"32\" or \"64\" bitness matching the [project] section of vipm.toml. VipmSerialNumber: VIPM Pro serial number (`vipm add` requires Community or Professional edition). VipmFullName: Name used for VIPM Pro activation. VipmEmail: Email used for VIPM Pro activation. VipmDebUrl: URL for the VIPM Linux .deb package. DockerImage: Docker image name (default: \"nationalinstruments/labview\"). ImageTag: Docker image tag (default: \"latest-linux\"). DryRun: If set, prints the command instead of executing it.", + "parameters": { + "DockerImage": { + "type": "string", + "required": false, + "default": "nationalinstruments/labview", + "description": "Docker image name (default: \"nationalinstruments/labview\")" + }, + "DryRun": { + "type": "boolean", + "required": false, + "description": "If set, prints the command instead of executing it" + }, + "ImageTag": { + "type": "string", + "required": false, + "default": "latest-linux", + "description": "Docker image tag (default: \"latest-linux\")" + }, + "LabVIEWBitness": { + "type": "string", + "required": true, + "description": "\"32\" or \"64\" bitness matching the [project] section of vipm" + }, + "LabVIEWVersion": { + "type": "string", + "required": true, + "description": "LabVIEW version (YYYY) matching the [project] section of vipm" + }, + "VipmDebUrl": { + "type": "string", + "required": false, + "default": "https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb", + "description": "URL for the VIPM Linux" + }, + "VipmEmail": { + "type": "string", + "required": false, + "default": "", + "description": "Email used for VIPM Pro activation" + }, + "VipmFullName": { + "type": "string", + "required": false, + "default": "", + "description": "Name used for VIPM Pro activation" + }, + "VipmSerialNumber": { + "type": "string", + "required": false, + "default": "", + "description": "VIPM Pro serial number (`vipm add` requires Community or Professional edition)" + }, + "WorkingDirectory": { + "type": "string", + "required": true, + "description": "Path (relative to the repo root) containing vipm" + } + } + }, "Invoke-ViaLvDocker": { "description": "Runs VI Analyzer tests using LabVIEW Docker container. ConfigPath: Path to VI Analyzer configuration file (.viancfg) or LabVIEW files (.vi, .ctl, .llb). If empty, generates from changed files. TemplatePath: Path to .viancfg template (required when generating config dynamically). BaseBranch: Branch to compare against for changed files (used when generating config). LabviewVersion: LabVIEW Docker image version tag. DockerImage: Full Docker image name. DryRun: If set, prints the command instead of executing it. gcliPath: Optional path prepended to PATH for locating the g CLI.", "parameters": { diff --git a/refresh-vipm-lock/action.yml b/refresh-vipm-lock/action.yml new file mode 100644 index 00000000..392edb67 --- /dev/null +++ b/refresh-vipm-lock/action.yml @@ -0,0 +1,74 @@ +name: 'Refresh VIPM Lock' +description: 'Generates or checks vipm.lock from vipm.toml using the VIPM CLI inside a Linux Docker container.' +inputs: + working_directory: + description: 'Path (relative to the caller repo root) containing vipm.toml.' + required: true + labview_version: + description: 'LabVIEW version (YYYY) matching the [project] section of vipm.toml.' + required: true + labview_bitness: + description: '"32" or "64" bitness matching the [project] section of vipm.toml.' + required: true + check_only: + description: 'If true, runs `vipm lock --check` instead of writing vipm.lock.' + default: 'false' + required: false + vipm_serial_number: + description: 'VIPM Pro serial number (pass from a secret in the caller).' + required: false + vipm_full_name: + description: 'Name used for VIPM Pro activation.' + required: false + vipm_email: + description: 'Email used for VIPM Pro activation.' + required: false + vipm_deb_url: + description: 'Override URL for the VIPM Linux .deb package.' + default: 'https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb' + required: false + docker_image: + description: 'Docker image name.' + default: 'nationalinstruments/labview' + required: false + image_tag: + description: 'Docker image tag.' + default: 'latest-linux' + required: false + log_level: + description: 'Verbosity level (ERROR|WARN|INFO|DEBUG).' + default: 'INFO' + required: false + dry_run: + description: 'If true, simulate the action without side effects.' + default: false + required: false +runs: + using: 'composite' + steps: + - name: Dispatch refresh-vipm-lock + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + $args = @{ + WorkingDirectory = '${{ inputs.working_directory }}' + LabVIEWVersion = '${{ inputs.labview_version }}' + LabVIEWBitness = '${{ inputs.labview_bitness }}' + VipmSerialNumber = '${{ inputs.vipm_serial_number }}' + VipmFullName = '${{ inputs.vipm_full_name }}' + VipmEmail = '${{ inputs.vipm_email }}' + VipmDebUrl = '${{ inputs.vipm_deb_url }}' + DockerImage = '${{ inputs.docker_image }}' + ImageTag = '${{ inputs.image_tag }}' + } + if ('${{ inputs.check_only }}' -eq 'true') { $args['CheckOnly'] = $true } + $params = @{ + ActionName = 'refresh-vipm-lock' + Args = $args + LogLevel = '${{ inputs.log_level }}' + } + if ('${{ inputs.dry_run }}' -eq 'true') { $params['DryRun'] = $true } + $script = Join-Path $env:GITHUB_ACTION_PATH '..' 'actions' 'common-dispatch.ps1' + & $script @params + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + diff --git a/scripts/refresh-vipm-lock/RefreshVipmLock.ps1 b/scripts/refresh-vipm-lock/RefreshVipmLock.ps1 new file mode 100644 index 00000000..9b720582 --- /dev/null +++ b/scripts/refresh-vipm-lock/RefreshVipmLock.ps1 @@ -0,0 +1,134 @@ +<# +.SYNOPSIS + Generates or checks vipm.lock from vipm.toml using the VIPM CLI inside a Linux Docker container. + +.DESCRIPTION + Installs/activates VIPM, runs `vipm refresh` to populate the repository cache for the + target LabVIEW version/bitness, then runs `vipm lock` (or `vipm lock --check`). + See docs.vipm.io/cli/command-reference and docs.vipm.io/vipm-toml/lock-files. + +.PARAMETER WorkingDirectory + Path (relative to the repo root) containing vipm.toml. + +.PARAMETER LabVIEWVersion + LabVIEW version (YYYY) matching the [project] section of vipm.toml. + +.PARAMETER LabVIEWBitness + "32" or "64" bitness matching the [project] section of vipm.toml. + +.PARAMETER CheckOnly + If set, runs `vipm lock --check` instead of writing vipm.lock. + +.PARAMETER VipmSerialNumber + VIPM Pro serial number. Omit to skip activation (Free edition). + +.PARAMETER VipmFullName + Name used for VIPM Pro activation. + +.PARAMETER VipmEmail + Email used for VIPM Pro activation. + +.PARAMETER VipmDebUrl + URL for the VIPM Linux .deb package. + +.PARAMETER DockerImage + Docker image name. + +.PARAMETER ImageTag + Docker image tag. + +.NOTES + Leaf script for the 'refresh-vipm-lock' dispatcher action. +#> + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true)] + [string]$WorkingDirectory, + + [Parameter(Mandatory = $true)] + [string]$LabVIEWVersion, + + [Parameter(Mandatory = $true)] + [string]$LabVIEWBitness, + + [Parameter(Mandatory = $false)] + [switch]$CheckOnly, + + [Parameter(Mandatory = $false)] + [string]$VipmSerialNumber = "", + + [Parameter(Mandatory = $false)] + [string]$VipmFullName = "", + + [Parameter(Mandatory = $false)] + [string]$VipmEmail = "", + + [Parameter(Mandatory = $false)] + [string]$VipmDebUrl = "https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb", + + [Parameter(Mandatory = $false)] + [string]$DockerImage = "nationalinstruments/labview", + + [Parameter(Mandatory = $false)] + [string]$ImageTag = "latest-linux" +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +try { + $fullImage = "${DockerImage}:${ImageTag}" + Write-Information "Docker Image: $fullImage" -InformationAction Continue + + $scriptDir = $PSScriptRoot + $refreshScript = Join-Path $scriptDir 'refresh-vipm-lock.sh' + if (-not (Test-Path $refreshScript)) { + throw "Helper script not found: $refreshScript" + } + + $containerScriptPath = "/tmp/refresh-vipm-lock.sh" + $checkOnlyValue = if ($CheckOnly) { 'true' } else { 'false' } + + $bashArgs = @( + "--working-directory", "'$WorkingDirectory'" + "--labview-version", "'$LabVIEWVersion'" + "--labview-bitness", "'$LabVIEWBitness'" + "--check-only", "'$checkOnlyValue'" + "--vipm-deb-url", "'$VipmDebUrl'" + ) + $bashCommand = "chmod +x $containerScriptPath && $containerScriptPath $($bashArgs -join ' ')" + + Write-Information "Running vipm refresh + lock in Docker container..." -InformationAction Continue + Write-Verbose "Command: bash -c `"$bashCommand`"" + + docker run --rm ` + -v "${PWD}:/workspace" ` + -v "${refreshScript}:${containerScriptPath}" ` + -w /workspace ` + -e "VIPM_SERIAL_NUMBER=$VipmSerialNumber" ` + -e "VIPM_FULL_NAME=$VipmFullName" ` + -e "VIPM_EMAIL=$VipmEmail" ` + $fullImage ` + bash -c $bashCommand ` + *>&1 | ForEach-Object { Write-Information $_ -InformationAction Continue } + + $exitCode = $LASTEXITCODE + if ($exitCode -ne 0) { + throw "vipm lock generation/check failed with exit code $exitCode" + } + + if (-not $CheckOnly) { + $lockPath = Join-Path $WorkingDirectory 'vipm.lock' + if (-not (Test-Path $lockPath)) { + throw "vipm.lock was not created at $lockPath" + } + } + + Write-Information "vipm.lock refresh succeeded" -InformationAction Continue + exit 0 +} +catch { + Write-Error "RefreshVipmLock failed: $_" + exit 1 +} diff --git a/scripts/refresh-vipm-lock/refresh-vipm-lock.sh b/scripts/refresh-vipm-lock/refresh-vipm-lock.sh new file mode 100644 index 00000000..20cb894b --- /dev/null +++ b/scripts/refresh-vipm-lock/refresh-vipm-lock.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +# Installs/activates VIPM, refreshes the repository cache, and generates or +# checks vipm.lock from vipm.toml. Executed inside the VIPM Linux container by +# RefreshVipmLock.ps1. +set -euo pipefail + +WORKING_DIRECTORY="" +LABVIEW_VERSION="" +LABVIEW_BITNESS="" +CHECK_ONLY="false" +VIPM_DEB_URL="" + +while [[ $# -gt 0 ]]; do + case "$1" in + --working-directory) WORKING_DIRECTORY="$2"; shift 2 ;; + --labview-version) LABVIEW_VERSION="$2"; shift 2 ;; + --labview-bitness) LABVIEW_BITNESS="$2"; shift 2 ;; + --check-only) CHECK_ONLY="$2"; shift 2 ;; + --vipm-deb-url) VIPM_DEB_URL="$2"; shift 2 ;; + *) echo "error: unknown argument '$1'" >&2; exit 2 ;; + esac +done + +apt-get update +apt-get install -y wget ca-certificates xvfb + +if ! command -v vipm >/dev/null 2>&1; then + wget -O /tmp/vipm.deb "${VIPM_DEB_URL}" + apt-get install -y /tmp/vipm.deb +fi + +export DISPLAY=:99 +export VIPM_TIMEOUT=500 +Xvfb "$DISPLAY" -screen 0 1280x720x24 -ac +extension GLX +render -noreset >/tmp/xvfb.log 2>&1 & + +vipm --version + +if [ -n "${VIPM_SERIAL_NUMBER:-}" ]; then + vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL" +fi + +cd "$WORKING_DIRECTORY" + +# Clean runner has no repository cache; populate it for this project's LabVIEW +# target before lock resolution (see docs.vipm.io/cli/command-reference#vipm-refresh). +vipm refresh --labview-version "$LABVIEW_VERSION" --labview-bitness "$LABVIEW_BITNESS" + +if [ "$CHECK_ONLY" = "true" ]; then + vipm lock --check +else + vipm lock +fi diff --git a/scripts/update-vipm-dependencies/UpdateVipmDependencies.ps1 b/scripts/update-vipm-dependencies/UpdateVipmDependencies.ps1 new file mode 100644 index 00000000..099558f1 --- /dev/null +++ b/scripts/update-vipm-dependencies/UpdateVipmDependencies.ps1 @@ -0,0 +1,120 @@ +<# +.SYNOPSIS + Bumps every dependency in vipm.toml to its latest available version and regenerates vipm.lock. + +.DESCRIPTION + Installs/activates VIPM, runs `vipm refresh`, then runs `vipm add ` (no version + suffix, which resolves to the latest available version per + docs.vipm.io/cli/command-reference#vipm-add) for every package declared in vipm.toml's + [dependencies] table, and finally regenerates vipm.lock with `vipm lock` (the only + command that writes it - see docs.vipm.io/vipm-toml/lock-files). + +.PARAMETER WorkingDirectory + Path (relative to the repo root) containing vipm.toml. + +.PARAMETER LabVIEWVersion + LabVIEW version (YYYY) matching the [project] section of vipm.toml. + +.PARAMETER LabVIEWBitness + "32" or "64" bitness matching the [project] section of vipm.toml. + +.PARAMETER VipmSerialNumber + VIPM Pro serial number. `vipm add` requires Community or Professional edition. + +.PARAMETER VipmFullName + Name used for VIPM Pro activation. + +.PARAMETER VipmEmail + Email used for VIPM Pro activation. + +.PARAMETER VipmDebUrl + URL for the VIPM Linux .deb package. + +.PARAMETER DockerImage + Docker image name. + +.PARAMETER ImageTag + Docker image tag. + +.NOTES + Leaf script for the 'update-vipm-dependencies' dispatcher action. +#> + +[CmdletBinding()] +param( + [Parameter(Mandatory = $true)] + [string]$WorkingDirectory, + + [Parameter(Mandatory = $true)] + [string]$LabVIEWVersion, + + [Parameter(Mandatory = $true)] + [string]$LabVIEWBitness, + + [Parameter(Mandatory = $false)] + [string]$VipmSerialNumber = "", + + [Parameter(Mandatory = $false)] + [string]$VipmFullName = "", + + [Parameter(Mandatory = $false)] + [string]$VipmEmail = "", + + [Parameter(Mandatory = $false)] + [string]$VipmDebUrl = "https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb", + + [Parameter(Mandatory = $false)] + [string]$DockerImage = "nationalinstruments/labview", + + [Parameter(Mandatory = $false)] + [string]$ImageTag = "latest-linux" +) + +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +try { + $fullImage = "${DockerImage}:${ImageTag}" + Write-Information "Docker Image: $fullImage" -InformationAction Continue + + $scriptDir = $PSScriptRoot + $updateScript = Join-Path $scriptDir 'update-vipm-dependencies.sh' + if (-not (Test-Path $updateScript)) { + throw "Helper script not found: $updateScript" + } + + $containerScriptPath = "/tmp/update-vipm-dependencies.sh" + $bashArgs = @( + "--working-directory", "'$WorkingDirectory'" + "--labview-version", "'$LabVIEWVersion'" + "--labview-bitness", "'$LabVIEWBitness'" + "--vipm-deb-url", "'$VipmDebUrl'" + ) + $bashCommand = "chmod +x $containerScriptPath && $containerScriptPath $($bashArgs -join ' ')" + + Write-Information "Running vipm dependency update in Docker container..." -InformationAction Continue + Write-Verbose "Command: bash -c `"$bashCommand`"" + + docker run --rm ` + -v "${PWD}:/workspace" ` + -v "${updateScript}:${containerScriptPath}" ` + -w /workspace ` + -e "VIPM_SERIAL_NUMBER=$VipmSerialNumber" ` + -e "VIPM_FULL_NAME=$VipmFullName" ` + -e "VIPM_EMAIL=$VipmEmail" ` + $fullImage ` + bash -c $bashCommand ` + *>&1 | ForEach-Object { Write-Information $_ -InformationAction Continue } + + $exitCode = $LASTEXITCODE + if ($exitCode -ne 0) { + throw "vipm dependency update failed with exit code $exitCode" + } + + Write-Information "vipm dependency update succeeded" -InformationAction Continue + exit 0 +} +catch { + Write-Error "UpdateVipmDependencies failed: $_" + exit 1 +} diff --git a/scripts/update-vipm-dependencies/update-vipm-dependencies.sh b/scripts/update-vipm-dependencies/update-vipm-dependencies.sh new file mode 100644 index 00000000..fcc90fb4 --- /dev/null +++ b/scripts/update-vipm-dependencies/update-vipm-dependencies.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash +# Bumps every dependency declared in vipm.toml's [dependencies] table to its +# latest available version (vipm add with no version suffix resolves to +# latest per docs.vipm.io/cli/command-reference#vipm-add), then regenerates +# vipm.lock. Executed inside the VIPM Linux container by +# UpdateVipmDependencies.ps1. +set -euo pipefail + +WORKING_DIRECTORY="" +LABVIEW_VERSION="" +LABVIEW_BITNESS="" +VIPM_DEB_URL="" + +while [[ $# -gt 0 ]]; do + case "$1" in + --working-directory) WORKING_DIRECTORY="$2"; shift 2 ;; + --labview-version) LABVIEW_VERSION="$2"; shift 2 ;; + --labview-bitness) LABVIEW_BITNESS="$2"; shift 2 ;; + --vipm-deb-url) VIPM_DEB_URL="$2"; shift 2 ;; + *) echo "error: unknown argument '$1'" >&2; exit 2 ;; + esac +done + +apt-get update +apt-get install -y wget ca-certificates xvfb + +if ! command -v vipm >/dev/null 2>&1; then + wget -O /tmp/vipm.deb "${VIPM_DEB_URL}" + apt-get install -y /tmp/vipm.deb +fi + +export DISPLAY=:99 +export VIPM_TIMEOUT=500 +Xvfb "$DISPLAY" -screen 0 1280x720x24 -ac +extension GLX +render -noreset >/tmp/xvfb.log 2>&1 & + +vipm --version + +if [ -n "${VIPM_SERIAL_NUMBER:-}" ]; then + vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL" +fi + +cd "$WORKING_DIRECTORY" + +vipm refresh --labview-version "$LABVIEW_VERSION" --labview-bitness "$LABVIEW_BITNESS" + +# Extract dependency names from the [dependencies] table (stops at the next [section]). +mapfile -t deps < <(awk ' + /^\[dependencies\]/ { in_section=1; next } + /^\[/ { in_section=0 } + in_section && NF { split($0, parts, "="); gsub(/[ \t"]/, "", parts[1]); if (parts[1] != "") print parts[1] } +' vipm.toml) + +echo "Found ${#deps[@]} dependencies to check: ${deps[*]}" + +failed=() +for pkg in "${deps[@]}"; do + echo "::group::vipm add $pkg" + # No version suffix: vipm add resolves and pins the latest available version + # (docs.vipm.io/cli/command-reference#vipm-add, example "Add one or more + # dependencies (latest available version)"). + if ! vipm add "$pkg" --labview-version "$LABVIEW_VERSION" --labview-bitness "$LABVIEW_BITNESS"; then + echo "error: could not resolve/update $pkg" >&2 + failed+=("$pkg") + fi + echo "::endgroup::" +done + +if [ "${#failed[@]}" -gt 0 ]; then + echo "error: failed to update ${#failed[@]} package(s): ${failed[*]}" >&2 + echo "Not generating vipm.lock or opening a PR with a partial/incomplete update." >&2 + exit 1 +fi + +# vipm add never creates/fully reconciles vipm.lock (docs.vipm.io/vipm-toml/lock-files), +# so regenerate it explicitly - this is the only command that writes the lock. +vipm lock diff --git a/update-vipm-dependencies/action.yml b/update-vipm-dependencies/action.yml new file mode 100644 index 00000000..adfa089e --- /dev/null +++ b/update-vipm-dependencies/action.yml @@ -0,0 +1,69 @@ +name: 'Update VIPM Dependencies' +description: 'Bumps every dependency in vipm.toml to its latest available version and regenerates vipm.lock.' +inputs: + working_directory: + description: 'Path (relative to the caller repo root) containing vipm.toml.' + required: true + labview_version: + description: 'LabVIEW version (YYYY) matching the [project] section of vipm.toml.' + required: true + labview_bitness: + description: '"32" or "64" bitness matching the [project] section of vipm.toml.' + required: true + vipm_serial_number: + description: 'VIPM Pro serial number (pass from a secret in the caller). `vipm add` requires Community or Professional edition.' + required: false + vipm_full_name: + description: 'Name used for VIPM Pro activation.' + required: false + vipm_email: + description: 'Email used for VIPM Pro activation.' + required: false + vipm_deb_url: + description: 'Override URL for the VIPM Linux .deb package.' + default: 'https://traffic.libsyn.com/secure/jkinc/vipm_26.3.1-4025_amd64.deb' + required: false + docker_image: + description: 'Docker image name.' + default: 'nationalinstruments/labview' + required: false + image_tag: + description: 'Docker image tag.' + default: 'latest-linux' + required: false + log_level: + description: 'Verbosity level (ERROR|WARN|INFO|DEBUG).' + default: 'INFO' + required: false + dry_run: + description: 'If true, simulate the action without side effects.' + default: false + required: false +runs: + using: 'composite' + steps: + - name: Dispatch update-vipm-dependencies + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + $args = @{ + WorkingDirectory = '${{ inputs.working_directory }}' + LabVIEWVersion = '${{ inputs.labview_version }}' + LabVIEWBitness = '${{ inputs.labview_bitness }}' + VipmSerialNumber = '${{ inputs.vipm_serial_number }}' + VipmFullName = '${{ inputs.vipm_full_name }}' + VipmEmail = '${{ inputs.vipm_email }}' + VipmDebUrl = '${{ inputs.vipm_deb_url }}' + DockerImage = '${{ inputs.docker_image }}' + ImageTag = '${{ inputs.image_tag }}' + } + $params = @{ + ActionName = 'update-vipm-dependencies' + Args = $args + LogLevel = '${{ inputs.log_level }}' + } + if ('${{ inputs.dry_run }}' -eq 'true') { $params['DryRun'] = $true } + $script = Join-Path $env:GITHUB_ACTION_PATH '..' 'actions' 'common-dispatch.ps1' + & $script @params + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + From 5b8873aa476d835a8d7b032338f8d1f89bd2d15c Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Sun, 27 Sep 2026 22:25:04 +0530 Subject: [PATCH 05/15] Use in-repo VIPM actions --- .github/workflows/reusable-vipm-lock.yml | 2 +- .github/workflows/reusable-vipm-update.yml | 2 +- .github/workflows/vipm-dependency-update.yml | 12 +++++++++--- refresh-vipm-lock/action.yml | 1 - update-vipm-dependencies/action.yml | 1 - 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/reusable-vipm-lock.yml b/.github/workflows/reusable-vipm-lock.yml index a2639a6c..bbf5bc57 100644 --- a/.github/workflows/reusable-vipm-lock.yml +++ b/.github/workflows/reusable-vipm-lock.yml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 - - uses: ni/open-source/refresh-vipm-lock@main + - uses: ./refresh-vipm-lock with: working_directory: ${{ inputs.working_directory }} labview_version: ${{ inputs.labview_version }} diff --git a/.github/workflows/reusable-vipm-update.yml b/.github/workflows/reusable-vipm-update.yml index 9816d736..8ca180e0 100644 --- a/.github/workflows/reusable-vipm-update.yml +++ b/.github/workflows/reusable-vipm-update.yml @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 - - uses: ni/open-source/update-vipm-dependencies@main + - uses: ./update-vipm-dependencies with: working_directory: ${{ inputs.working_directory }} labview_version: ${{ inputs.labview_version }} diff --git a/.github/workflows/vipm-dependency-update.yml b/.github/workflows/vipm-dependency-update.yml index 08fa3f25..086db6c9 100644 --- a/.github/workflows/vipm-dependency-update.yml +++ b/.github/workflows/vipm-dependency-update.yml @@ -1,8 +1,14 @@ -name: Scheduled VIPM Dependency Update +name: VIPM Dependency Update Test on: - schedule: - - cron: '0 6 * * 1' # Every Monday 06:00 UTC + pull_request: + branches: [actions] + paths: + - scripts/apply-vipc/vipm.toml + - scripts/update-vipm-dependencies/** + - update-vipm-dependencies/action.yml + - .github/workflows/vipm-dependency-update.yml + - .github/workflows/reusable-vipm-update.yml workflow_dispatch: jobs: diff --git a/refresh-vipm-lock/action.yml b/refresh-vipm-lock/action.yml index 392edb67..684fbcaa 100644 --- a/refresh-vipm-lock/action.yml +++ b/refresh-vipm-lock/action.yml @@ -71,4 +71,3 @@ runs: $script = Join-Path $env:GITHUB_ACTION_PATH '..' 'actions' 'common-dispatch.ps1' & $script @params if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - diff --git a/update-vipm-dependencies/action.yml b/update-vipm-dependencies/action.yml index adfa089e..6f4fd84f 100644 --- a/update-vipm-dependencies/action.yml +++ b/update-vipm-dependencies/action.yml @@ -66,4 +66,3 @@ runs: $script = Join-Path $env:GITHUB_ACTION_PATH '..' 'actions' 'common-dispatch.ps1' & $script @params if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - From 8fb68e34159a6ba9818677392ef32ad180fd458d Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Mon, 28 Sep 2026 10:19:21 +0530 Subject: [PATCH 06/15] Add REQ-043/REQ-044 and Pester workflow tests for VIPM lock/update actions --- requirements.json | 18 +++++++- .../pester/RefreshVipmLock.Workflow.Tests.ps1 | 44 +++++++++++++++++++ .../UpdateVipmDependencies.Workflow.Tests.ps1 | 35 +++++++++++++++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 tests/pester/RefreshVipmLock.Workflow.Tests.ps1 create mode 100644 tests/pester/UpdateVipmDependencies.Workflow.Tests.ps1 diff --git a/requirements.json b/requirements.json index 6f279c99..ab7ecd13 100644 --- a/requirements.json +++ b/requirements.json @@ -317,6 +317,22 @@ "BuildSpecGithubHostedWindows.Workflow.Tests" ] }, + { + "id": "REQ-043", + "description": "Workflow tests the composite action defined in refresh-vipm-lock/action.yml on the GitHub-hosted Ubuntu runner labeled ubuntu-latest.", + "runner": "ubuntu-latest", + "tests": [ + "RefreshVipmLock.Workflow.Tests" + ] + }, + { + "id": "REQ-044", + "description": "Workflow tests the composite action defined in update-vipm-dependencies/action.yml on the GitHub-hosted Ubuntu runner labeled ubuntu-latest.", + "runner": "ubuntu-latest", + "tests": [ + "UpdateVipmDependencies.Workflow.Tests" + ] + }, { "id": "REQIE-001", "description": "After checking out the LabVIEW icon editor repository, PreSequence: The sequencer shall enumerate and record the build matrix used by the workflow (LabVIEW versions and bitness). Acceptance: a 'matrix.json' file exists listing each tuple {\"lv-version\": \"2021\"|\"2023\", \"bitness\": \"32\"|\"64\"} with at least [ [\"2021\",\"32\"], [\"2021\",\"64\"], [\"2023\",\"64\"] ]. g-cli is expected at 'C:\\Program Files\\G-CLI\\bin\\g-cli.exe'.", @@ -428,4 +444,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/tests/pester/RefreshVipmLock.Workflow.Tests.ps1 b/tests/pester/RefreshVipmLock.Workflow.Tests.ps1 new file mode 100644 index 00000000..5f38c217 --- /dev/null +++ b/tests/pester/RefreshVipmLock.Workflow.Tests.ps1 @@ -0,0 +1,44 @@ +#requires -Version 7.0 +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +Describe 'RefreshVipmLock.Workflow' { + $meta = @{ + requirement = 'REQ-043' + Owner = 'NI' + Evidence = 'tests/pester/RefreshVipmLock.Workflow.Tests.ps1' + } + + BeforeAll { + $repoRoot = (Resolve-Path (Join-Path $PSScriptRoot '..' '..')).Path + Import-Module (Join-Path $repoRoot 'actions' 'OpenSourceActions.psd1') -Force + } + + It 'validates action.yml exists [REQ-043]' -Tag 'REQ-043' { + $actionPath = Join-Path $repoRoot 'refresh-vipm-lock' 'action.yml' + Test-Path $actionPath | Should -Be $true + } + + It 'validates implementation script exists [REQ-043]' -Tag 'REQ-043' { + $scriptPath = Join-Path $repoRoot 'scripts' 'refresh-vipm-lock' 'RefreshVipmLock.ps1' + Test-Path $scriptPath | Should -Be $true + } + + It 'executes dry-run with only required parameters [REQ-043]' -Tag 'REQ-043' { + $result = & "$repoRoot/actions/Invoke-OSAction.ps1" ` + -ActionName 'refresh-vipm-lock' ` + -ArgsJson '{"WorkingDirectory":"scripts/apply-vipc","LabVIEWVersion":"2021","LabVIEWBitness":"64"}' ` + -DryRun + + $LASTEXITCODE | Should -Be 0 + } + + It 'executes dry-run in check-only mode [REQ-043]' -Tag 'REQ-043' { + $result = & "$repoRoot/actions/Invoke-OSAction.ps1" ` + -ActionName 'refresh-vipm-lock' ` + -ArgsJson '{"WorkingDirectory":"scripts/apply-vipc","LabVIEWVersion":"2021","LabVIEWBitness":"64","CheckOnly":true}' ` + -DryRun + + $LASTEXITCODE | Should -Be 0 + } +} diff --git a/tests/pester/UpdateVipmDependencies.Workflow.Tests.ps1 b/tests/pester/UpdateVipmDependencies.Workflow.Tests.ps1 new file mode 100644 index 00000000..575173d2 --- /dev/null +++ b/tests/pester/UpdateVipmDependencies.Workflow.Tests.ps1 @@ -0,0 +1,35 @@ +#requires -Version 7.0 +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' + +Describe 'UpdateVipmDependencies.Workflow' { + $meta = @{ + requirement = 'REQ-044' + Owner = 'NI' + Evidence = 'tests/pester/UpdateVipmDependencies.Workflow.Tests.ps1' + } + + BeforeAll { + $repoRoot = (Resolve-Path (Join-Path $PSScriptRoot '..' '..')).Path + Import-Module (Join-Path $repoRoot 'actions' 'OpenSourceActions.psd1') -Force + } + + It 'validates action.yml exists [REQ-044]' -Tag 'REQ-044' { + $actionPath = Join-Path $repoRoot 'update-vipm-dependencies' 'action.yml' + Test-Path $actionPath | Should -Be $true + } + + It 'validates implementation script exists [REQ-044]' -Tag 'REQ-044' { + $scriptPath = Join-Path $repoRoot 'scripts' 'update-vipm-dependencies' 'UpdateVipmDependencies.ps1' + Test-Path $scriptPath | Should -Be $true + } + + It 'executes dry-run with only required parameters [REQ-044]' -Tag 'REQ-044' { + $result = & "$repoRoot/actions/Invoke-OSAction.ps1" ` + -ActionName 'update-vipm-dependencies' ` + -ArgsJson '{"WorkingDirectory":"scripts/apply-vipc","LabVIEWVersion":"2021","LabVIEWBitness":"64"}' ` + -DryRun + + $LASTEXITCODE | Should -Be 0 + } +} From 65943b044d99c18a18398f4f281591cebf5d28ec Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Mon, 28 Sep 2026 10:36:51 +0530 Subject: [PATCH 07/15] Fix reusable workflow permissions and dispatcher dry-run fixture --- .github/workflows/reusable-vipm-lock.yml | 4 ---- .github/workflows/reusable-vipm-update.yml | 4 ---- .github/workflows/vipm-dependency-update.yml | 3 +++ tests/pester/Dispatcher.DryRun.Tests.ps1 | 2 ++ 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/reusable-vipm-lock.yml b/.github/workflows/reusable-vipm-lock.yml index bbf5bc57..4ae9f444 100644 --- a/.github/workflows/reusable-vipm-lock.yml +++ b/.github/workflows/reusable-vipm-lock.yml @@ -38,10 +38,6 @@ on: VIPM_EMAIL: required: false -permissions: - contents: write - pull-requests: write - jobs: refresh-vipm-lock: runs-on: ubuntu-latest diff --git a/.github/workflows/reusable-vipm-update.yml b/.github/workflows/reusable-vipm-update.yml index 8ca180e0..04f58935 100644 --- a/.github/workflows/reusable-vipm-update.yml +++ b/.github/workflows/reusable-vipm-update.yml @@ -33,10 +33,6 @@ on: VIPM_EMAIL: required: false -permissions: - contents: write - pull-requests: write - jobs: update-vipm-dependencies: runs-on: ubuntu-latest diff --git a/.github/workflows/vipm-dependency-update.yml b/.github/workflows/vipm-dependency-update.yml index 086db6c9..8028f417 100644 --- a/.github/workflows/vipm-dependency-update.yml +++ b/.github/workflows/vipm-dependency-update.yml @@ -13,6 +13,9 @@ on: jobs: update-vipm-dependencies: + permissions: + contents: write + pull-requests: write uses: ./.github/workflows/reusable-vipm-update.yml with: working_directory: scripts/apply-vipc diff --git a/tests/pester/Dispatcher.DryRun.Tests.ps1 b/tests/pester/Dispatcher.DryRun.Tests.ps1 index 8b0db576..76ae6a91 100644 --- a/tests/pester/Dispatcher.DryRun.Tests.ps1 +++ b/tests/pester/Dispatcher.DryRun.Tests.ps1 @@ -32,6 +32,8 @@ Describe 'Unified Dispatcher — DryRun behavior for all actions' { VIPBPath = 'dummy.vipb' LVVersion = '2021' LVBitness = '64' + LabVIEWVersion = '2021' + LabVIEWBitness = '64' ProjectFile = 'Project.lvproj' ProjectPath = 'Project.lvproj' Major = 1 From e98aadbc7dea964aa016593b7f053a53b986812c Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Mon, 28 Sep 2026 12:20:44 +0530 Subject: [PATCH 08/15] Fix VIPM dry-run validation and activation diagnostics --- actions/OpenSourceActions.psm1 | 26 +++++++++-- .../refresh-vipm-lock/refresh-vipm-lock.sh | 43 +++++++++++++++++-- .../update-vipm-dependencies.sh | 29 +++++++++++-- tests/pester/Dispatcher.DryRun.Tests.ps1 | 2 - 4 files changed, 88 insertions(+), 12 deletions(-) diff --git a/actions/OpenSourceActions.psm1 b/actions/OpenSourceActions.psm1 index 71bd21c4..60ffcf73 100644 --- a/actions/OpenSourceActions.psm1 +++ b/actions/OpenSourceActions.psm1 @@ -792,8 +792,8 @@ function Invoke-RefreshVipmLock { [CmdletBinding()] param( [Parameter(Mandatory)] [string] $WorkingDirectory, - [Parameter(Mandatory)] [string] $LabVIEWVersion, - [Parameter(Mandatory)] [string] $LabVIEWBitness, + [string] $LabVIEWVersion, + [string] $LabVIEWBitness, [switch] $CheckOnly, [Parameter()] [string] $VipmSerialNumber = "", [Parameter()] [string] $VipmFullName = "", @@ -805,6 +805,15 @@ function Invoke-RefreshVipmLock { ) Write-Information "Invoking RefreshVipmLock" -InformationAction Continue + if (-not $DryRun) { + if ([string]::IsNullOrWhiteSpace($LabVIEWVersion) -or [string]::IsNullOrWhiteSpace($LabVIEWBitness)) { + throw 'LabVIEWVersion and LabVIEWBitness are required unless -DryRun is specified.' + } + if ($LabVIEWBitness -notin @('32', '64')) { + throw "Unsupported LabVIEW bitness: $LabVIEWBitness" + } + } + $result = Invoke-OpenSourceActionScript ` -ScriptSegments @('refresh-vipm-lock', 'RefreshVipmLock.ps1') ` -Arguments @{ @@ -839,8 +848,8 @@ function Invoke-UpdateVipmDependencies { [CmdletBinding()] param( [Parameter(Mandatory)] [string] $WorkingDirectory, - [Parameter(Mandatory)] [string] $LabVIEWVersion, - [Parameter(Mandatory)] [string] $LabVIEWBitness, + [string] $LabVIEWVersion, + [string] $LabVIEWBitness, [Parameter()] [string] $VipmSerialNumber = "", [Parameter()] [string] $VipmFullName = "", [Parameter()] [string] $VipmEmail = "", @@ -851,6 +860,15 @@ function Invoke-UpdateVipmDependencies { ) Write-Information "Invoking UpdateVipmDependencies" -InformationAction Continue + if (-not $DryRun) { + if ([string]::IsNullOrWhiteSpace($LabVIEWVersion) -or [string]::IsNullOrWhiteSpace($LabVIEWBitness)) { + throw 'LabVIEWVersion and LabVIEWBitness are required unless -DryRun is specified.' + } + if ($LabVIEWBitness -notin @('32', '64')) { + throw "Unsupported LabVIEW bitness: $LabVIEWBitness" + } + } + $result = Invoke-OpenSourceActionScript ` -ScriptSegments @('update-vipm-dependencies', 'UpdateVipmDependencies.ps1') ` -Arguments @{ diff --git a/scripts/refresh-vipm-lock/refresh-vipm-lock.sh b/scripts/refresh-vipm-lock/refresh-vipm-lock.sh index 20cb894b..4b630f45 100644 --- a/scripts/refresh-vipm-lock/refresh-vipm-lock.sh +++ b/scripts/refresh-vipm-lock/refresh-vipm-lock.sh @@ -35,8 +35,27 @@ Xvfb "$DISPLAY" -screen 0 1280x720x24 -ac +extension GLX +render -noreset >/tmp/ vipm --version +# VIPM writes detailed failures to its error-log dirs, not stdout. +dump_vipm_logs() { + echo "----- VIPM error logs -----" + for d in /usr/local/jki/vipm/VIPM-CLI/error /usr/local/jki/vipm/error; do + [ -d "$d" ] && find "$d" -type f -print -exec cat {} \; 2>/dev/null || true + done + echo "----- end VIPM error logs -----" +} + if [ -n "${VIPM_SERIAL_NUMBER:-}" ]; then - vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL" + echo "VIPM serial is configured; attempting Pro activation." + if vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL"; then + echo "VIPM Pro activation succeeded." + else + ec=$? + echo "error: VIPM Pro activation failed with exit code $ec" >&2 + dump_vipm_logs + exit "$ec" + fi +else + echo "VIPM_SERIAL_NUMBER is unset; skipping Pro activation." fi cd "$WORKING_DIRECTORY" @@ -46,7 +65,25 @@ cd "$WORKING_DIRECTORY" vipm refresh --labview-version "$LABVIEW_VERSION" --labview-bitness "$LABVIEW_BITNESS" if [ "$CHECK_ONLY" = "true" ]; then - vipm lock --check + if [ ! -f vipm.lock ]; then + echo "error: vipm.lock does not exist yet; cannot run 'vipm lock --check'. Generate and commit an initial vipm.lock first." >&2 + exit 1 + fi + if vipm lock --check; then + : + else + ec=$? + echo "error: 'vipm lock --check' failed with exit code $ec" >&2 + dump_vipm_logs + exit "$ec" + fi else - vipm lock + if vipm lock; then + : + else + ec=$? + echo "error: 'vipm lock' failed with exit code $ec" >&2 + dump_vipm_logs + exit "$ec" + fi fi diff --git a/scripts/update-vipm-dependencies/update-vipm-dependencies.sh b/scripts/update-vipm-dependencies/update-vipm-dependencies.sh index fcc90fb4..086b5d9e 100644 --- a/scripts/update-vipm-dependencies/update-vipm-dependencies.sh +++ b/scripts/update-vipm-dependencies/update-vipm-dependencies.sh @@ -35,8 +35,27 @@ Xvfb "$DISPLAY" -screen 0 1280x720x24 -ac +extension GLX +render -noreset >/tmp/ vipm --version +# VIPM writes detailed failures to its error-log dirs, not stdout. +dump_vipm_logs() { + echo "----- VIPM error logs -----" + for d in /usr/local/jki/vipm/VIPM-CLI/error /usr/local/jki/vipm/error; do + [ -d "$d" ] && find "$d" -type f -print -exec cat {} \; 2>/dev/null || true + done + echo "----- end VIPM error logs -----" +} + if [ -n "${VIPM_SERIAL_NUMBER:-}" ]; then - vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL" + echo "VIPM serial is configured; attempting Pro activation." + if vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL"; then + echo "VIPM Pro activation succeeded." + else + ec=$? + echo "error: VIPM Pro activation failed with exit code $ec" >&2 + dump_vipm_logs + exit "$ec" + fi +else + echo "VIPM_SERIAL_NUMBER is unset; skipping Pro activation." fi cd "$WORKING_DIRECTORY" @@ -58,8 +77,12 @@ for pkg in "${deps[@]}"; do # No version suffix: vipm add resolves and pins the latest available version # (docs.vipm.io/cli/command-reference#vipm-add, example "Add one or more # dependencies (latest available version)"). - if ! vipm add "$pkg" --labview-version "$LABVIEW_VERSION" --labview-bitness "$LABVIEW_BITNESS"; then - echo "error: could not resolve/update $pkg" >&2 + if vipm add "$pkg" --labview-version "$LABVIEW_VERSION" --labview-bitness "$LABVIEW_BITNESS"; then + : + else + ec=$? + echo "error: could not resolve/update $pkg (exit $ec)" >&2 + dump_vipm_logs failed+=("$pkg") fi echo "::endgroup::" diff --git a/tests/pester/Dispatcher.DryRun.Tests.ps1 b/tests/pester/Dispatcher.DryRun.Tests.ps1 index 76ae6a91..8b0db576 100644 --- a/tests/pester/Dispatcher.DryRun.Tests.ps1 +++ b/tests/pester/Dispatcher.DryRun.Tests.ps1 @@ -32,8 +32,6 @@ Describe 'Unified Dispatcher — DryRun behavior for all actions' { VIPBPath = 'dummy.vipb' LVVersion = '2021' LVBitness = '64' - LabVIEWVersion = '2021' - LabVIEWBitness = '64' ProjectFile = 'Project.lvproj' ProjectPath = 'Project.lvproj' Major = 1 From 3d3655cda37b269fb6b202ef8942d14c40e3371f Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Mon, 28 Sep 2026 12:31:04 +0530 Subject: [PATCH 09/15] Require VIPM Pro activation and improve failure diagnostics --- dispatchers.json | 8 +++---- .../refresh-vipm-lock/refresh-vipm-lock.sh | 23 ++++++++++--------- .../update-vipm-dependencies.sh | 23 ++++++++++--------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/dispatchers.json b/dispatchers.json index 08350816..50c27857 100644 --- a/dispatchers.json +++ b/dispatchers.json @@ -755,12 +755,12 @@ }, "LabVIEWBitness": { "type": "string", - "required": true, + "required": false, "description": "\"32\" or \"64\" bitness matching the [project] section of vipm" }, "LabVIEWVersion": { "type": "string", - "required": true, + "required": false, "description": "LabVIEW version (YYYY) matching the [project] section of vipm" }, "VipmDebUrl": { @@ -1051,12 +1051,12 @@ }, "LabVIEWBitness": { "type": "string", - "required": true, + "required": false, "description": "\"32\" or \"64\" bitness matching the [project] section of vipm" }, "LabVIEWVersion": { "type": "string", - "required": true, + "required": false, "description": "LabVIEW version (YYYY) matching the [project] section of vipm" }, "VipmDebUrl": { diff --git a/scripts/refresh-vipm-lock/refresh-vipm-lock.sh b/scripts/refresh-vipm-lock/refresh-vipm-lock.sh index 4b630f45..fb0a713b 100644 --- a/scripts/refresh-vipm-lock/refresh-vipm-lock.sh +++ b/scripts/refresh-vipm-lock/refresh-vipm-lock.sh @@ -21,6 +21,11 @@ while [[ $# -gt 0 ]]; do esac done +if [ -z "${VIPM_SERIAL_NUMBER:-}" ] || [ -z "${VIPM_FULL_NAME:-}" ] || [ -z "${VIPM_EMAIL:-}" ]; then + echo "error: VIPM Pro activation requires VIPM_SERIAL_NUMBER, VIPM_FULL_NAME, and VIPM_EMAIL secrets." >&2 + exit 2 +fi + apt-get update apt-get install -y wget ca-certificates xvfb @@ -44,18 +49,14 @@ dump_vipm_logs() { echo "----- end VIPM error logs -----" } -if [ -n "${VIPM_SERIAL_NUMBER:-}" ]; then - echo "VIPM serial is configured; attempting Pro activation." - if vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL"; then - echo "VIPM Pro activation succeeded." - else - ec=$? - echo "error: VIPM Pro activation failed with exit code $ec" >&2 - dump_vipm_logs - exit "$ec" - fi +echo "VIPM Pro credentials are configured; attempting activation." +if vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL"; then + echo "VIPM Pro activation succeeded." else - echo "VIPM_SERIAL_NUMBER is unset; skipping Pro activation." + ec=$? + echo "error: VIPM Pro activation failed with exit code $ec" >&2 + dump_vipm_logs + exit "$ec" fi cd "$WORKING_DIRECTORY" diff --git a/scripts/update-vipm-dependencies/update-vipm-dependencies.sh b/scripts/update-vipm-dependencies/update-vipm-dependencies.sh index 086b5d9e..3d4d9087 100644 --- a/scripts/update-vipm-dependencies/update-vipm-dependencies.sh +++ b/scripts/update-vipm-dependencies/update-vipm-dependencies.sh @@ -21,6 +21,11 @@ while [[ $# -gt 0 ]]; do esac done +if [ -z "${VIPM_SERIAL_NUMBER:-}" ] || [ -z "${VIPM_FULL_NAME:-}" ] || [ -z "${VIPM_EMAIL:-}" ]; then + echo "error: VIPM Pro activation requires VIPM_SERIAL_NUMBER, VIPM_FULL_NAME, and VIPM_EMAIL secrets." >&2 + exit 2 +fi + apt-get update apt-get install -y wget ca-certificates xvfb @@ -44,18 +49,14 @@ dump_vipm_logs() { echo "----- end VIPM error logs -----" } -if [ -n "${VIPM_SERIAL_NUMBER:-}" ]; then - echo "VIPM serial is configured; attempting Pro activation." - if vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL"; then - echo "VIPM Pro activation succeeded." - else - ec=$? - echo "error: VIPM Pro activation failed with exit code $ec" >&2 - dump_vipm_logs - exit "$ec" - fi +echo "VIPM Pro credentials are configured; attempting activation." +if vipm activate --serial-number "$VIPM_SERIAL_NUMBER" --name "$VIPM_FULL_NAME" --email "$VIPM_EMAIL"; then + echo "VIPM Pro activation succeeded." else - echo "VIPM_SERIAL_NUMBER is unset; skipping Pro activation." + ec=$? + echo "error: VIPM Pro activation failed with exit code $ec" >&2 + dump_vipm_logs + exit "$ec" fi cd "$WORKING_DIRECTORY" From 75150ef3bb47f1c77eeb410ea2374b187a622e7d Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Mon, 28 Sep 2026 16:48:31 +0530 Subject: [PATCH 10/15] Support initial VIPM lock generation and explicit PR base --- .github/workflows/reusable-vipm-lock.yml | 14 +++++++++- .github/workflows/reusable-vipm-update.yml | 5 ++++ .github/workflows/vipm-dependency-update.yml | 1 + .github/workflows/vipm-lock-refresh.yml | 3 +++ actions/OpenSourceActions.psm1 | 2 +- dispatchers.json | 4 +-- refresh-vipm-lock/action.yml | 2 +- scripts/refresh-vipm-lock/RefreshVipmLock.ps1 | 2 +- .../refresh-vipm-lock/refresh-vipm-lock.sh | 26 ++++++++++++------- 9 files changed, 44 insertions(+), 15 deletions(-) diff --git a/.github/workflows/reusable-vipm-lock.yml b/.github/workflows/reusable-vipm-lock.yml index 4ae9f444..f066690f 100644 --- a/.github/workflows/reusable-vipm-lock.yml +++ b/.github/workflows/reusable-vipm-lock.yml @@ -16,10 +16,14 @@ on: required: true type: string check_only: - description: 'If true, verifies vipm.lock is in sync instead of writing it.' + description: 'If true, verifies an existing vipm.lock or generates the initial lock when absent.' required: false type: boolean default: false + base_branch: + description: 'Target branch for the generated pull request.' + required: true + type: string pr_branch: description: 'Branch name to push vipm.lock updates to.' required: false @@ -52,6 +56,13 @@ jobs: vipm_serial_number: ${{ secrets.VIPM_SERIAL_NUMBER }} vipm_full_name: ${{ secrets.VIPM_FULL_NAME }} vipm_email: ${{ secrets.VIPM_EMAIL }} + - name: Upload vipm.lock artifact + if: ${{ inputs.check_only }} + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: vipm-lock + path: ${{ inputs.working_directory }}/vipm.lock + if-no-files-found: error # Opens/updates a PR only when vipm.lock actually changed; no-ops otherwise. Skipped for --check runs, which never write. - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 if: ${{ !inputs.check_only }} @@ -63,6 +74,7 @@ jobs: `reusable-vipm-lock.yml` workflow. Review the `vipm.lock` diff before merging. + base: ${{ inputs.base_branch }} branch: ${{ inputs.pr_branch }} add-paths: ${{ inputs.working_directory }}/vipm.lock labels: ${{ inputs.pr_labels }} diff --git a/.github/workflows/reusable-vipm-update.yml b/.github/workflows/reusable-vipm-update.yml index 04f58935..6f976ad1 100644 --- a/.github/workflows/reusable-vipm-update.yml +++ b/.github/workflows/reusable-vipm-update.yml @@ -15,6 +15,10 @@ on: description: '"32" or "64" bitness matching the [project] section of vipm.toml.' required: true type: string + base_branch: + description: 'Target branch for the generated pull request.' + required: true + type: string pr_branch: description: 'Branch name to push dependency updates to.' required: false @@ -56,6 +60,7 @@ jobs: `reusable-vipm-update.yml` workflow. Review the `vipm.toml` / `vipm.lock` diff before merging. + base: ${{ inputs.base_branch }} branch: ${{ inputs.pr_branch }} add-paths: | ${{ inputs.working_directory }}/vipm.toml diff --git a/.github/workflows/vipm-dependency-update.yml b/.github/workflows/vipm-dependency-update.yml index 8028f417..a98c1a7e 100644 --- a/.github/workflows/vipm-dependency-update.yml +++ b/.github/workflows/vipm-dependency-update.yml @@ -21,6 +21,7 @@ jobs: working_directory: scripts/apply-vipc labview_version: '2021' labview_bitness: '64' + base_branch: actions secrets: VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} diff --git a/.github/workflows/vipm-lock-refresh.yml b/.github/workflows/vipm-lock-refresh.yml index 02690207..c545a534 100644 --- a/.github/workflows/vipm-lock-refresh.yml +++ b/.github/workflows/vipm-lock-refresh.yml @@ -8,6 +8,7 @@ on: - .github/workflows/vipm-lock-refresh.yml - .github/workflows/reusable-vipm-lock.yml - refresh-vipm-lock/action.yml + - scripts/refresh-vipm-lock/** push: branches: [actions] paths: @@ -25,6 +26,7 @@ jobs: working_directory: scripts/apply-vipc labview_version: '2021' labview_bitness: '64' + base_branch: actions check_only: true secrets: VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} @@ -42,6 +44,7 @@ jobs: working_directory: scripts/apply-vipc labview_version: '2021' labview_bitness: '64' + base_branch: actions secrets: VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} diff --git a/actions/OpenSourceActions.psm1 b/actions/OpenSourceActions.psm1 index 60ffcf73..01a90c5a 100644 --- a/actions/OpenSourceActions.psm1 +++ b/actions/OpenSourceActions.psm1 @@ -780,7 +780,7 @@ function Invoke-SetupNipm { # WorkingDirectory: Path (relative to the repo root) containing vipm.toml. # LabVIEWVersion: LabVIEW version (YYYY) matching the [project] section of vipm.toml. # LabVIEWBitness: "32" or "64" bitness matching the [project] section of vipm.toml. -# CheckOnly: If set, runs `vipm lock --check` instead of writing vipm.lock. +# CheckOnly: If set, checks an existing vipm.lock or generates the initial lock when absent. # VipmSerialNumber: VIPM Pro serial number (omit to skip activation). # VipmFullName: Name used for VIPM Pro activation. # VipmEmail: Email used for VIPM Pro activation. diff --git a/dispatchers.json b/dispatchers.json index 50c27857..235b5e24 100644 --- a/dispatchers.json +++ b/dispatchers.json @@ -729,12 +729,12 @@ } }, "Invoke-RefreshVipmLock": { - "description": "Generates or checks vipm.lock from vipm.toml using the VIPM CLI in a Linux Docker container. WorkingDirectory: Path (relative to the repo root) containing vipm.toml. LabVIEWVersion: LabVIEW version (YYYY) matching the [project] section of vipm.toml. LabVIEWBitness: \"32\" or \"64\" bitness matching the [project] section of vipm.toml. CheckOnly: If set, runs `vipm lock --check` instead of writing vipm.lock. VipmSerialNumber: VIPM Pro serial number (omit to skip activation). VipmFullName: Name used for VIPM Pro activation. VipmEmail: Email used for VIPM Pro activation. VipmDebUrl: URL for the VIPM Linux .deb package. DockerImage: Docker image name (default: \"nationalinstruments/labview\"). ImageTag: Docker image tag (default: \"latest-linux\"). DryRun: If set, prints the command instead of executing it.", + "description": "Generates or checks vipm.lock from vipm.toml using the VIPM CLI in a Linux Docker container. WorkingDirectory: Path (relative to the repo root) containing vipm.toml. LabVIEWVersion: LabVIEW version (YYYY) matching the [project] section of vipm.toml. LabVIEWBitness: \"32\" or \"64\" bitness matching the [project] section of vipm.toml. CheckOnly: If set, checks an existing vipm.lock or generates the initial lock when absent. VipmSerialNumber: VIPM Pro serial number (omit to skip activation). VipmFullName: Name used for VIPM Pro activation. VipmEmail: Email used for VIPM Pro activation. VipmDebUrl: URL for the VIPM Linux .deb package. DockerImage: Docker image name (default: \"nationalinstruments/labview\"). ImageTag: Docker image tag (default: \"latest-linux\"). DryRun: If set, prints the command instead of executing it.", "parameters": { "CheckOnly": { "type": "boolean", "required": false, - "description": "If set, runs `vipm lock --check` instead of writing vipm" + "description": "If set, checks an existing vipm" }, "DockerImage": { "type": "string", diff --git a/refresh-vipm-lock/action.yml b/refresh-vipm-lock/action.yml index 684fbcaa..0c53d9b3 100644 --- a/refresh-vipm-lock/action.yml +++ b/refresh-vipm-lock/action.yml @@ -11,7 +11,7 @@ inputs: description: '"32" or "64" bitness matching the [project] section of vipm.toml.' required: true check_only: - description: 'If true, runs `vipm lock --check` instead of writing vipm.lock.' + description: 'If true, checks an existing vipm.lock or generates the initial lock when absent.' default: 'false' required: false vipm_serial_number: diff --git a/scripts/refresh-vipm-lock/RefreshVipmLock.ps1 b/scripts/refresh-vipm-lock/RefreshVipmLock.ps1 index 9b720582..29e820af 100644 --- a/scripts/refresh-vipm-lock/RefreshVipmLock.ps1 +++ b/scripts/refresh-vipm-lock/RefreshVipmLock.ps1 @@ -17,7 +17,7 @@ "32" or "64" bitness matching the [project] section of vipm.toml. .PARAMETER CheckOnly - If set, runs `vipm lock --check` instead of writing vipm.lock. + If set, checks an existing vipm.lock or generates the initial lock when absent. .PARAMETER VipmSerialNumber VIPM Pro serial number. Omit to skip activation (Free edition). diff --git a/scripts/refresh-vipm-lock/refresh-vipm-lock.sh b/scripts/refresh-vipm-lock/refresh-vipm-lock.sh index fb0a713b..8e8ee672 100644 --- a/scripts/refresh-vipm-lock/refresh-vipm-lock.sh +++ b/scripts/refresh-vipm-lock/refresh-vipm-lock.sh @@ -67,16 +67,24 @@ vipm refresh --labview-version "$LABVIEW_VERSION" --labview-bitness "$LABVIEW_BI if [ "$CHECK_ONLY" = "true" ]; then if [ ! -f vipm.lock ]; then - echo "error: vipm.lock does not exist yet; cannot run 'vipm lock --check'. Generate and commit an initial vipm.lock first." >&2 - exit 1 - fi - if vipm lock --check; then - : + echo "vipm.lock does not exist; generating the initial lock file." + if vipm lock; then + echo "Initial vipm.lock generated successfully." + else + ec=$? + echo "error: initial 'vipm lock' generation failed with exit code $ec" >&2 + dump_vipm_logs + exit "$ec" + fi else - ec=$? - echo "error: 'vipm lock --check' failed with exit code $ec" >&2 - dump_vipm_logs - exit "$ec" + if vipm lock --check; then + : + else + ec=$? + echo "error: 'vipm lock --check' failed with exit code $ec" >&2 + dump_vipm_logs + exit "$ec" + fi fi else if vipm lock; then From c83169de46d6e94bb4b1e77451cdddde2c048c4a Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Mon, 28 Sep 2026 17:03:28 +0530 Subject: [PATCH 11/15] Add initial VIPM lock file --- scripts/apply-vipc/vipm.lock | 186 +++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 scripts/apply-vipc/vipm.lock diff --git a/scripts/apply-vipc/vipm.lock b/scripts/apply-vipc/vipm.lock new file mode 100644 index 00000000..6e6acd8c --- /dev/null +++ b/scripts/apply-vipc/vipm.lock @@ -0,0 +1,186 @@ +# It is not intended for manual editing. + +version = 2 +revision = 0 +updated-at = "2026-09-28T11:20:23.409677154Z" +requires-labview = "2021" +labview-bitness = 64 + +[[vipm.repo]] +name = "VIPM Community" +uri = "http://www.jkisoft.com/packages" + +[[package]] +name = "astemes_lib_lunit" +version = "1.10.7.3" +manager = "vipm" +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:0eec735c67849e00bacb792d90030318" + +[[package]] +name = "hse_lib_git_api" +version = "2.3.4.176" +manager = "vipm" +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:af3256375655bdb2af8503025a754da2" + +[[package]] +name = "jki_lib_serialization" +version = "1.0.1.14" +manager = "vipm" +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:51997ae9c8110c50bec7d725cdf1598f" + +[[package]] +name = "jki_lib_state_machine" +version = "2024.0.3.23" +manager = "vipm" +dependencies = ["jki_rsc_toolkits_palette"] +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:58d05fd50ecd54c4f1bfc05d47064f61" + +[[package]] +name = "jki_lib_unicode" +version = "1.0.0.7" +manager = "vipm" +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:5b478d1b5b86bf9d3366b55515b2d520" + +[[package]] +name = "jki_lib_vipm_api" +version = "2020.0.3.80" +manager = "vipm" +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:cb505625a4ff64539096f041ad32f687" + +[[package]] +name = "jki_rsc_toolkits_palette" +version = "1.1-1" +manager = "vipm" +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:d8e12776ee5532544b44cc7ab43045f8" + +[[package]] +name = "oglib_array" +version = "6.0.1.20" +manager = "vipm" +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:a56326241d08d49c74b7c4dc47eef591" + +[[package]] +name = "oglib_error" +version = "6.0.0.26" +manager = "vipm" +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:2e202920a5ca2b6fc1db1705924ba90c" + +[[package]] +name = "oglib_file" +version = "6.0.2.28" +manager = "vipm" +dependencies = [ + "oglib_array", + "oglib_error", +] +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:55f6536972da75ee7f1ab59fd72f1ace" + +[[package]] +name = "oglib_lvdata" +version = "6.0.0.45" +manager = "vipm" +dependencies = ["oglib_error"] +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:7ac1df48c85dc6fe8f2b6ed50706d5c5" + +[[package]] +name = "oglib_lvzip" +version = "5.0.9-1" +manager = "vipm" +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:777dcc49eebb8062cd69eb0db806df1a" + +[[package]] +name = "sas_workshops_lib_lunit_for_g_cli" +version = "1.1.1.54" +manager = "vipm" +dependencies = [ + "astemes_lib_lunit", + "wiresmith_technology_lib_g_cli", +] +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:58fa03e58052b1813d209fc92a748640" + +[[package]] +name = "sas_workshops_lib_lvbuildspec_for_g_cli" +version = "1.2.1.104" +manager = "vipm" +dependencies = ["wiresmith_technology_lib_g_cli"] +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:52e086b74929d6e1da3bbdaa6238ebc1" + +[[package]] +name = "sas_workshops_lib_vipb_builder_for_g_cli" +version = "1.1.6.46" +manager = "vipm" +dependencies = [ + "jki_lib_vipm_api", + "wiresmith_technology_lib_g_cli", +] +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:b2fddfd5015cbf48a2fd433278c0776f" + +[[package]] +name = "wiresmith_technology_lib_g_cli" +version = "3.0.1.98" +manager = "vipm" +resolution-source = "repo" + +[[package.source]] +repo = "VIPM Community" +checksum = "md5:afd65a73b9c5719d91830db7a021d111" From d8a67bcfa95b586f5efff1c580d1614920fcab6d Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Mon, 28 Sep 2026 17:05:56 +0530 Subject: [PATCH 12/15] Target dependency update PR at feature branch for testing --- .github/workflows/vipm-dependency-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vipm-dependency-update.yml b/.github/workflows/vipm-dependency-update.yml index a98c1a7e..7a071604 100644 --- a/.github/workflows/vipm-dependency-update.yml +++ b/.github/workflows/vipm-dependency-update.yml @@ -21,7 +21,7 @@ jobs: working_directory: scripts/apply-vipc labview_version: '2021' labview_bitness: '64' - base_branch: actions + base_branch: users/amrutha/vipm-lock-refresh-and-dependency-update secrets: VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} From e1265e8a10508c84c81f62fb5910949071f664ab Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Mon, 28 Sep 2026 18:26:04 +0530 Subject: [PATCH 13/15] Keep VIPM reusable workflows callable --- .github/workflows/reusable-vipm-lock.yml | 7 ++- .github/workflows/reusable-vipm-update.yml | 7 ++- .github/workflows/vipm-dependency-update.yml | 28 ----------- .github/workflows/vipm-lock-refresh.yml | 51 -------------------- 4 files changed, 6 insertions(+), 87 deletions(-) delete mode 100644 .github/workflows/vipm-dependency-update.yml delete mode 100644 .github/workflows/vipm-lock-refresh.yml diff --git a/.github/workflows/reusable-vipm-lock.yml b/.github/workflows/reusable-vipm-lock.yml index f066690f..de2d0d20 100644 --- a/.github/workflows/reusable-vipm-lock.yml +++ b/.github/workflows/reusable-vipm-lock.yml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 - - uses: ./refresh-vipm-lock + - uses: ni/open-source/refresh-vipm-lock@users/amrutha/vipm-lock-refresh-and-dependency-update with: working_directory: ${{ inputs.working_directory }} labview_version: ${{ inputs.labview_version }} @@ -63,8 +63,7 @@ jobs: name: vipm-lock path: ${{ inputs.working_directory }}/vipm.lock if-no-files-found: error - # Opens/updates a PR only when vipm.lock actually changed; no-ops otherwise. Skipped for --check runs, which never write. - - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 + - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 if: ${{ !inputs.check_only }} with: commit-message: 'chore(deps): refresh vipm.lock' @@ -77,4 +76,4 @@ jobs: base: ${{ inputs.base_branch }} branch: ${{ inputs.pr_branch }} add-paths: ${{ inputs.working_directory }}/vipm.lock - labels: ${{ inputs.pr_labels }} + labels: ${{ inputs.pr_labels }} \ No newline at end of file diff --git a/.github/workflows/reusable-vipm-update.yml b/.github/workflows/reusable-vipm-update.yml index 6f976ad1..a4160b33 100644 --- a/.github/workflows/reusable-vipm-update.yml +++ b/.github/workflows/reusable-vipm-update.yml @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 - - uses: ./update-vipm-dependencies + - uses: ni/open-source/update-vipm-dependencies@users/amrutha/vipm-lock-refresh-and-dependency-update with: working_directory: ${{ inputs.working_directory }} labview_version: ${{ inputs.labview_version }} @@ -50,8 +50,7 @@ jobs: vipm_serial_number: ${{ secrets.VIPM_SERIAL_NUMBER }} vipm_full_name: ${{ secrets.VIPM_FULL_NAME }} vipm_email: ${{ secrets.VIPM_EMAIL }} - # Opens/updates a PR only when vipm.toml or vipm.lock actually changed; no-ops otherwise. - - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 + - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 with: commit-message: 'chore(deps): update VIPM package dependencies' title: 'chore(deps): update VIPM package dependencies' @@ -65,4 +64,4 @@ jobs: add-paths: | ${{ inputs.working_directory }}/vipm.toml ${{ inputs.working_directory }}/vipm.lock - labels: ${{ inputs.pr_labels }} + labels: ${{ inputs.pr_labels }} \ No newline at end of file diff --git a/.github/workflows/vipm-dependency-update.yml b/.github/workflows/vipm-dependency-update.yml deleted file mode 100644 index 7a071604..00000000 --- a/.github/workflows/vipm-dependency-update.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: VIPM Dependency Update Test - -on: - pull_request: - branches: [actions] - paths: - - scripts/apply-vipc/vipm.toml - - scripts/update-vipm-dependencies/** - - update-vipm-dependencies/action.yml - - .github/workflows/vipm-dependency-update.yml - - .github/workflows/reusable-vipm-update.yml - workflow_dispatch: - -jobs: - update-vipm-dependencies: - permissions: - contents: write - pull-requests: write - uses: ./.github/workflows/reusable-vipm-update.yml - with: - working_directory: scripts/apply-vipc - labview_version: '2021' - labview_bitness: '64' - base_branch: users/amrutha/vipm-lock-refresh-and-dependency-update - secrets: - VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} - VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} - VIPM_EMAIL: ${{ secrets.VIPM_EMAIL }} diff --git a/.github/workflows/vipm-lock-refresh.yml b/.github/workflows/vipm-lock-refresh.yml deleted file mode 100644 index c545a534..00000000 --- a/.github/workflows/vipm-lock-refresh.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Refresh VIPM Lock - -on: - pull_request: - branches: [actions] - paths: - - scripts/apply-vipc/vipm.toml - - .github/workflows/vipm-lock-refresh.yml - - .github/workflows/reusable-vipm-lock.yml - - refresh-vipm-lock/action.yml - - scripts/refresh-vipm-lock/** - push: - branches: [actions] - paths: - - scripts/apply-vipc/vipm.toml - workflow_dispatch: - -jobs: - # PRs only verify vipm.lock is in sync - read-only, no commits/PRs opened here. - check-vipm-lock: - if: github.event_name == 'pull_request' - permissions: - contents: read - uses: ./.github/workflows/reusable-vipm-lock.yml - with: - working_directory: scripts/apply-vipc - labview_version: '2021' - labview_bitness: '64' - base_branch: actions - check_only: true - secrets: - VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} - VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} - VIPM_EMAIL: ${{ secrets.VIPM_EMAIL }} - - # After merge (or manual dispatch), actually refresh vipm.lock and open a PR if it drifted. - refresh-vipm-lock: - if: github.event_name != 'pull_request' - permissions: - contents: write - pull-requests: write - uses: ./.github/workflows/reusable-vipm-lock.yml - with: - working_directory: scripts/apply-vipc - labview_version: '2021' - labview_bitness: '64' - base_branch: actions - secrets: - VIPM_SERIAL_NUMBER: ${{ secrets.VIPM_SERIAL_NUMBER }} - VIPM_FULL_NAME: ${{ secrets.VIPM_FULL_NAME }} - VIPM_EMAIL: ${{ secrets.VIPM_EMAIL }} \ No newline at end of file From 3640ab684b10078e2719bb1ec52bb2ba1c63065c Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Tue, 29 Sep 2026 10:18:57 +0530 Subject: [PATCH 14/15] Add temporary VIPM update PR test --- .github/workflows/reusable-vipm-update.yml | 50 ++++++++++++++++++++-- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-vipm-update.yml b/.github/workflows/reusable-vipm-update.yml index a4160b33..5575d8f0 100644 --- a/.github/workflows/reusable-vipm-update.yml +++ b/.github/workflows/reusable-vipm-update.yml @@ -37,6 +37,47 @@ on: VIPM_EMAIL: required: false + workflow_dispatch: + inputs: + working_directory: + description: 'Path (relative to this repository root) containing vipm.toml.' + required: true + type: string + labview_version: + description: 'LabVIEW version (YYYY).' + required: true + type: string + labview_bitness: + description: '"32" or "64" bitness.' + required: true + type: string + base_branch: + description: 'Target branch for the generated pull request.' + required: true + type: string + pr_branch: + description: 'Branch name to push dependency updates to.' + required: false + type: string + default: 'automation/vipm-dependency-update' + pr_labels: + description: 'Comma-separated labels to apply to the generated PR.' + required: false + type: string + default: 'dependencies' + + pull_request: + branches: [actions] + paths: + - scripts/apply-vipc/vipm.toml + - scripts/update-vipm-dependencies/** + - update-vipm-dependencies/action.yml + - .github/workflows/reusable-vipm-update.yml + +permissions: + contents: write + pull-requests: write + jobs: update-vipm-dependencies: runs-on: ubuntu-latest @@ -44,13 +85,14 @@ jobs: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 - uses: ni/open-source/update-vipm-dependencies@users/amrutha/vipm-lock-refresh-and-dependency-update with: - working_directory: ${{ inputs.working_directory }} - labview_version: ${{ inputs.labview_version }} - labview_bitness: ${{ inputs.labview_bitness }} + working_directory: ${{ inputs.working_directory || 'scripts/apply-vipc' }} + labview_version: ${{ inputs.labview_version || '2021' }} + labview_bitness: ${{ inputs.labview_bitness || '64' }} vipm_serial_number: ${{ secrets.VIPM_SERIAL_NUMBER }} vipm_full_name: ${{ secrets.VIPM_FULL_NAME }} vipm_email: ${{ secrets.VIPM_EMAIL }} - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 + if: ${{ github.event_name != 'pull_request' }} with: commit-message: 'chore(deps): update VIPM package dependencies' title: 'chore(deps): update VIPM package dependencies' @@ -59,7 +101,7 @@ jobs: `reusable-vipm-update.yml` workflow. Review the `vipm.toml` / `vipm.lock` diff before merging. - base: ${{ inputs.base_branch }} + base: ${{ inputs.base_branch || github.base_ref }} branch: ${{ inputs.pr_branch }} add-paths: | ${{ inputs.working_directory }}/vipm.toml From 51bebdddb42eb657f02df1241c98038c30bf7e0a Mon Sep 17 00:00:00 2001 From: Amrutha G Date: Tue, 29 Sep 2026 10:41:05 +0530 Subject: [PATCH 15/15] Generalize VIPM update workflow defaults --- .github/workflows/reusable-vipm-update.yml | 23 +++++++--------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/reusable-vipm-update.yml b/.github/workflows/reusable-vipm-update.yml index 5575d8f0..c344b751 100644 --- a/.github/workflows/reusable-vipm-update.yml +++ b/.github/workflows/reusable-vipm-update.yml @@ -16,7 +16,7 @@ on: required: true type: string base_branch: - description: 'Target branch for the generated pull request.' + description: 'Target branch for the generated pull request in the caller repository.' required: true type: string pr_branch: @@ -52,8 +52,8 @@ on: required: true type: string base_branch: - description: 'Target branch for the generated pull request.' - required: true + description: "Optional target branch; defaults to this repository's default branch." + required: false type: string pr_branch: description: 'Branch name to push dependency updates to.' @@ -66,14 +66,6 @@ on: type: string default: 'dependencies' - pull_request: - branches: [actions] - paths: - - scripts/apply-vipc/vipm.toml - - scripts/update-vipm-dependencies/** - - update-vipm-dependencies/action.yml - - .github/workflows/reusable-vipm-update.yml - permissions: contents: write pull-requests: write @@ -85,14 +77,13 @@ jobs: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 - uses: ni/open-source/update-vipm-dependencies@users/amrutha/vipm-lock-refresh-and-dependency-update with: - working_directory: ${{ inputs.working_directory || 'scripts/apply-vipc' }} - labview_version: ${{ inputs.labview_version || '2021' }} - labview_bitness: ${{ inputs.labview_bitness || '64' }} + working_directory: ${{ inputs.working_directory }} + labview_version: ${{ inputs.labview_version }} + labview_bitness: ${{ inputs.labview_bitness }} vipm_serial_number: ${{ secrets.VIPM_SERIAL_NUMBER }} vipm_full_name: ${{ secrets.VIPM_FULL_NAME }} vipm_email: ${{ secrets.VIPM_EMAIL }} - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 - if: ${{ github.event_name != 'pull_request' }} with: commit-message: 'chore(deps): update VIPM package dependencies' title: 'chore(deps): update VIPM package dependencies' @@ -101,7 +92,7 @@ jobs: `reusable-vipm-update.yml` workflow. Review the `vipm.toml` / `vipm.lock` diff before merging. - base: ${{ inputs.base_branch || github.base_ref }} + base: ${{ inputs.base_branch || github.event.repository.default_branch }} branch: ${{ inputs.pr_branch }} add-paths: | ${{ inputs.working_directory }}/vipm.toml