Skip to content

[self-care:server-go-logging] Extract CLI relay workload exit mapping with diagnostic logging - #20017

Merged
pelikhan merged 1 commit into
mainfrom
self-care/relay-exit-code-ea3c9face5a5e945
Oct 31, 2026
Merged

pelikhan merged 1 commit into
mainfrom
self-care/relay-exit-code-ea3c9face5a5e945

Conversation

@mnkiefer

Copy link
Copy Markdown
Contributor

Extracts the cao-cli-relay workload exit-status mapping into a testable workloadExitCode helper, preserving behavior, and adds real-process unit tests.

Action: Maintainer should review the small refactor in server/cmd/cao-cli-relay/main.go; accept if go -C server vet ./... and go -C server test ./... pass.

Details

  • Subsystem: server/cmd/cao-cli-relay (first path in rotation; no prior state).
  • Refactor: the post-command.Run() error handling moved into workloadExitCode(err) int: nil → 0, workload exit → its code, otherwise 125 with the same stderr message.
  • Logging: the existing cao:cli-relay logger calls (exit code only, no new calls) are retained; disabled by default; no args, output, or error text logged.
  • Tests (exit_test.go): real sh -c "exit 7", missing executable, plain error, and context-cancelled (signal-killed) process; no mocks.
  • Validation: gofmt clean, go vet ./... and go test ./... pass.

Control Plane

Generated by SelfCare / Server Go Logging · copilot · auto · ~25 AIC · ⌖ ~1 AIC · ⊞ 14.8K · ◷

  • expires on Nov 7, 2026, 4:00 AM UTC

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 31, 2026 14:41
@pelikhan
pelikhan self-requested a review as a code owner October 31, 2026 14:41
@pelikhan
pelikhan merged commit 8af2324 into main Oct 31, 2026
28 of 29 checks passed
@pelikhan
pelikhan deleted the self-care/relay-exit-code-ea3c9face5a5e945 branch October 31, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants