2.5 KiB
2.5 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-gh-account-stderr | Handle gh account status on stderr | done | 1 | plan.md | ../../specs/integrations/requirements/github-authentication.md |
Task 01: Handle gh account status on stderr
Acceptance
- A successful
systemGHAccountRunner.Runreturns non-empty stdout unchanged, and returns stderr when stdout is empty. listGHAccountsdiscovers a legacy account when the realghcommand emits its successful status report only on stderr.- Existing timeout, cancellation, non-zero exit, JSON, legacy stdout, and token behaviors remain unchanged.
Verification
cd apps/backend && go test ./internal/github -run 'Test(ListGHAccounts|ResolveGHAccountToken|GitHubCLIEnvironment|SystemGHAccountRunner)' -count=1cd apps/backend && go test ./internal/github -count=1
Files likely touched
apps/backend/internal/github/gh_accounts.goapps/backend/internal/github/gh_accounts_test.godocs/specs/integrations/requirements/github-authentication.mddocs/plans/github-cli-account-stderr/plan.mddocs/plans/github-cli-account-stderr/task-01-gh-account-stderr.md
Dependencies
None.
Parallelism
Sequential. The production runner and regression test share the same command output contract.
Inputs
- The amended named-CLI behavior and scenario in
docs/specs/integrations/requirements/github-authentication.md. - The confirmed root cause in
systemGHAccountRunner.Runand the existing stderr-first pattern inGHClient.RunAuthDiagnostics. - Issue
kdlbs/kandev#2348.
Output contract
Report the files changed, exact test commands and outcomes, any remaining risk, and synchronized task/plan statuses in the primary session.
Results
- RED:
rtk go test ./internal/github -run TestSystemGHAccountRunnerUsesStderrWhenStdoutEmpty -count=1failed as expected withunsupported gh auth status outputbefore the production change. - GREEN: the same regression test passed after the fallback was added.
- Focused task check:
rtk go test ./internal/github -run 'Test(ListGHAccounts|ResolveGHAccountToken|GitHubCLIEnvironment|SystemGHAccountRunner)' -count=1passed 12 tests. - Full task check:
rtk go test ./internal/github -count=1passed 1,092 tests. rtk git diff --checkpassed.- The helper executable is copied into
t.TempDir()and removed by Go test cleanup; no temporary files or processes remain. - Security/trust boundary: the runner still strips ambient
GH_TOKENandGITHUB_TOKEN; the fallback only selects command output after a zero exit.