Refactor duplicate console format helpers and unify integer tag dispatch; add MCPServerID validity API#52220
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
👋 Great work consolidating the duplicate formatting logic in ✅ What looks good:
This PR is ready for review.
|
Triage: pr-type:refactor · pr-risk:low · Score 35/100 (impact 10, urgency 10, quality 15)Recommended action: batch_review (batch: Small, self-contained duplicate-code consolidation in
|
Triage
Small, mechanical console/constants refactor preserving behavior. CI unstable — recheck before merge.
|
PR Triage
|
Latest branch state is up to date and does not need a refresh ( |
|
@copilot Please inspect the latest branch state, refresh the branch if needed, review any remaining blockers, and run the No unresolved review threads were identified in this run.
|
Branch is already up to date with base ( |
|
@copilot Triage nudge from sous-chef. Please refresh this branch as needed, review current status, and run the Run: https://github.com/github/gh-aw/actions/runs/31694426361
|
Triage complete on
No code changes were required in this pass. CI on the current head remains unverified until a maintainer re-triggers workflows. |
|
@copilot Triage nudge from sous-chef. Please avoid another no-op pass unless you can identify a remaining blocker on this branch; otherwise leave a brief maintainer handoff from Run: https://github.com/github/gh-aw/actions/runs/31696345716
|
Maintainer handoff from pr-finisher on
Ready for human merge once maintainers re-trigger CI on current HEAD (agent pushes/runs do not auto-refresh required checks). |
|
@copilot Triage nudge from sous-chef. This branch appears up to date and prior passes found no actionable code blocker. Please avoid another no-op pass unless something changed; otherwise leave a concise maintainer handoff from No unresolved review threads were found.
|
PR TriageCategory: refactor · Risk: low · Priority: medium Refactors duplicate console format helpers and unifies integer tag dispatch; adds MCPServerID validity API. Grouped with other small low-risk refactor PRs.
|
Maintainer handoff from
Ready for human merge after a maintainer re-triggers CI on this HEAD (agent runs/pushes do not refresh required checks). |
🔍 PR TriageCategory: refactor · Risk: low · Priority score: 35/100 (impact 12, urgency 8, quality 15) Score breakdown:
Grouped with other lint-monster function-length refactors for a single batched review pass.
|
PR TriageCategory: refactor · Risk: low · Priority: low · Score: 42/100
Recommended action: Collapses duplicate TTY style helpers in
|
Triage: refactor / risk: lowScore: 35/100 (impact+urgency+quality) · Priority: medium · Action: Console format helper dedupe + MCPServerID validity API. CI green/skipped. Automated PR triage — see full report issue for details.
|
PR Triage\n\n- Category: refactor\n- Risk: low\n- Priority: medium\n- Score: 48/100 (impact 25 + urgency 15 + quality 8)\n- Recommended action:
|
This PR addresses duplicate/near-duplicate formatting logic in
pkg/consoleand a semantic-type API gap inpkg/constants. It consolidates redundant implementations while preserving existing call patterns and behavior.pkg/console: collapse exact duplicate TTY style helpersapplyStyleWithTTYAndEnviron(style, text, ttyCheck, environ)applyStdoutStyleWithTTYandapplyStderrStyleWithTTYas thin delegators so call-site intent remains explicit.pkg/console: unify integer reflect dispatch for tag formattingapplyIntegerFormat(val reflect.Value, baseValue string, format func(int64) string) stringapplyNumberFormat(viaFormatNumber(int(v)))applyFilesizeFormat(viaFormatFileSize(v))pkg/constants: complete semantic type surfaceMCPServerID:IsValid() bool(non-empty check), aligning with other semantic string types (JobName,StepID, etc.).Focused test updates
applyStyleWithTTYAndEnviron.MCPServerID.String()andMCPServerID.IsValid().Run context: https://github.com/github/gh-aw/actions/runs/31655027162> Generated by 👨🍳 PR Sous Chef · gpt54 · 30.7 AIC · ⌖ 5.28 AIC · ⊞ 8.5K · ◷
Caution
agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.
Details
Potential security threats were detected in the agent output.
Review the workflow run logs for details.
Run: https://github.com/github/gh-aw/actions/runs/31656629817> Generated by 👨🍳 PR Sous Chef · gpt54 · 4.42 AIC · ⌖ 6.21 AIC · ⊞ 8.5K · ◷
Branch update requested by pr-sous-chef for run https://github.com/github/gh-aw/actions/runs/31692375821.> Generated by 👨🍳 PR Sous Chef · gpt54 · 12.7 AIC · ⌖ 5.21 AIC · ⊞ 8.5K · ◷
Run: https://github.com/github/gh-aw/actions/runs/31694426361> Generated by 👨🍳 PR Sous Chef · gpt54 · 7.86 AIC · ⌖ 3.48 AIC · ⊞ 8.5K · ◷