Skip to content

feat(config): add YAML config file support#22

Merged
dipto0321 merged 1 commit into
mainfrom
feat/config/add-yaml-config-file-support
Jun 30, 2026
Merged

feat(config): add YAML config file support#22
dipto0321 merged 1 commit into
mainfrom
feat/config/add-yaml-config-file-support

Conversation

@dipto0321

Copy link
Copy Markdown
Owner

Summary

Linked issues

Closes #0

Type of change

  • feat — see the title; check the matching box below
    - [ ] fix
    - [ ] docs
    - [ ] style
    - [ ] refactor
    - [ ] perf
    - [ ] test
    - [ ] build
    - [ ] ci
    - [ ] chore
    - [ ] revert

Checklist

  • Title follows Conventional Commits (feat(config): subject)
  • I ran make ci locally and it passes
  • I added or updated tests for the change
  • I updated relevant docs (README, docs/, inline godoc)
  • No new linter warnings
  • If breaking: I documented the migration path in the PR body and updated CHANGELOG.md

Scope notes / things reviewers may want to look at

Screenshots / output

@dipto0321 dipto0321 force-pushed the feat/config/add-yaml-config-file-support branch from 9b96116 to fe32cb2 Compare June 30, 2026 10:25
Phase 5 — make ~/.nodeup/config.yaml a first-class config source
alongside env vars and CLI flags. Settings live in internal/config
(no cobra or detector imports) and resolve through a four-layer
precedence chain: defaults < file < env < CLI flags.

Highlights:

- internal/config: Config struct + Default + Validate + per-key
  SetByKey. FileOverlayFromNode walks the YAML tree so explicit
  zeros like `track.lts: false` round-trip faithfully — yaml.v3
  alone can't distinguish "absent" from "zero". Save() is atomic
  (temp + rename, 0600) and refuses to persist invalid configs.
  Load() applies defaults to a missing file silently.
- internal/config/env.go: NODEUP_MANAGER, NODEUP_TRACK_LTS,
  NODEUP_TRACK_CURRENT, NODEUP_PACKAGES_MIGRATE,
  NODEUP_PACKAGES_STRATEGY, NODEUP_CACHE_TTL. Parse errors include
  the variable name so env typos surface immediately.
- internal/cli: new `nodeup config` subcommands — show (YAML
  round-trip), get <key>, set <key> <value> (validates before
  writing), init [--force] (refuses to overwrite without --force).
- internal/cli/upgrade.go: now reads effective config via
  loadConfigOrDefault(); --manager flag still wins; cfg.Packages
  .Migrate replaces the hard-coded true so users can opt out.
- scripts/issue-workflow.sh: gh-based issue → branch → PR → squash
  helper. Bash regex parser fixed (space-separated alternations
  aren't valid ERE — wrapped in a group with | separators).
- docs/configuration.md: schema + precedence + env var reference
  rewritten as the source of truth for the field set.
- README, CHANGELOG: status table updated (Phase 5 ✅);
  Configuration section now shows the YAML shape and the
  config {show,get,set,init} subcommands.
- .gitignore: ignore tooling session metadata.

Tests cover the four-layer resolve ordering, env-var overlays,
file-overlay set-flag tracking, atomic save+load round-trip, and
the dotted-key get/set surface.
@dipto0321 dipto0321 force-pushed the feat/config/add-yaml-config-file-support branch from fe32cb2 to 01faa83 Compare June 30, 2026 10:29
@cocogitto-bot

cocogitto-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

✔️ 01faa83 - Conventional commits check succeeded.

@dipto0321 dipto0321 merged commit b49a3c5 into main Jun 30, 2026
10 checks passed
@dipto0321 dipto0321 deleted the feat/config/add-yaml-config-file-support branch June 30, 2026 10:38
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.

1 participant