Repository navigation
fix(clustertool): correct SOPS staging, validation and format handling - #642
Merged
Merged
Conversation
🚀 HelmRelease CI ReportOverall Status
🧪 HelmReleases Tested⏭️ HelmReleases SkippedResultℹ️ No HelmReleases required testing |
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.
Description
⚒️ Partially addresses #639.
Correct SOPS staging behavior, staged-file selection, configuration validation and file-format handling.
Following the numbering in #639:
Standalone encryption:
clustertool encryptencrypts working-tree files without staging them. The Git index remains unchanged, including any plaintext already staged. The user or hook must stage the encrypted result.Staged file selection: Read NUL-separated Git paths without filename quoting, supporting spaces and non-ASCII characters. Missing working copies of matching staged files now cause an error. Staged deletions are excluded, and empty selections no longer cause an error.
Encryption detection — unchanged: Existing metadata-based encryption detection remains in place.
Regex validation: Validate both
path_regexandencrypted_regexwhen loading.sops.yaml. Invalid syntax stops processing before encryption or staging.Hook staging — error handling fixed: Abort the commit if staging an encrypted result fails. Existing behavior of staging the complete saved working copy of selected files is intentionally retained.
Multiple recipients — unchanged: Existing recipient selection, key groups and the fixed Shamir threshold remain unchanged.
Overlapping rules — unchanged: File deduplication is deferred. Overlapping creation rules can still cause the same file to be processed multiple times.
Hook installation — unchanged: Support for
core.hooksPathand linked worktrees remains deferred.File formats: Use the corresponding SOPS parsers for YAML/YML, JSON, dotenv and INI. Binary and unknown formats return an explicit unsupported-format error without replacing the affected source file.
⚙️ Type of change
🧪 How Has This Been Tested?
Automated verification:
go test ./...passed on Linux and Windows in the test-build workflow.Manual verification with Linux build
test-a444fed69446:📃 Notes:
shamCheck()oncluster-settings.sops.yamlis unchanged. After hook encryption, that file must still exist and containshamir_threshold, even when it is not staged.✔️ Checklist:
feat(clustertool):fix(clustertool):chore(clustertool):