Skip to content

feat: make --asset accept names in addition to object keys (#101)#168

Merged
Zious11 merged 5 commits intodevelopfrom
worktree-feat-asset-name-resolution-101
Apr 5, 2026
Merged

feat: make --asset accept names in addition to object keys (#101)#168
Zious11 merged 5 commits intodevelopfrom
worktree-feat-asset-name-resolution-101

Conversation

@Zious11
Copy link
Copy Markdown
Owner

@Zious11 Zious11 commented Apr 5, 2026

Summary

  • Add resolve_asset function in helpers.rs that accepts both object keys (e.g., OBJ-18) and asset names (e.g., "Acme Corp")
  • Names are resolved via AQL Name like search with disambiguation following the same pattern as --assignee resolution
  • Replaces validate_asset_key call in list.rs handler with resolve_asset — downstream JQL generation unchanged

Closes #101

Test Plan

  • cargo test — all tests pass (unit, integration, property)
  • cargo clippy -- -D warnings — zero warnings
  • cargo fmt --all -- --check — clean
  • Handler test: --asset "Acme" resolves to key, produces correct aqlFunction JQL
  • Handler test: --asset "Nonexistent" produces actionable error message
  • Key passthrough: --asset OBJ-18 still works (no API call)

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 5, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 28.04878% with 59 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cli/issue/helpers.rs 25.31% 59 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_asset helper to resolve --asset values as either key passthrough or name→key via Assets AQL search.
  • Update the issue list handler to call resolve_asset instead 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.

@Zious11 Zious11 merged commit e114525 into develop Apr 5, 2026
7 checks passed
@Zious11 Zious11 deleted the worktree-feat-asset-name-resolution-101 branch April 5, 2026 22:43
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.

issue list --asset should accept asset names, not just object keys

3 participants