Skip to content

Tool v1.13.0 prep: CLI reliability, security hardening, and CI gates#35

Merged
nasimstg merged 5 commits intomainfrom
release/tool-v1.13.0-prep
Apr 2, 2026
Merged

Tool v1.13.0 prep: CLI reliability, security hardening, and CI gates#35
nasimstg merged 5 commits intomainfrom
release/tool-v1.13.0-prep

Conversation

@nasimstg
Copy link
Copy Markdown
Owner

@nasimstg nasimstg commented Apr 2, 2026

Summary

This PR prepares the next tool release with focused commits:

  1. CLI exit-code behavior for
    un and quiet error handling in command execution.
  2. Core hardening across env parsing, vault handling, zeroization, file permissions, and rotation rollback.
  3. CI, contributor workflow, packaging, and release-note updates.

Included changes

  • Preserve child exit codes in xenvsync run and avoid duplicate noisy error output.
  • Improve env/vault diagnostics and parsing behavior (inline comments, parse error surfacing).
  • Expand secret zeroization coverage across decrypt/encrypt paths.
  • Ensure decrypted .env files are written with

Copilot AI review requested due to automatic review settings April 2, 2026 08:07
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
xenvsync Ready Ready Preview, Comment Apr 2, 2026 8:25am

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the v1.13.0 release by tightening CLI behavior (exit-code propagation + quieter error paths), expanding secret zeroization and file-permission hardening, and adding stronger CI/contributor workflow gates and documentation.

Changes:

  • Preserve child-process exit codes for xenvsync run while avoiding noisy/duplicate error output.
  • Expand security hardening (more in-memory zeroization; pull writes decrypted env files as 0600; rotation rollback safety).
  • Add CI parity tooling (tidy-drift check, coverage threshold, govulncheck, website job) and update docs/examples/packaging for the release.

Reviewed changes

Copilot reviewed 39 out of 41 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/install-latest-xenvsync.sh Adds a shared installer script for CI examples to fetch the latest release binary.
scripts/ci-check.sh Adds local CI-equivalent checks (tidy drift, coverage threshold, vuln scan).
README.md Updates documented minimum Go version.
packaging/aur/PKGBUILD Switches AUR packaging to build from git and derive version metadata.
Makefile Adds discoverable targets (help/test-coverage/ci-check).
main.go Exits with propagated child exit code when commands return an ExitCodeCarrier.
internal/env/parser.go Adds stripping of unquoted inline comments in .env values.
internal/env/parser_test.go Adds test coverage for unquoted inline comment parsing behavior.
internal/crypto/multikey.go Expands symmetric-key zeroization during multi-key encrypt/decrypt.
flake.nix Derives Nix package version from git revision when available.
examples/ci/gitlab-ci.yml Reuses the shared installer script instead of inline curl logic.
examples/ci/github-actions.yml Reuses the shared installer script instead of inline curl logic.
examples/ci/circleci-config.yml Reuses the shared installer script instead of inline curl logic.
examples/ci/bitbucket-pipelines.yml Reuses the shared installer script instead of inline curl logic.
docs/INSTALL.md Updates minimum Go version documentation.
docs/DEVELOPMENT.md Adds a contributor workflow guide and local CI parity instructions.
docs/ARCHITECTURE.md Expands architecture documentation (trust boundaries, flows, repo layout).
CONTRIBUTING.md Links new docs, updates Go version guidance, and adds CI-check workflow guidance.
cmd/verify.go Zeroizes decrypted payload; surfaces parse failures in duplicate-key checks.
cmd/verify_test.go Updates tests for findDuplicateKeys error-returning behavior.
cmd/vaultutil.go Zeroizes private key material and decrypted plaintext buffers.
cmd/status_test.go Adds tests for status output expectations.
cmd/run.go Returns typed quiet exit-code errors and improves signal-forwarding lifecycle; zeroizes plaintext.
cmd/run_test.go Adds tests for env injection, exit-code propagation, and command-not-found behavior.
cmd/rotate.go Zeroizes plaintext/serialized data; adds rollback when key write fails.
cmd/root.go Adds “quiet error” suppression in wrapper error printing.
cmd/push.go Zeroizes decoded key material after use.
cmd/pull.go Zeroizes plaintext/output; writes decrypted .env files with mode 0600.
cmd/log.go Zeroizes decrypted plaintext buffer in best-effort decrypt path.
cmd/init.go Ensures .gitignore updates match exact entries (avoid substring false positives).
cmd/exitcode.go Introduces typed exit-code + “quiet” error interfaces/implementation.
cmd/envs_test.go Adds tests for envs discovery output and sorting.
cmd/envname.go Uses sort.Strings and improves parse error surfacing for fallback layers.
cmd/doctor.go Zeroizes decrypted payload during vault decrypt check.
cmd/diff.go Improves diagnostics for missing files vs parse/decrypt errors.
CHANGELOG.md Adds v1.13.0 release notes covering new behavior and gates.
.gitignore Ignores website TypeScript incremental build artifact.
.github/workflows/ci.yml Adds coverage threshold enforcement, tidy drift check, govulncheck, website job, and tighter release gating.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/env/parser.go
Comment on lines +99 to +106
func stripInlineComment(val string) string {
for i := 0; i < len(val); i++ {
if val[i] != '#' {
continue
}
if i == 0 || val[i-1] == ' ' || val[i-1] == '\t' {
return strings.TrimSpace(val[:i])
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stripInlineComment treats a leading # as the start of an inline comment (i == 0), which changes parsing for values that legitimately begin with # (e.g., KEY=#123 currently becomes an empty string). Consider only stripping when the # was preceded by whitespace in the original (untrimmed) value segment, or otherwise require at least one whitespace before # after =. Add/adjust a test case to cover KEY=#123 so this behavior is locked in intentionally.

Copilot uses AI. Check for mistakes.
Comment thread cmd/root.go
Comment on lines 21 to 27
func Execute() error {
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
var quiet quietError
if !(errors.As(err, &quiet) && quiet.Quiet()) {
fmt.Fprintln(os.Stderr, err)
}
return err
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmd.Execute() prints errors itself, but rootCmd.Execute() (Cobra) already prints errors unless SilenceErrors is set. As a result, errors can still be duplicated, and the new “quiet” exit-code errors may still produce output (at least a blank line) from Cobra even when this wrapper suppresses printing. To make the quiet-error mechanism reliable, set rootCmd.SilenceErrors = true (and consider SilenceUsage = true if you don’t want usage on all errors) and keep all printing centralized in cmd.Execute().

Copilot uses AI. Check for mistakes.
@nasimstg nasimstg enabled auto-merge April 2, 2026 08:29
@nasimstg nasimstg merged commit b6fa506 into main Apr 2, 2026
20 checks passed
@nasimstg nasimstg deleted the release/tool-v1.13.0-prep branch April 2, 2026 08:30
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.

2 participants