Skip to content

Tier 3: app context, config system, output alignment, exit codes#15

Merged
ghostspice merged 1 commit into
0.1.xfrom
align/tier-3
Apr 17, 2026
Merged

Tier 3: app context, config system, output alignment, exit codes#15
ghostspice merged 1 commit into
0.1.xfrom
align/tier-3

Conversation

@ghostspice

@ghostspice ghostspice commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • App context refactor — new src/app.rs with AppContext, dispatch_command(), auth prepare/retry pattern; main.rs slimmed to parse + delegate
  • Config system — new src/config.rs ported from gitlab-cli: layered resolution (CLI flags > env vars > config file > embedded), EmbeddedMode, PendingConfig/ResolvedConfig
  • Locked build mode — new build.rs with BUILD_YOUTRACK_URL, BUILD_YOUTRACK_TOKEN, BUILD_EMBED_MODE support
  • Output alignmentOutputModeOutputFormat with YAML support via serde_yml; --output <table|json|yaml> flag; --json kept as hidden backward-compat alias
  • Auth validation — prompted tokens validated via users().me() with retry (up to 3 attempts)
  • Exit codes — granular map: 2=config, 3=auth/forbidden, 4=not found, 5=rate limited
  • CLI flags — new --youtrack-url, --token, --auth global flags
  • Re-pin SDK to Tier 3 rev (granular errors, verb helpers, chrono timestamps, safe pagination)
  • Toolchain bump — 1.85.0 → 1.88.0

New files

  • build.rs — compile-time embed support
  • src/app.rs — AppContext + dispatch
  • src/config.rs — layered config resolution (5 unit tests)

Deleted

  • src/client.rs — replaced by app::build_context()

Tests added

  • 6 auth tests, 5 config tests, 6 CLI parse tests

Test plan

  • cargo check — compiles cleanly
  • cargo test — all 22 tests pass
  • Verify --output yaml works end-to-end
  • Verify locked build: BUILD_YOUTRACK_URL=... BUILD_YOUTRACK_TOKEN=... BUILD_EMBED_MODE=locked cargo build

🤖 Generated with Claude Code

- Re-pin SDK to rev b60d340 (granular errors, chrono timestamps,
  verb helpers, safe pagination)
- Add config.rs: layered config resolution with CLI flags, env vars,
  config file, and embedded build support
- Add app.rs: AppContext + dispatch_command + auth retry pattern
- Add build.rs: compile-time embed support for URL/token/mode
- Rewrite auth.rs: prepare/retry pattern with token validation via
  users().me()
- Expand output.rs: OutputMode -> OutputFormat with YAML support
  (serde_yml)
- Update error.rs: granular exit codes for Unauthorized (3),
  NotFound (4), RateLimited (5), Config (2)
- Add cli.rs global flags: --youtrack-url, --token, --auth, --output
- Slim main.rs to delegate to app::run()
- Delete client.rs (replaced by app::build_context)
- Add Clone derives to command arg structs for dispatch
- Add unit tests for CLI flags, config resolution, and auth logic

Plan items: 2.3, 2.4, 2.6, 2.9, 2.10, 3.10

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ghostspice ghostspice merged commit 04aa2db into 0.1.x Apr 17, 2026
6 of 10 checks passed
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