feat: add safer secret handling for helm env vars #48#58
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a safer Helm secret workflow by separating non-sensitive env values from secret-backed values, generating secret overlay examples, ignoring real secret overlays, and optionally including a secret overlay during deploy.
Changes:
- Introduces
secretHandlinginstall configuration (managed Helm Secret vs existing Kubernetes Secret) and updates install prompt/summary output. - Extends Helm chart scaffolding with secret example overlays plus
templates/secret.yaml, and updates the deployment template to consume secrets viaenvFrom. - Updates
beacon:deployto includevalues.<environment>.secrets.yamlwhen present and updates install to append the secret overlay pattern to.gitignore.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Install/InstallConfiguration.php |
Adds secret-handling settings/validation and exposes labels/helm detection. |
src/Install/InstallConfigurationCollector.php |
Prompts for secret handling + existing secret name and computes defaults. |
src/Helm/HelmChartGenerator.php |
Generates new secret example overlays and secret template; wires secret-related replacements. |
stubs/helm/values.yaml.stub |
Adds secret.* values section used by templates for both strategies. |
stubs/helm/templates/deployment.yaml.stub |
Adds conditional env and envFrom secretRef wiring. |
stubs/helm/templates/secret.yaml.stub |
Adds a managed Secret manifest template driven by secret.env. |
stubs/helm/templates/_helpers.tpl.stub |
Adds helper for stable secret naming. |
src/Deploy/HelmReleaseDeployer.php |
Allows optional third values file for secrets overlay. |
src/Commands/DeployCommand.php |
Detects and includes values.<env>.secrets.yaml when it exists. |
src/Filesystem/GitignoreUpdater.php |
New helper to ensure secret overlay patterns are appended to .gitignore. |
src/Install/InstallWorkflow.php / src/Install/InstallResult.php / src/Commands/InstallCommand.php |
Ensures .gitignore is updated during helm installs and reports the result. |
tests/* |
Adds/updates unit + feature coverage for new secret handling, helm generation, deploy behavior, and gitignore updating. |
README.md |
Documents the new secret workflow, generated files, and deploy behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
envvalues and secret-backed valuesvalues.<environment>.secrets.yamlduringbeacon:deploywhen presentTesting
Closes #48