Skip to content

Commit c102f72

Browse files
Add silent error handling convention to CLAUDE.md
Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
1 parent e0509db commit c102f72

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,16 @@ scripts that set up temporary git repos and validate behavior.
6767
return code is checked automatically.
6868
- In workflow YAML files, always use the latest major version of built-in
6969
GitHub Actions (e.g., `actions/checkout@v5`, `actions/upload-artifact@v4`).
70+
- In autosolve workflows, install the Claude CLI (npm) BEFORE any cloud
71+
authentication step, and move credential files out of the workspace
72+
immediately after authentication. npm post-install scripts run with the
73+
job's full environment, so installing after auth exposes credentials
74+
(e.g., the OIDC bearer token in `gha-creds-*.json`) to arbitrary code.
75+
The correct step order is: checkout → install CLI → authenticate →
76+
move credentials → run autosolve action.
77+
- Do not silently swallow errors. In shell scripts, avoid `|| return 0`,
78+
`|| true`, or `|| :` to suppress failures without logging — use
79+
`log_warning` to surface what went wrong. In Go code, avoid `return nil`
80+
on error paths without logging or returning the error. If ignoring an
81+
error is genuinely correct (e.g., best-effort cleanup), add a comment
82+
explaining why it's safe to ignore.

0 commit comments

Comments
 (0)