Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 24 Oct 18:12
Immutable release. Only release title and notes can be modified.
f120511

CONGA v0.2.0 adds per-feature environment variables, makes struct tag validation always on, and lets applications replace the writer that .env loading uses.

🚀 Highlights

  • Per-feature environment variables: envprefix on a Features container derives one variable per feature, feature fields accept env tags, and root help lists each feature's variables (#53, #57).
  • Always-on tag validation: Unknown struct tag keys always fail schema build, and app.AllowTags is the only way to accept extra keys (#58).
  • Injectable .env writer: App.SetenvFunc replaces the os.Setenv call that App.Dotenv uses, so tests can pass t.Setenv (#55).

⚠ Breaking Changes & Migration

  • App.StrictTagValidation removed (#58):
    • Struct tag validation is always on. Delete StrictTagValidation(...) calls, and list any foreign tag keys with app.AllowTags("<key>", ...), which matches keys exactly.
    • The conga:"allow-unknown-tags" and conga:"recurse" directives fail schema build with ErrSchema. Replace them with app.AllowTags.
    • conga-lint drops its -strict flag.
  • envprefix on a Features container derives one variable per feature (#53, closes #49):
    • envprefix:"APP" used to derive one combined name=value map variable, APP_<FLAG>, from the container's flag name. It now derives APP_<FEATURE> for each feature.
    • To keep a single combined variable, name it with env:"<NAME>" on the container instead of envprefix.
  • {{env}} in Features help text (#57):
    • {{env}} now substitutes only the container's combined-map env variable. A container whose only environment surface is envprefix or field env tags fails schema build with ErrSchema.
    • Remove {{env}} from such help text. Root help now lists each feature's variables as [env: ...].

✨ Features

  • features: Feature fields accept env:"NAME1,NAME2" and env:"-", and an invalid per-feature value is a usage error naming the variable (#53, closes #49).
  • features: Root help lists each feature's environment variables as [env: VAR1, VAR2] (#57).
  • dotenv: Add App.SetenvFunc to replace the writer App.Dotenv uses for loaded variables (default os.Setenv) (#55, closes #51).
  • config: Config-file flag help lists the registered decoders, for example [decoders: .json, .yaml] (#59).
  • why: Help shows --why[=FORMAT], and completion offers --why=<format>, only when JSON output is enabled with WhyJSON() (#61).
  • cli: Built-in help, version, and completion command fields accept aliases and group tags (#66). (group was renamed section in v0.5.0.)

🐛 Bug Fixes

  • cli: Synthesized help, version, and completion commands follow the app-wide built-in visibility toggles, and disabled --why and --completion flags no longer appear on subcommands (#64).

📚 Documentation

  • website: Document --why flag help and completion rendering (#67).

Full Changelog: v0.1.1...v0.2.0

Requirements: Go 1.27+ · Docs · pkg.go.dev