[codex] Structure server environment-label probe failures - #3321
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR adds structured error types and debug logging for environment-label probe failures without changing runtime behavior - probes still fail gracefully and fall back to hostname. The changes improve observability and type safety with comprehensive test coverage. You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate b5d7546
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
b5d7546 to
2ee5fac
Compare
Dismissing prior approval to re-evaluate 2ee5fac
Summary
Validation
vp test apps/server/src/environment/ServerEnvironmentLabel.test.tsvp check(passes with 20 pre-existing warnings)vp run typecheckNote
Low Risk
Observability-only change in server startup label resolution; public return values and fallback order are unchanged.
Overview
Replaces silent handling of
/etc/machine-infoand friendly-label command (scutil,hostnamectl) failures with typed tagged errors and debug logs annotated with path, probe, executable, and cause chains, while hostname / cwd fallback behavior stays the same.Adds
ServerEnvironmentLabelFileErrorandServerEnvironmentLabelCommandError; command failures record argument count only (not argv) so sensitive values do not appear in logs. Tests now assert debug messages and full error chains when probes fail, including Linux continuing tohostnamectlafter a machine-info inspect error.Reviewed by Cursor Bugbot for commit 2ee5fac. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Structure environment-label probe failures as typed errors with debug logging
ServerEnvironmentLabelFileErrorandServerEnvironmentLabelCommandErrortagged error classes inServerEnvironmentLabel.tsto wrap failures from file inspection/read and command execution respectively.orElseSucceedsuppression.ServerEnvironmentLabel.test.tswith tests asserting the new structured error types and captured log annotations on probe failures.Macroscope summarized 2ee5fac.