Commit Graph

201 Commits

Author SHA1 Message Date
Chris Farhood 2d7f2e1b74 fix(pr-validation): fetch PR head refs instead of branch name
Prior --depth=1 fetch of $HEAD_REF fails because shallow clone
doesn't bring in the PR head branch as a ref.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 21:47:13 +00:00
Chris Farhood b9518df713 fix(pr-validation): install shellcheck via wget instead of apt-get
The act runner container runs as root and apt-get may not be available
or require sudo. Download the pre-built binary tarball directly instead.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 21:41:56 +00:00
Chris Farhood 502c17e6da fix(detect-pipeline): use two-dot diff for shallow clone compatibility
Three-dot diff (A...HEAD) requires merge-base lookup which fails with
--depth=1 shallow fetches. Two-dot diff (A HEAD) compares the ref directly
against HEAD without ancestor traversal.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 21:35:53 +00:00
Chris Farhood 95d8d8056d fix(detect-pipeline): fetch PR head refs and diff against HEAD
Problem: --depth=1 fetch does not bring in the PR head branch name
as a ref, causing 'origin/gandalf/pri-1593-fix-main' to be unknown.

Fix: fetch all PR head refs with full refspec and diff against HEAD
instead of a non-existent remote branch ref.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 21:26:56 +00:00
Chris Farhood c3aafc3450 Fix HEAD_REF fetch: diff against HEAD instead of origin/HEAD_REF
The shallow fetch (--depth=1) does not bring the PR head branch name
as a ref, causing: fatal: ambiguous argument 'origin/gandalf/pri-1593-fix-main'.

Fix: git diff origin/$BASE_REF HEAD (already checked out at github.sha)
instead of git diff origin/$BASE_REF origin/$HEAD_REF

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 21:21:49 +00:00
Chris Farhood adcce5a531 fix(pr-validation): remove sudo from shellcheck install
The act runner container runs as root and does not have sudo
installed, causing CI job 187 to fail with "sudo: command not found".

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 21:08:24 +00:00
Chris Farhood d52283dc35 fix(actionlint): replace curl with wget, fix secrets.GITEA_TOKEN references
- pr-validation.yaml: Use env block to avoid github.head_ref/github.base_ref
  as shell expressions in run block (actionlint error)
- plugin-release.yaml: Replace remaining 6x secrets.GITEA_TOKEN with
  secrets.GITEA_RELEASE_TOKEN (lines 186, 218, 293, 310, 343, 401)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 10:42:57 +00:00
Chris Farhood af703ea161 fix(actionlint): resolve untrusted github.head_ref and undefined secrets
- Add env vars for HEAD_REF and BASE_REF in detect-pr-pipeline.yaml to avoid
  using github.head_ref/github.base_ref directly in inline scripts (actionlint rule)
- Fix plugin-release.yaml to use secrets.GITEA_RELEASE_TOKEN instead of
  undefined secrets.GITEA_TOKEN (3 occurrences)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 04:35:11 +00:00
Chris Farhood 42e3b8d08f fix(pr-validation): install wget before downloading actionlint
Install wget via apt-get before using it for actionlint download.
The act runner ubuntu-latest image may not have wget pre-installed.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 04:28:07 +00:00
Chris Farhood bc9e2a32fb fix(pr-validation): replace curl with wget for actionlint install
The act runner container does not have curl in PATH.
Using wget instead fixes the CI validate check.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 03:43:05 +00:00
Chris Farhood e1929105b2 Admin-merge: fix(pr-validation): add head_ref fetch to checkout step (PRI-1588)
Merges PR #197 with conflict resolution. The PR adds a missing
`git fetch origin head_ref` step so the PR head SHA is available
before checkout. Conflict arose because PR 195 also touched this file
(changed runs-on label). Both changes are preserved.

Admin-merge authorized by PRI-1590 — bootstrap CI fix bypasses
branch-protection CI requirement by board policy.
2026-05-16 03:26:58 +00:00
Chris Farhood 8a70d36418 fix(pr-validation): add head_ref fetch to checkout step (PRI-1588)
The checkout step was missing git fetch for github.head_ref,
causing "unable to read tree" errors on PRs since the PR head SHA
is not on main.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 02:55:04 +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
Regression Regina b1d433ef73 Merge pull request 'fix: add RENOVATE_ENDPOINT for Gitea self-hosted instance' (#192) from gandalf/pri-1534-renovate-endpoint into main 2026-05-14 20:38:54 +00:00
Chris Farhood eb644ea738 fix: add RENOVATE_ENDPOINT for Gitea self-hosted instance
Phase 4 Gitea migration — Renovate CLI needs the endpoint URL to
connect to the self-hosted git.farh.net instance.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 20:37:48 +00:00
Regression Regina c73ab6079b fix: replace GitHub App token with GITEA_TOKEN in workflows (PRI-1533) (#190) 2026-05-14 18:42:13 +00:00
Regression Regina 4a3c3d790e fix: migrate dual-approval-check.yaml from GitHub to Gitea API
Migrated by Gandalf, QA-reviewed and merged by Regression Regina (Pipeline B).

Changes:
- api.github.com → git.farh.net/api/v1
- Bearer ${GH_TOKEN} → token ${GITEA_TOKEN}
- Reviewer logins: privilegedescalation-qa → pe_regina, privilegedescalation-uat → pe_patty
- Accept header: vnd.github.v3+json → application/json
- jq filter: removed [bot] suffix (Gitea uses plain usernames)
2026-05-14 16:02:53 +00:00
privilegedescalation-qa[bot] 23461599ff fix: resolve BASE_REF from PR API on pull_request_review events
fix: resolve BASE_REF from PR API on pull_request_review events
2026-05-14 12:06:54 +00:00
Chris Farhood 8f8e75a6d8 remove: drop renovate.yaml from PR branch (out of scope, blocks CI)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 06:06:35 +00:00
Chris Farhood e75859c67a fix: resolve BASE_REF from PR API on pull_request_review events
BASE_REF is empty on pull_request_review events since github.base_ref
is only populated on pull_request events. The empty string hit the
case * wildcard and silently passed the promotion gate.

Add a fallback that fetches .base.ref from the PR API when BASE_REF
is empty but a PR_NUMBER is available.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 05:58:37 +00:00
privilegedescalation-engineer[bot] 9b16d94e8a Add Renovate GitHub Actions workflow
Adds .github/workflows/renovate.yaml — scheduled Renovate run every Saturday at 02:00 UTC using create-github-app-token with RELEASE_APP_ID/RELEASE_APP_PRIVATE_KEY. Runs renovatebot/github-action@v41.0.0 with autodiscover and renovate-config.json. Includes workflow_dispatch for manual triggering.

Pipeline B infrastructure change reviewed by CTO and QA (Regression Regina).
2026-05-13 17:31:00 +00:00
privilegedescalation-engineer[bot] 7af5336b40 fix: add trailing newline at EOF in renovate.yaml 2026-05-13 13:06:43 +00:00
Chris Farhood 305304c5bf Add Renovate GitHub Actions workflow
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-13 12:50:09 +00:00
Chris Farhood bc728a753a fix(plugin-release): remove invalid --json flag from gh pr create
The --json flag is not valid for gh pr create, only for read commands
like gh pr list and gh pr view. This was causing the release workflow
to fail with 'unknown flag: --json' in the Create PR step.

The PR number is correctly retrieved on the line after via gh pr list,
so no other change was needed.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-13 12:33:00 +00:00
Chris Farhood ae8086f38b ci-health-check.sh: append infra as private repo after dynamic discovery
Adds 'infra' to PLUGIN_REPOS after the discovery/fallback logic so the
private infra repo is always included in CI/CD health checks regardless
of which path populated PLUGIN_REPOS.

Fixes: PRI-906
Fixes: PRI-488

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-13 12:33:00 +00:00
privilegedescalation-engineer[bot] 1a7770b01f fix: use artifacthub-pkg.yml name for archive-url (PRI-356)
Both the Update artifacthub-pkg.yml and Prepare release tarball steps now read PKG_NAME from artifacthub-pkg.yml when present, falling back to package.json with correct @org/ prefix stripping. This eliminates the archive-url/tarball name mismatch for 6 of 7 plugins.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-13 11:40:15 +00:00
privilegedescalation-cto[bot] 39b4eaf232 Add gitAuthor to shared renovate-config.json
Add gitAuthor to shared renovate-config.json
2026-05-13 03:36:06 +00:00
Chris Farhood 6f995bf6fc Add gitAuthor to shared renovate-config.json
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-13 02:27:27 +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 4332b7a489 Merge pull request #174 from privilegedescalation/hugh/pr-pipeline-detection
feat: add PR pipeline type detection workflow
2026-05-11 15:51:17 -07:00
Chris Farhood 4b05ad5e86 fix: add infra/, org/, and deployment file detection for pipeline B
The detection script was missing infra/, org/, Dockerfile,
docker-compose*, and Makefile patterns required by the SDLC spec.
Added 11 new test cases covering these patterns.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-11 22:47:20 +00:00
Chris Farhood 25fe4107e6 fix: address QA findings on detect-pipeline workflow
- Fix subdirectory matching: use prefix match for .github/* paths
  instead of exact dirname match (fixes .github/workflows/ not matching)
- Upgrade tj-actions/changed-files from v44 to v47 (Node 24 support)
- Extract detection logic into scripts/detect-pipeline.sh for testability
- Add 22 automated tests in scripts/test-detect-pipeline.sh covering
  infra-only, plugin code, mixed, and edge cases
- Add test-detection-logic CI job to run tests on every PR
- Update README.md to reference v47

cc @cpfarhood

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-11 22:25:45 +00:00
Chris Farhood 5285d768dd Merge pull request #178 from privilegedescalation/cpfarhood-patch-1
Delete scripts/get-github-token.sh
2026-05-11 14:37:30 -07:00
privilegedescalation-ceo[bot] 6c0dcde8b5 Replace dual-approval with promotion gate workflow (#177)
New model: no review for dev PRs, QA gates uat, UAT gates main.
Replaces the old CTO+QA dual-approval check.

Co-authored-by: Chris Farhood <chris@farhood.org>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-05-11 21:37:00 +00:00
Chris Farhood 811254a933 Delete scripts/get-github-token.sh 2026-05-11 17:36:39 -04:00
privilegedescalation-ceo[bot] 3547e80940 Delete shared plugin-e2e.yaml workflow template (#176)
Pipeline B complete: CI  QA  CTO  CEO merge. Part of PRI-1133 (E2E purge).
2026-05-11 13:53:20 +00:00
privilegedescalation-engineer[bot] c5eba2cf67 fix(plugin-release): fallback to --admin when auto-merge is disabled (#173)
When MERGE_STATE is BLOCKED or UNKNOWN, the workflow attempts --auto
first. If that fails due to autoMergeAllowed: false on the repo, it
falls back to --admin which merges using the GitHub App token and
bypasses branch protection rules.

Resolves: PRI-497

Co-authored-by: Chris Farhood <chris@farhood.org>
2026-05-11 13:49:35 +00:00
Chris Farhood 2374789773 Delete shared plugin-e2e.yaml workflow template
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-11 13:22:50 +00:00
Chris Farhood 2706245b03 docs: add workflow documentation and best practices
Documents available tools on runners and common patterns for GitHub Actions.
Notably, clarifies that gh CLI is not available and recommends using curl
with GitHub API instead.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-11 12:44:56 +00:00
Chris Farhood 487058ed5e fix: use GitHub API directly instead of gh CLI
The gh CLI is not installed on the runners. Use curl and the GitHub API
directly to set PR labels.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-11 12:43:13 +00:00
Chris Farhood e9864e77e0 feat: add PR pipeline type detection workflow
- Adds workflow that detects Pipeline A vs Pipeline B based on changed files
- Pipeline B (infra-only): .github/, *.md, .eslintrc*, .prettierrc*, renovate.json*, .gitignore, .editorconfig, LICENSE
- Pipeline A (default): any other file changes
- Sets PR label (pipeline-a or pipeline-b) for downstream routing
- Reusable workflow can be called from any PR

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-11 12:41:25 +00:00
Chris Farhood d25a2e6d0a Merge pull request #143 from privilegedescalation/hugh/ci-failure-categorization
fix: categorize CI failures to distinguish expected process failures from infra issues
2026-05-10 16:52:05 -07:00
privilegedescalation-engineer[bot] 836e50fa9c fix(e2e): add kubeconfig step for ARC runners with no static kubeconfig (#149)
The shared plugin-e2e.yaml workflow lacks a Get kubeconfig step. The
ARC runner (runners-privilegedescalation) has no static kubeconfig at
any expected path (/runner/config, ~/.kube/config). It DOES have an
in-cluster service account at /var/run/secrets/kubernetes.io/serviceaccount/token.

This fix adds the same three-tier kubeconfig detection used in
headlamp-polaris-plugin#144:
1. /runner/config (not present on this runner)
2. ~/.kube/config (not present on this runner)
3. Generate from in-cluster service account credentials

This unbreaks E2E for all plugins using the shared workflow:
- headlamp-argocd-plugin
- headlamp-kube-vip-plugin
- headlamp-tns-csi-plugin

Co-authored-by: Chris Farhood <chris@farhood.org>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-05-06 16:45:33 +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
Chris Farhood 84243c735e fix: categorize CI failures to distinguish expected process failures from real infra issues
This commit updates ci-health-check.sh to categorize CI failures:
- Code failures: test/lint/build failures on main → FAIL
- Infra failures: startup_failure, timed_out → FAIL
- Pending (process): action_required (awaiting review) → INFO only

action_required is no longer treated as a failure since it's an expected
process state (PRs awaiting dual approval).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-05 10:22:04 +00:00
Chris Farhood f02d888d82 fix(ci): guard against null/missing PR number in dual-approval check
The workflow was failing on pull_request_review events when triggered by
non-PR actors (e.g. greptile-apps[bot] commenting). The dual-approval job
would attempt to call the reusable workflow with a null PR number,
causing the reusable workflow to fail since there was no valid PR to check.

Changes:
- Guard the PR number with explicit null check: [ -z "${PR_NUMBER}" ] || [ "${PR_NUMBER}" = "null" ]
- Add validation of the reviews response before processing
- Fix jq filter to handle null pipeline values explicitly

Fixes flapping Dual Approval (CTO + QA) checks across all plugin repos.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-05 10:21:27 +00:00
privilegedescalation-ceo[bot] ac34b836b9 ci-health-check.sh: dynamic repo discovery (PRI-331)
Merged by Countess von Containerheim (CEO). All gates passed: CI , UAT N/A (script-only), QA  (Regina), CTO  (Nancy). Unblocks PRI-510 → PRI-509.
2026-05-05 03:19:13 +00:00