Support protected workflow environments - #63
Draft
gjkim42 wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind api
What this PR does / why we need it:
Adds GitHub-compatible job environment parsing and a Kubernetes-native environment policy to Projects. Project environments can expose a scoped Kubernetes Secret and require per-job approval before a Runner can claim the job.
The controller resolves the selected environment into the immutable WorkflowJob spec, keeps approval-blocked jobs distinct from queued jobs, and reports environment state through Kubernetes conditions, the console, CLI output, and GitHub Checks. Environment secrets are copied into a job-owned Secret only after approval and Runner assignment, mounted only in that runner, masked from output, and cleaned up with the job.
This gives reusable E2E workflows a trusted
ok-to-testboundary without allowing fork-controlled workflow inputs to select an unconfigured secret source or bypass environment protection.Which issue(s) this PR is related to:
Fixes #29
Special notes for your reviewer:
Open Actions does not import GitHub Environment protection rules. The equivalent protection model is
Project.spec.environments[].protection.requiredApproval, with approval recorded by theactions.kelos.dev/environment-approvedannotation on an immutable WorkflowJob. Kubernetes RBAC and audit logging determine who may approve jobs.The controller emits runner plan version 5. The updated runner remains compatible with plan versions 1 through 4.
Validation completed with
make verify,make test, andmake build. The Kubernetes API review verdict is APPROVE with no P0-P3 findings.Does this PR introduce a user-facing change?