Commit Graph

104 Commits

Author SHA1 Message Date
Hugh Hackman 04acf4a278 fix: use npm audit for both package managers (retired pnpm endpoint) 2026-04-15 00:20:34 +00:00
privilegedescalation-ceo[bot] 2a35b1939e fix(plugin-release): rebuild tarball after checksum update
fix(plugin-release): rebuild tarball after checksum update
2026-04-13 11:01:14 +00:00
Hugh Hackman bb043914ef fix: reverse checksum/rebuild ordering per QA feedback
- Move rebuild step BEFORE checksum computation
- Add validation step after rebuild
- Remove redundant VERSION/PKG_NAME variable reassignments
- Checksum now computed from rebuilt tarball, not original
2026-04-11 17:00:04 +00:00
Hugh Hackman 5680e942ad fix(plugin-release): rebuild tarball after checksum update
The tarball was being created BEFORE the checksum was computed and
updated in artifacthub-pkg.yml. This meant the released tarball
contained a placeholder checksum instead of the actual SHA256 hash.

This change adds a step to rebuild the tarball after the checksum
is computed, ensuring the released artifact has the correct checksum.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-25 12:23:56 +00:00
privilegedescalation-engineer[bot] b11bc453dd fix(plugin-release): set fail_on_unmatched_files to false
The fail_on_unmatched_files: true causes the release step to exit 1
when the glob pattern doesn't match (e.g., TARBALL env var resolution
timing). Since the tarball existence is already validated earlier in
the workflow (lines 193-194), this additional check is redundant and
causes false failures on successful releases.

Fixes: https://github.com/privilegedescalation/headlamp-kube-vip-plugin/issues/32

Co-authored-by: Hugh Hackman <hugh@privilegedescalation>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-03-25 12:15:30 +00:00
privilegedescalation-engineer[bot] 4540a22dfe fix(release): improve merge error handling to handle already-merged PRs (#76)
Check PR state before attempting merge to avoid 'branch not found' errors
when a prior run's auto-merge already completed. Fallback merge should
now handle all cases without spurious step failures.

Fixes: https://github.com/privilegedescalation/.github/issues/75

Co-authored-by: Hugh Hackman <hugh@privilegedescalation.github>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-03-25 07:29:17 +00:00
privilegedescalation-ceo[bot] ccc4859d0e Merge pull request #74 from privilegedescalation/feat/shared-plugin-e2e-workflow
ci: add reusable plugin-e2e workflow
2026-03-24 23:38:19 +00:00
Hugh Hackman 9026c2495f ci: add reusable plugin-e2e workflow
Extracts the E2E test workflow shared by headlamp-polaris-plugin and
headlamp-intel-gpu-plugin into a reusable workflow_call workflow.

Plugin repos call this with:

  uses: privilegedescalation/.github/.github/workflows/plugin-e2e.yaml@main

Inputs: node-version (default 22), headlamp-version (default v0.40.1).

Eliminates copy-paste duplication so any future E2E infra changes
(Headlamp version bumps, kubectl version, diagnostics) propagate to
all plugin repos from a single edit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 23:28:53 +00:00
privilegedescalation-ceo[bot] 8bd8ff680c Merge pull request #73 from privilegedescalation/fix/release-branch-re-trigger
fix(release): handle re-triggers — stale branch cleanup and duplicate PR guard
2026-03-24 23:21:35 +00:00
Hugh Hackman 496dfff41a fix(release): handle re-triggers — clean up stale branch and skip duplicate PR
If a release workflow fails after creating the branch (e.g. pnpm setup
failure, network error) but before creating the tag, re-triggering the
workflow previously failed at 'git push origin $BRANCH' because the
branch already existed.

Changes:
- Commit and tag: check for existing remote branch and delete it before
  re-creating, so re-triggers are clean. Safe because check-tag skips
  when the tag already exists — we only reach this point when the tag
  does NOT exist yet.
- Create PR: guard with 'gh pr view' so a pre-existing PR from a failed
  run is reused instead of causing 'pr already exists' failure.

Split the single 'git push origin $BRANCH --tags' into two pushes
(branch and tag separately) to avoid any flag ambiguity.
2026-03-24 23:13:16 +00:00
privilegedescalation-ceo[bot] 9bc6fecf91 Merge pull request #72 from privilegedescalation/ci/validate-artifacthub-manifest
ci: validate artifacthub-pkg.yml in plugin CI
2026-03-24 23:10:08 +00:00
privilegedescalation-ceo[bot] 9662b75611 Merge branch 'main' into ci/validate-artifacthub-manifest 2026-03-24 23:03:04 +00:00
privilegedescalation-engineer[bot] 0ac29784ee fix(release): fall back to direct merge when auto-merge is rejected (#71)
On repos without required status checks in branch protection, GitHub
rejects enablePullRequestAutoMerge with 'clean status' error. Add a
fallback to direct squash merge so releases complete without manual
intervention.

Fixes: https://github.com/privilegedescalation/.github/issues/70

Co-authored-by: Hugh Hackman <hugh@privilegedescalation.github>
2026-03-24 22:59:27 +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
privilegedescalation-ceo[bot] 6668041530 Merge pull request #69 from privilegedescalation/fix/release-pnpm-setup-fallback
fix: add pnpm setup fallback when packageManager field is absent
2026-03-24 22:27:35 +00:00
privilegedescalation-ceo[bot] 4067a0454e Merge pull request #67 from privilegedescalation/fix/dual-approval-use-github-hosted-runner
fix(ci): use ubuntu-latest for dual-approval-check workflow
2026-03-24 22:26:24 +00:00
Hugh Hackman 3b734dfa69 fix: add pnpm setup fallback when packageManager field is absent
The release job used pnpm/action-setup@v5 without a version input,
which requires a packageManager field in package.json. Repos that
don't have this field fail at Setup pnpm, blocking all releases.

Mirror the resilient two-step pattern already used in plugin-ci.yaml:
- If packageManager is present: use Corepack (respects pinned version)
- If absent: fall back to pnpm/action-setup@v5 with version: latest

Fixes the systemic v1.0.0 release failures across kube-vip, sealed-secrets,
tns-csi, and rook (PRI-866).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 22:25:13 +00:00
hugh-hackman[bot] 5a167e94ae fix(ci): use ubuntu-latest for dual-approval-check workflow
The dual-approval-check workflow only makes GitHub API calls — it does
not need cluster access or any self-hosted tooling. Using the
self-hosted runner (runners-privilegedescalation) was triggering
GitHub's self-hosted runner approval requirement for workflows run by
actors with authorAssociation NONE (e.g. privilegedescalation-qa/cto
bots), causing action_required conclusions with 0 jobs executed.

Switching to ubuntu-latest eliminates the approval gate and frees
self-hosted runner capacity for actual CI builds.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-24 21:54:04 +00:00
privilegedescalation-ceo[bot] cc258fb942 Merge pull request #66 from privilegedescalation/feat/renovate-major-github-actions-rule
feat: add major-version update rules for GitHub Actions and npm
2026-03-24 16:26:38 +00:00
privilegedescalation-ceo[bot] def78c1a3e Merge pull request #65 from privilegedescalation/fix/node24-action-versions
ci: upgrade GitHub Actions to Node.js 24-compatible versions
2026-03-24 16:25:22 +00:00
Hugh Hackman 8b0818eba6 feat: add major-version update rules for GitHub Actions and npm
Adds explicit packageRules for major version bumps on both github-actions
and npm managers. Previously only minor/patch updates were configured,
requiring manual audits when major versions shipped (e.g. PRI-802 where
actions/setup-node v4→v6 had to be found and fixed by hand).

With these rules, Renovate will surface major bumps as PRs automatically.
automerge is false for both — major updates go through the normal
dual-approval workflow.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-24 16:15:02 +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
Chris Farhood e6ccd10915 enhance org profile with badges and local logo 2026-03-22 17:46:12 -04:00
privilegedescalation-ceo[bot] d7aa2062a6 Merge pull request #63 from privilegedescalation/chore/renovate-pin-action-digests
chore(renovate): enable pinDigests for GitHub Actions SHA pinning
2026-03-22 11:09:10 +00:00
privilegedescalation-ceo[bot] eebed4b437 Merge pull request #62 from privilegedescalation/fix/corepack-after-setup-node
fix(ci): move corepack setup after setup-node to fix command-not-found
2026-03-22 11:09:03 +00:00
Hugh Hackman 7d5c6d67d6 chore(renovate): enable pinDigests for GitHub Actions SHA pinning
Adds `pinDigests: true` to the org-wide Renovate config. Renovate will
now automatically pin all GitHub Actions references to full commit SHAs
and keep them updated via weekly PRs.

This implements the supply-chain hardening goal from PRI-731 without
requiring a one-time manual SHA substitution that would quickly become
stale. Renovate handles pin creation and ongoing updates, eliminating
the toil.

The github-actions packageRule is preserved — Renovate will still group
minor/patch action tag updates, and each group PR will include the
corresponding SHA pins.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 06:38:02 +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
privilegedescalation-ceo[bot] 899c08f7b5 Merge pull request #59 from privilegedescalation/fix/pnpm-detection-use-python3
fix(ci): use python3 for packageManager detection (node not on PATH before setup-node)
2026-03-22 06:17:02 +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
privilegedescalation-ceo[bot] 17ce365262 fix(ci): use Corepack for pnpm setup when packageManager field is set
fix(ci): use Corepack for pnpm setup when packageManager field is set
2026-03-22 05:54:09 +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
privilegedescalation-ceo[bot] 547c4ad5aa Merge pull request #49 from privilegedescalation/ci/pnpm-aware-release
ci: add pnpm detection to plugin-release workflow
2026-03-22 05:24:35 +00:00
privilegedescalation-ceo[bot] 9487c402b3 Merge pull request #54 from privilegedescalation/fix/pnpm-package-manager-conflict
ci: handle packageManager field to avoid pnpm version conflict
2026-03-22 05:24:29 +00:00
privilegedescalation-ceo[bot] c400a2fe59 Merge pull request #55 from privilegedescalation/fix/dual-approval-bot-suffix
fix(ci): match [bot] suffix in dual-approval-check reviewer usernames
2026-03-22 05:24:20 +00:00
Hugh Hackman cede9322dc fix(ci): match [bot] suffix in dual-approval-check reviewer usernames
GitHub App reviews are submitted as `privilegedescalation-cto[bot]`
and `privilegedescalation-qa[bot]`, not the bare usernames used in the
workflow defaults. The jq filter now accepts both the plain username and
the `[bot]`-suffixed form, so the check passes regardless of whether the
review was submitted via the GitHub App or a regular account.

Fixes: https://github.com/privilegedescalation/.github/issues/51

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 05:12:50 +00:00
Hugh Hackman ca5ab75f6b ci: remove version: latest from pnpm setup in plugin-release
pnpm/action-setup@v4 errors with ERR_PNPM_BAD_PM_VERSION when both
`version` (in the workflow) and `packageManager` (in package.json) are
specified. Remove the hardcoded `version: latest` from plugin-release
so that repos can pin their pnpm version via the packageManager field
in package.json.

When packageManager is absent the action falls back to latest (same
prior behavior). When packageManager is set it is used exclusively,
which prevents silent version drift.

The plugin-ci.yaml change is handled separately in PR #54.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 05:09:31 +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 950af300bf fix: replace gh api with curl in dual-approval-check workflow
The gh CLI is not installed on the self-hosted ARC runners
(runners-privilegedescalation). Replace the gh api call with
curl + GitHub token, which is available on all runners.

Fixes: https://github.com/privilegedescalation/.github/issues/50
Unblocks: headlamp-polaris-plugin PR #98 and v1.0.0 release pipeline
2026-03-22 04:45:20 +00:00
Hugh Hackman a62d4181ee ci: add pnpm detection to plugin-release workflow
Mirrors the pnpm-detection logic from plugin-ci.yaml. When a repo has
pnpm-lock.yaml, the release job now: sets up pnpm, caches with pnpm,
runs pnpm install --frozen-lockfile, and commits pnpm-lock.yaml (not
package-lock.json) in the release branch.

Fixes the CI/release divergence where headlamp-polaris-plugin's CI used
pnpm strict hoisting but releases installed with npm, allowing dependency
resolution differences to reach production.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 04:40:27 +00:00
privilegedescalation-ceo[bot] 97cb944a53 Merge pull request #47 from privilegedescalation/feat/dual-approval-status-check
ci: add reusable dual-approval-check workflow
2026-03-22 04:12:20 +00:00
privilegedescalation-ceo[bot] 191e302a16 Merge pull request #48 from privilegedescalation/fix/pnpm-setup-version-fallback
fix: add pnpm version fallback to plugin-ci shared workflow
2026-03-22 04:12:12 +00:00
Hugh Hackman 1c5eb52490 fix(ci): check last review state per user in dual-approval workflow
Previously the jq logic checked if *any* review from CTO/QA had
state == APPROVED. This allowed a PR to pass dual-approval even if
the reviewer subsequently requested changes — because the earlier
approval was still in the review history.

Fix: filter reviews by user, take the last one, and check its state.
This ensures a CHANGES_REQUESTED review after an approval correctly
blocks the check.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-22 00:11:01 +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 fbb4dfcfc3 ci: add reusable dual-approval-check workflow
Adds a shared reusable workflow that plugin repos can call to enforce
the dual CTO+QA approval policy as a GitHub required status check.

The workflow queries the GitHub API for PR reviews and fails unless
both privilegedescalation-cto and privilegedescalation-qa have approved.
Triggered via pull_request and pull_request_review events in calling
repos, producing a clear "Dual Approval (CTO + QA)" status check.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-21 23:54:57 +00:00
privilegedescalation-ceo[bot] b7ec5e69b6 Merge pull request #46 from privilegedescalation/feat/pnpm-support-in-ci
ci: add pnpm auto-detection to shared plugin CI workflow
2026-03-21 23:51:24 +00:00
privilegedescalation-ceo[bot] d369b8bdbf Merge branch 'main' into feat/pnpm-support-in-ci 2026-03-21 23:50:01 +00:00
privilegedescalation-ceo[bot] edf7b7d849 Merge pull request #45 from privilegedescalation/fix/release-pr-cc-cpfarhood
fix: add cc @cpfarhood to release PR body per org policy
2026-03-21 23:49:46 +00:00
Hugh Hackman f564499a79 fix: use printf to avoid multi-line YAML literal block break
The multi-line --body string had cc @cpfarhood at column 0, which
terminated the YAML literal block scalar prematurely and caused
actionlint to reject the workflow file. Use printf to construct
the body string without embedding a literal newline in the YAML.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-21 23:09:49 +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