Commit Graph

34 Commits

Author SHA1 Message Date
Chris Farhood c88715051f fix(CI): install python3 before artifacthub-pkg.yml validation
node:22-slim does not include Python. The validation step was failing
with "python3: not found" (exit 127) on every PR in every plugin repo.

Fix: add apt-get install step before the validation step.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 00:05:26 +00:00
Gandalf the Greybeard 4a4c544e7a fix: change plugin-ci.yaml runs-on to ubuntu-latest (#195)
Co-authored-by: Gandalf the Greybeard <pe_gandalf@noreply.git.farh.net>
Co-committed-by: Gandalf the Greybeard <pe_gandalf@noreply.git.farh.net>
2026-05-15 19:35:57 +00:00
privilegedescalation-ceo[bot] a11d911948 Merge pull request #180 from privilegedescalation/hugh/add-audit-ci-allowlist
chore(ci): add audit-ci config path for allowlist support (PRI-855)
2026-05-12 22:35:46 +00:00
privilegedescalation-engineer[bot] 1c2b97d41d Add lockfile freshness validation to plugin-ci workflow
When pnpm-lock.yaml has overrides section, validate that lockfile is fresh before install. If stale (detected via CONFIG_MISMATCH/EBADLOCKFILE/ERR_PNPM_LOCKFILE), fail with clear error message suggesting 'pnpm install' to regenerate.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-12 22:29:12 +00:00
Chris Farhood d2f1e497ef Revert direct push to main - will create proper PR 2026-05-12 22:00:29 +00:00
Chris Farhood 4f3e3e8d2c Add lockfile freshness validation to plugin-ci workflow
When pnpm-lock.yaml has overrides section, validate that lockfile is fresh
before install. If stale (detected via CONFIG_MISMATCH), fail with clear
error message suggesting 'pnpm install' to regenerate.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-12 21:59:56 +00:00
Chris Farhood 7f027c6ec2 chore(ci): add audit-ci config path for allowlist support
Add --config ./audit-ci.jsonc to audit-ci step so plugin repos can
provide their own allowlist for inherited @kinvolk/headlamp-plugin
dev-dependency CVEs (CTO decision PRI-854).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-06 13:16:51 +00:00
privilegedescalation-engineer[bot] 490128a044 Add 3-attempt retry to npm/pnpm install step in plugin workflows (#132)
PRI-459: Adds 3-attempt retry wrapper (5s backoff) around the Install
dependencies step in plugin-ci.yaml and plugin-release.yaml to handle
transient npm/pnpm registry failures.

Co-authored-by: Chris Farhood <chris@farhood.org>
2026-05-04 12:08:20 +00:00
privilegedescalation-engineer[bot] a8b3f5df03 fix(plugin-ci): use audit-ci for security audits (#107)
Replace pnpm audit and npm audit with audit-ci, which supports
the new npm bulk advisory endpoint (/-/npm/v1/security/advisories/bulk).
The old audit endpoints return HTTP 410 Gone.

Fixes: PRI-151

Co-authored-by: Test User <test@example.com>
Co-authored-by: Hugh Hackman <hugh@privilegedescalation.ai>
2026-04-21 19:46:27 +00:00
privilegedescalation-engineer[bot] 2ed8512bb6 fix(plugin-ci): skip pnpm audit since endpoint is retired (HTTP 410)
The pnpm audit endpoint returns HTTP 410 indicating it's retired.
Skip security audit for pnpm repos to unblock CI on plugin repos.

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-15 04:52:46 +00:00
privilegedescalation-ceo[bot] 56e0424f9b fix(ci): pnpm audit --prod — exclude devDependency vulns (#103)
Co-authored-by: privilegedescalation-ceo[bot] <269721483+privilegedescalation-ceo[bot]@users.noreply.github.com>
2026-04-15 03:57:48 +00:00
Hugh Hackman e6eea29561 fix(plugin-ci): run pnpm audit for pnpm repos
pnpm audit is available in pnpm v10+. The previous implementation
skipped the security audit for pnpm repos due to a retired endpoint,
which blocks all plugin releases that use pnpm.
2026-04-15 03:19:17 +00:00
privilegedescalation-ceo[bot] e7bef1dfd5 fix(ci): skip npm audit for pnpm repos (pnpm endpoint retired HTTP 410)
The npm lockfile generation approach (npm install --package-lock-only) is
unreliable for pnpm repos that have a packageManager field: corepack
intercepts npm and the install fails, leaving no lockfile for npm audit.

Skip npm audit entirely for pnpm repos. The pnpm audit endpoint is retired
(HTTP 410) so there is no viable audit path for these repos anyway.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-15 02:35:51 +00:00
Countess von Containerheim e103372a13 fix(ci): remove silent error suppression in security audit step
The previous fix (PR #92) added '2>/dev/null || true' to the npm install
command, silently swallowing failures. When npm install --package-lock-only
fails, no lockfile is created and npm audit fails with ENOLOCK.

Remove the silent suppression and --quiet flag so failures surface clearly.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-15 02:31:33 +00:00
privilegedescalation-engineer[bot] 922b462195 fix(plugin-ci): use npm audit for both pnpm and npm repos (#92)
The pnpm registry audit endpoint is retired (HTTP 410).

Fix: for pnpm repos, run 'npm install --package-lock-only --ignore-scripts --quiet --no-audit'
to generate a package-lock.json from pnpm-lock.yaml metadata, then run npm audit.
For npm repos, continue using npm audit directly.

Use --audit-level=moderate to fail only on high/critical vulnerabilities,
not moderate ones, reducing noise from transitive dependencies.

Co-authored-by: Hugh Hackman <hugh@privilegedescalation>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-15 01:56:15 +00:00
Countess von Containerheim 3b7d582d5e fix(ci): generate npm lockfile before running npm audit
pnpm projects use pnpm-lock.yaml, not package-lock.json. The previous
fix switched from pnpm audit to npm audit but npm audit requires an
existing lockfile. Generate one first with npm install --package-lock-only.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-15 01:34:37 +00:00
privilegedescalation-ceo[bot] 07467773b9 Merge pull request #90 from privilegedescalation/hugh/fix-pnpm-audit-retired-endpoint
fix: use npm audit for both package managers (retired pnpm endpoint)
2026-04-15 01:25:40 +00:00
Hugh Hackman 04acf4a278 fix: use npm audit for both package managers (retired pnpm endpoint) 2026-04-15 00:20:34 +00:00
Paperclip 9c723655c4 fix: install corepack before enabling pnpm on self-hosted runners
Corepack is not pre-installed on runs-on: runners-privilegedescalation,
causing 'corepack: command not found' errors. Install it via
'npm install -g corepack' before using corepack commands.

Fixes PRI-51.
2026-04-14 23:55:11 +00:00
privilegedescalation-engineer[bot] 2e0fc02f2c fix(ci): add end anchor to SemVer regex in artifacthub validation
The regex `^\d+\.\d+\.\d+` was missing a `$` end anchor, allowing
versions like `1.2.3.4` or `1.2.3extra` to pass validation.

Fixed to `^\d+\.\d+\.\d+$` for strict X.Y.Z matching.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-24 22:57:41 +00:00
Hugh Hackman cabc4af60d ci: validate artifacthub-pkg.yml in plugin CI
Add a fast-fail step that validates artifacthub-pkg.yml before
the expensive build steps. Checks:
- File exists and is valid YAML
- Required fields present: version, name, description, homeURL
- Version is SemVer (X.Y.Z)
- archive-url and archive-checksum annotations are present
- archive-checksum format is sha256:<64 hex chars>

Catches corrupt or incomplete ArtifactHub manifests early in CI
before they reach the release workflow.
2026-03-24 22:46:44 +00:00
Hugh Hackman e21ab550e4 ci: upgrade GitHub Actions to Node.js 24-compatible versions
Update shared workflow action versions ahead of the June 2, 2026 deadline
when GitHub forces all actions from Node.js 20 to Node.js 24:

- actions/setup-node@v4 → @v6
- actions/cache@v4 → @v5
- pnpm/action-setup@v4 → @v5
- actions/create-github-app-token@v1 → @v3

Affects: plugin-ci.yaml, plugin-release.yaml, ci-health-check.yaml

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-24 16:10:18 +00:00
Hugh Hackman 111f838a09 fix(ci): move corepack setup after setup-node to fix command-not-found
corepack is bundled with Node.js and only available on PATH after
actions/setup-node runs. The previous workflow ordered the corepack
enable/install step before setup-node, causing:

  corepack: command not found

Fix: move setup-node to run first. Because pnpm is not installed when
setup-node runs, the built-in `cache: pnpm` cannot call `pnpm store path`.
Split pnpm caching into explicit Get/Cache steps using actions/cache@v4
after pnpm is installed via either corepack or pnpm/action-setup. npm
caching continues to use setup-node's built-in cache: npm.

Fixes polaris PR #103 CI (headlamp-polaris-plugin v1.0.0 release).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 06:25:48 +00:00
Hugh Hackman 13bf0639c6 fix(ci): use python3 for pnpm detection instead of node
node is not on PATH before the Setup Node step runs on ARC runners
(minimal Docker-based containers). The node -e command exits 127,
is silently swallowed by 2>/dev/null, and the || echo 'false' fallback
sets has_package_manager=false. This causes the Corepack branch to be
skipped and pnpm/action-setup@v4 to run with version:latest, which
conflicts with packageManager in package.json.

python3 is pre-installed on Ubuntu ARC runners (no setup required)
and reliably parses JSON via the stdlib json module.

Fixes pnpm version conflict on headlamp-polaris-plugin PR #103.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 05:59:48 +00:00
Hugh Hackman a5c19aae8d fix(ci): use Corepack for pnpm setup when packageManager field is set
pnpm/action-setup@v4 errors with "Multiple versions of pnpm specified"
even when no explicit version input is provided, if the repo has a
packageManager field in package.json.

Switch to Corepack for repos that pin their pnpm version via the
packageManager field. Corepack reads the version from package.json
directly and installs it without conflicting with pnpm/action-setup.

Repos without a packageManager field continue using pnpm/action-setup@v4
with version: latest (unchanged behavior).

Unblocks headlamp-polaris-plugin PR #103 (ci/pin-pnpm-version).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 05:41:30 +00:00
Hugh Hackman 4d42db2e52 ci: handle packageManager field in plugin-ci to avoid pnpm version conflict
pnpm/action-setup@v4 errors when both the `version` input and a
`packageManager` field in package.json are specified. Detect the
packageManager field during the package-manager detection step and
conditionally omit `version: latest` when it is present.

Fixes CI failures on repos using Corepack-style pnpm version pinning
(e.g. headlamp-polaris-plugin PR #103).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 04:56:42 +00:00
Hugh Hackman 1fd7a7ecf0 fix: add pnpm version fallback to plugin-ci shared workflow
pnpm/action-setup@v4 requires either a version input or a packageManager
field in package.json. Repos with pnpm-lock.yaml but no packageManager
field were failing with "No pnpm version is specified."

Adding version: latest as a fallback allows the action to install the
latest stable pnpm when packageManager is not set. Repos that do specify
packageManager in package.json continue to use their pinned version.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-21 23:58:29 +00:00
Hugh Hackman 23c86bf2d9 ci: add pnpm auto-detection to shared plugin CI workflow
When pnpm-lock.yaml is present, use pnpm for install, lint, type-check,
format check, tests, and security audit instead of npm. Repos using npm
are unaffected (falls back to existing npm behavior).

This fixes the npm/pnpm inconsistency in headlamp-polaris-plugin where
local development uses pnpm but CI used npm, causing:
- Different transitive dependency resolution (TypeScript not hoisted)
- Different audit results (pnpm audit vs npm audit)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 23:07:19 +00:00
Hugh Hackman bff9014cf8 fix: update runner label from local-ubuntu-latest to runners-privilegedescalation
ARC runner scale set was recreated on 2026-03-19 with label
`runners-privilegedescalation` but all shared workflows still referenced
`local-ubuntu-latest`. This label mismatch caused startup_failure on
every Release workflow and queued CI jobs with no runner to pick them up.

Updates all 4 workflows and the actionlint config to match the current
ARC runner scale set label.

Closes #27
2026-03-19 20:11:51 +00:00
Hugh Hackman[bot] cfb35fe73d ci: update actions/checkout from v4 to v6 in all reusable workflows
actions/checkout v6 was already adopted in headlamp-agent-skills.
This brings the org-level reusable workflows (plugin-ci, plugin-release,
ci-health-check) up to the same version. Affects all plugin repos that
call these shared workflows.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-18 07:24:02 +00:00
hugh-hackman[bot] d0b4428af7 fix: remove Docker container from CI, use setup-node instead
Eliminates Docker Hub rate limit by replacing container: node:22 with setup-node@v4.
Also fixes release workflow branch creation order.

Closes privilegedescalation/.github#14

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-15 16:55:37 +00:00
hugh-hackman[bot] 0ef78ac580 feat: make reusable workflows strictly container-native (#10)
Co-authored-by: gandalf-the-greybeard[bot] <gandalf-the-greybeard[bot]@users.noreply.github.com>
2026-03-10 23:44:40 +00:00
gandalf-the-greybeard[bot] 991278ebac ci: add npm audit step to shared plugin CI workflow
Adds a security audit step (npm audit --omit=dev) to catch known
vulnerabilities in production dependencies. Runs after tests so build
failures are reported before audit findings. Uses --omit=dev to focus
on production-facing risk.

This covers all 6 plugin repos that use the shared workflow.
2026-03-08 19:02:12 +00:00
hugh-hackman[bot] 521d120425 feat: add reusable CI and release workflows for Headlamp plugins 2026-03-08 00:44:51 +00:00