feat: make --asset accept names in addition to object keys (#101)#168
Merged
feat: make --asset accept names in addition to object keys (#101)#168
Conversation
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR expands jr issue list --asset to accept human-friendly asset names in addition to Assets object keys, resolving names via an AQL Name like lookup and reusing the existing partial-match disambiguation approach used elsewhere in the CLI.
Changes:
- Add
resolve_assethelper to resolve--assetvalues as either key passthrough or name→key via Assets AQL search. - Update the issue list handler to call
resolve_assetinstead of only validating key format. - Add handler-level tests for asset-name resolution success and no-match error messaging.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/cli/issue/helpers.rs |
Adds resolve_asset to map --asset input to an Assets object key (passthrough or AQL search + disambiguation). |
src/cli/issue/list.rs |
Switches --asset handling to use resolve_asset so names can be accepted. |
tests/cli_handler.rs |
Adds handler tests validating name→key resolution and “no matching assets” errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
resolve_assetfunction inhelpers.rsthat accepts both object keys (e.g.,OBJ-18) and asset names (e.g.,"Acme Corp")Name likesearch with disambiguation following the same pattern as--assigneeresolutionvalidate_asset_keycall inlist.rshandler withresolve_asset— downstream JQL generation unchangedCloses #101
Test Plan
cargo test— all tests pass (unit, integration, property)cargo clippy -- -D warnings— zero warningscargo fmt --all -- --check— clean--asset "Acme"resolves to key, produces correctaqlFunctionJQL--asset "Nonexistent"produces actionable error message--asset OBJ-18still works (no API call)