Tier 3: app context, config system, output alignment, exit codes#15
Merged
Conversation
- 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>
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.
Summary
src/app.rswithAppContext,dispatch_command(), auth prepare/retry pattern;main.rsslimmed to parse + delegatesrc/config.rsported from gitlab-cli: layered resolution (CLI flags > env vars > config file > embedded),EmbeddedMode,PendingConfig/ResolvedConfigbuild.rswithBUILD_YOUTRACK_URL,BUILD_YOUTRACK_TOKEN,BUILD_EMBED_MODEsupportOutputMode→OutputFormatwith YAML support viaserde_yml;--output <table|json|yaml>flag;--jsonkept as hidden backward-compat aliasusers().me()with retry (up to 3 attempts)--youtrack-url,--token,--authglobal flagsNew files
build.rs— compile-time embed supportsrc/app.rs— AppContext + dispatchsrc/config.rs— layered config resolution (5 unit tests)Deleted
src/client.rs— replaced byapp::build_context()Tests added
Test plan
cargo check— compiles cleanlycargo test— all 22 tests pass--output yamlworks end-to-endBUILD_YOUTRACK_URL=... BUILD_YOUTRACK_TOKEN=... BUILD_EMBED_MODE=locked cargo build🤖 Generated with Claude Code