[AI] OSAC-3500: osac CLI help output emits ANSI color codes even when not connected to a terminal (no NO_COLOR/non-TTY detection) - #309
Conversation
…connected to a terminal (no NO_COLOR/non-TTY detection) Co-authored-by: Alexander Chuzhoy <achuzhoy@redhat.com>
|
@osac-jira-ai-issue-solver[bot]: This pull request references OSAC-3500 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
AI Session Costs
|
|
🤖 Finished Review · ✅ Success · Started 6:58 AM UTC · Completed 7:13 AM UTC Commit: |
ReviewFindingsLow
Previous runReviewFindingsLow
Previous run (2)ReviewFindingsMedium
Low
Previous run (3)ReviewFindingsLow
Previous run (4)ReviewFindingsMedium
Low
Previous run (5)ReviewFindingsMedium
Low
Previous run (6)ReviewFindingsMedium
Low
Labels: PR fixes CLI help output styling — 'bug' label is the closest match for categorization. |
Co-authored-by: Alexander Chuzhoy <achuzhoy@redhat.com>
|
In comment, @fullsend-ai-review[bot] said:
Addressed in 84e897a. |
|
In comment, @fullsend-ai-review[bot] said:
Addressed in 84e897a. |
|
In comment, @fullsend-ai-review[bot] said:
Addressed in 84e897a. |
|
🤖 Finished Review · ✅ Success · Started 7:26 AM UTC · Completed 7:43 AM UTC Commit: |
Co-authored-by: Alexander Chuzhoy <achuzhoy@redhat.com>
|
In comment, @fullsend-ai-review[bot] said:
No action needed — this is a CI status notification with no new findings. Addressed in d06caea. |
|
🤖 Finished Review · ✅ Success · Started 7:54 AM UTC · Completed 8:11 AM UTC Commit: |
|
In comment, @fullsend-ai-review[bot] said:
I was unable to produce code changes to address this comment after multiple attempts. |
Co-authored-by: Alexander Chuzhoy <achuzhoy@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 11:09 AM UTC · Completed 11:23 AM UTC Commit: |
Co-authored-by: Alexander Chuzhoy <achuzhoy@redhat.com>
|
In comment, @fullsend-ai-review[bot] said:
CI status notification — no action needed. Addressed in 0d6820b. |
|
In comment, @fullsend-ai-review[bot] said:
Reference to review details. Added --no-color to the Global Options section of OSAC-CLI-HOWTO.md to address the [medium] incomplete-documentation finding from the referenced review. Addressed in 0d6820b. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: osac-jira-ai-issue-solver[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🤖 Finished Review · ✅ Success · Started 11:36 AM UTC · Completed 11:51 AM UTC Commit: |
Co-authored-by: Alexander Chuzhoy <achuzhoy@redhat.com>
|
In comment, @fullsend-ai-review[bot] said:
CI status notification — no action needed. Addressed in de4c44b. |
|
In comment, @fullsend-ai-review[bot] said:
Addressed two of the five inline findings: (1) constant-grouping — grouped NoColorFlag and NoColorFlagHelp into a const(...) block; (2) api-consistency — removed the noColorFlagName parameter from Setup() since NoColorFlag is defined in the same package and every caller passed help.NoColorFlag. The remaining three findings (naming-convention, code-organization, test-adequacy) are informational — the reviewer acknowledges the current approach is justified. Addressed in de4c44b. |
|
🤖 Finished Review · ✅ Success · Started 12:00 PM UTC · Completed 12:14 PM UTC Commit: |
Resolves OSAC-3500
Summary
Fixes the osac CLI help output grey/dim color issue and adds a
--no-colorflag.The prior fix (commit 1963de9) correctly added
NO_COLORenvironment variable support andnon-TTY detection, but Glamour's
Document.Colorstill forced body text to render in hardcodedgrey (ANSI 252/234) instead of the terminal's default foreground color. This made help text
hard to read on many terminal color schemes.
Changes
Document.Colorfrom Glamour's Dark/Light style configs so help body text uses theterminal's default foreground color instead of hardcoded grey
--no-colorpersistent flag to disable colored output from the CLI, complementing theexisting
NO_COLORenvironment variable support\x1b[...) to any ESC character (\x1b) to catchall escape sequences including OSC 8 hyperlinks
--no-colorflag behavior on root and subcommand helpFiles changed
fulfillment-service/internal/cmd/cli/help/help_setup.go— flag registration, style fix,color logic refactor
fulfillment-service/internal/cmd/cli/help/help_setup_test.go— regex update, 2 new testsTest plan
ginkgo run internal/cmd/cli/help/— 7/7 pass (5 existing + 2 new)ginkgo run -r internal/cmd/cli/— all 31 suites passgofmt -s -w .— no changesuv run dev.py lint— 0 issues./osac --help | grep -cP '\x1b'→ 0 (piped, no escape codes)./osac --no-color --help | grep -cP '\x1b'→ 0 (flag works)NO_COLOR= ./osac --help | grep -cP '\x1b'→ 0 (env var works)