Skip to content

Commit 0c52122

Browse files
committed
chore(release): 2.3.0 -- exit code semantics, BK formatting, dep bumps
Bumps the project version from 2.2.86 to 2.3.0 (minor) to signal the breaking exit-code change in this PR: Exit 1 == blocking security finding (previously: anything) Exit 3 == infrastructure / API error (NEW) CHANGELOG.md: - Breaking-change callout for the exit code semantics shift - --exit-code-on-api-error documentation - Commit message auto-truncation note - Buildkite log formatting note - Bundled Dependabot bumps roll-up - CI hardening summary (dependabot.yml, dependabot-review.yml, python-tests guards, e2e skip-on-dependabot) README.md: - New "Exit codes" section with the canonical table - Buildkite soft_fail examples (default exit 3 and custom 100) pyproject.toml + socketsecurity/__init__.py + uv.lock: - 2.2.87 (from the in-flight branch) -> 2.3.0 Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
1 parent 6417ea2 commit 0c52122

5 files changed

Lines changed: 97 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,63 @@
11
# Changelog
22

3+
## 2.3.0
4+
5+
### Breaking change: exit codes for infrastructure errors
6+
7+
API and infrastructure errors (timeouts, network failures, unexpected exceptions)
8+
now exit with code `3` instead of `1`. Exit code `1` is now exclusively used for
9+
blocking security findings.
10+
11+
`--disable-blocking` no longer zeroes out infrastructure errors -- it only affects
12+
exit code `1` (security findings). If your pipeline relied on `--disable-blocking`
13+
to also swallow infra errors, use `--exit-code-on-api-error 0` instead.
14+
15+
If you have pipeline logic that checks `exit_code == 1` to catch any CLI failure,
16+
update it to handle `3` separately for infrastructure errors. See the exit code
17+
reference in the README.
18+
19+
### New: `--exit-code-on-api-error`
20+
21+
New flag to remap the infrastructure error exit code. Useful for Buildkite
22+
`soft_fail` configs or pipelines with existing exit-code conventions:
23+
24+
```
25+
socketcli --exit-code-on-api-error 100 ...
26+
```
27+
28+
Set to `0` to swallow infrastructure errors entirely.
29+
30+
### New: commit message auto-truncation
31+
32+
`--commit-message` values longer than 200 characters are now automatically
33+
truncated before being sent to the API. This prevents HTTP 413 errors from
34+
oversized URL query parameters -- common when using AI-generated commit
35+
messages or piping in `$BUILDKITE_MESSAGE`.
36+
37+
### Improved: Buildkite log formatting
38+
39+
When running inside a Buildkite job (`BUILDKITE=true`), infrastructure errors
40+
now emit Buildkite log section markers (`^^^ +++` and `--- :warning:`) so the
41+
error section auto-expands in the Buildkite UI, along with a tip on using
42+
`soft_fail` to prevent blocking.
43+
44+
### Dependencies
45+
46+
Bundles eight Dependabot main-app upgrades (closes #175, #177, #181, #184, #188,
47+
#190, #198, #200) and three e2e fixture upgrades (closes #186, #187, #196).
48+
All target versions verified through Socket Firewall (`sfw`).
49+
50+
### CI / Internal
51+
52+
- New `.github/dependabot.yml` with grouped weekly bumps and a 7-day cooldown;
53+
e2e fixtures are intentionally excluded.
54+
- New `dependabot-review` workflow runs Socket Firewall install smoke jobs on
55+
every Dependabot PR -- no API secret required.
56+
- `python-tests` workflow now runs `uv lock --locked` drift check, a top-level
57+
import smoke step, and `pip-audit`.
58+
- `e2e-test` workflow skips on Dependabot PRs (which can't access secrets);
59+
Socket Firewall covers the supply-chain check.
60+
361
## 2.2.83
462

563
- Fixed branch detection in detached-HEAD CI checkouts. When `git name-rev --name-only HEAD` returned an output with a suffix operator (e.g. `remotes/origin/master~1`, `master^0`), the `~N`/`^N` was previously passed through as the branch name and rejected by the Socket API as an invalid Git ref. The suffix is now stripped before the prefix split, producing the bare branch name.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,42 @@ Minimal pattern:
164164
SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_TOKEN }}
165165
```
166166
167+
## Exit codes
168+
169+
| Code | Meaning |
170+
|------|---------|
171+
| `0` | Clean scan -- no blocking issues found (or `--disable-blocking` set) |
172+
| `1` | Blocking security finding(s) detected |
173+
| `2` | Scan interrupted (SIGINT / Ctrl+C) |
174+
| `3` | Infrastructure or API error (timeout, network failure, unexpected error) |
175+
176+
Exit code `3` is a Socket convention, not an industry standard. Use
177+
`--exit-code-on-api-error <N>` to remap it -- e.g. to a Buildkite
178+
`soft_fail` code, or to `0` to swallow infrastructure errors entirely.
179+
180+
### Buildkite `soft_fail` example
181+
182+
To prevent infrastructure errors from blocking PRs while still failing on
183+
real security findings:
184+
185+
```yaml
186+
steps:
187+
- label: ":lock: Socket Security Scan"
188+
command: "socketcli ..."
189+
soft_fail:
190+
- exit_status: 3
191+
```
192+
193+
Or with a custom exit code:
194+
195+
```yaml
196+
steps:
197+
- label: ":lock: Socket Security Scan"
198+
command: "socketcli --exit-code-on-api-error 100 ..."
199+
soft_fail:
200+
- exit_status: 100
201+
```
202+
167203
## Common gotchas
168204

169205
See [`docs/troubleshooting.md`](https://github.com/SocketDev/socket-python-cli/blob/main/docs/troubleshooting.md#common-gotchas).

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.2.88"
9+
version = "2.3.0"
1010
requires-python = ">= 3.11"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.2.88'
2+
__version__ = '2.3.0'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)