Skip to content

Add fork-safe install CI with replicas=0#884

Open
bschwedler wants to merge 4 commits into
mainfrom
fork-safe-install-ci
Open

Add fork-safe install CI with replicas=0#884
bschwedler wants to merge 4 commits into
mainfrom
fork-safe-install-ci

Conversation

@bschwedler
Copy link
Copy Markdown
Contributor

Fork PRs have no access to repo secrets, so ct install — which waits for pods that require a valid license to start — cannot run as-is against a fork PR.

  • Add a detect-fork job that outputs is-fork using github.event.pull_request.head.repo.full_name != github.repository. The expression is assigned via env: before use in run: to prevent script injection.
  • Gate Create License File Secrets on non-fork PRs.
  • Split ct install into two pairs: the existing pair (license-backed, non-fork only) and a new fork pair using --helm-extra-set-args "--set=replicas=0".
  • With replicas=0, Kubernetes creates all non-pod resources (Services, RBAC, ConfigMaps, PVCs) and considers the Deployment immediately rolled out — no pod is ever scheduled that would require a license.
  • Update the failure gate to include all four install step outcomes.

Internal PRs are completely unchanged. Fork PRs get Kubernetes resource validation without needing license secrets.

Fork PRs have no access to license secrets, so ct install (which
waits for pods that require a valid license) cannot run as-is.

Add a detect-fork job and gate the existing install steps on
non-forks. For fork PRs, run ct install with --helm-extra-set-args
'--set=replicas=0': Kubernetes creates all non-pod resources
(Services, RBAC, ConfigMaps, PVCs) and considers the Deployment
immediately rolled out, without ever scheduling a pod that needs
the license.
@bschwedler bschwedler requested review from a team as code owners June 4, 2026 20:42
Helm 3.18.5 changed its JSON schema parser, producing a different
error string format for schema validation failures. helm-unittest
v1.0.1 documented this as a known breaking change.

The posit-chronicle configmap_fail_test.yaml tests used errorPattern
values that matched the old format ("ServiceLogLevel: Does not match
pattern") but not the new one ("'/config/Logging/ServiceLogLevel':
'INVALID' does not match pattern"). This caused the tests to fail
locally with helm-unittest >= v1.0.1 while CI (pinned to v1.0.0)
continued to pass — a latent break waiting for the version bump.

Relax both patterns to ".*ServiceLogLevel.*does not match pattern.*"
and ".*ServiceLogFormat.*does not match pattern.*", which match both
the old and new error formats.
Go regex is case-sensitive by default. The old Helm schema error format
uses uppercase 'Does not match pattern'; the new format uses lowercase.
Add (?i) to both patterns so they match either wording.
Bump helm-unittest to v1.1.0, fix errorPattern regexes
@bschwedler bschwedler requested review from a team and jforest June 5, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant