Repository navigation
TR-21906: Display AI automated and generated fields for cases list and get commands #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/TR-22028
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,8 @@ def get( | |
| environment.log(f" Template ID: {case_data.get('template_id', 'N/A')}") | ||
| environment.log(f" Type ID: {case_data.get('type_id', 'N/A')}") | ||
| environment.log(f" Priority ID: {case_data.get('priority_id', 'N/A')}") | ||
| environment.log(f" AI Generated: {'Yes' if case_data.get('is_ai_generated') else 'No'}") | ||
| environment.log(f" AI Automated: {'Yes' if case_data.get('is_ai_automated') else 'No'}") | ||
|
|
||
| if case_data.get("milestone_id"): | ||
| environment.log(f" Milestone ID: {case_data.get('milestone_id')}") | ||
|
|
@@ -123,6 +125,8 @@ def get( | |
| display_name = key.replace("_", " ").title() | ||
| if value is None: | ||
| display_value = "N/A" | ||
| elif isinstance(value, bool): | ||
| display_value = "Yes" if value else "No" | ||
| elif isinstance(value, builtins.list): | ||
| if value: | ||
| display_value = f"{len(value)} item(s): {value}" | ||
|
|
@@ -239,6 +243,8 @@ def list( | |
| # Handle None values | ||
| if value is None: | ||
| display_value = "N/A" | ||
| elif isinstance(value, bool): | ||
| display_value = "Yes" if value else "No" | ||
| elif isinstance(value, builtins.list): | ||
| # Handle list fields (like labels) | ||
| if key == "labels" and value: | ||
|
|
@@ -265,6 +271,8 @@ def list( | |
|
|
||
| environment.log(f" Priority ID: {case.get('priority_id', 'N/A')}") | ||
| environment.log(f" Type ID: {case.get('type_id', 'N/A')}") | ||
| environment.log(f" AI Generated: {'Yes' if case.get('is_ai_generated') else 'No'}") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the compact list output, optional fields like refs, labels, and milestone_id are shown conditionally — only when they have a value. But the AI fields are shown unconditionally for every case, even when both are False/absent. If a project never uses AI generation, every case output will have two lines of "No". Is this intentional? |
||
| environment.log(f" AI Automated: {'Yes' if case.get('is_ai_automated') else 'No'}") | ||
|
|
||
| if case.get("refs"): | ||
| refs = case.get("refs", "") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing test: get --show-all-fields boolean formatting
The elif isinstance(value, bool) branch in the get() show-all-fields code path (lines 126–127) has no test. test_list_cases_show_all_fields_bool_formatting covers the equivalent branch in list, but the get --show-all-fields branch is completely untested. A test analogous to test_list_cases_show_all_fields_bool_formatting but invoking cmd_cases.get with ["--case-id", "123", "--show-all-fields"] is missing.