Skip to content

Commit 44746b2

Browse files
leliaclaude
andcommitted
Merge origin/main and resolve baseline resolution overlap
main added structured baseline-selection logging to resolve_base_full_scan_id while this branch added workspace and scan-type scoping plus explicit handling for a failed lookup. Both are kept: the log line now reports the scan chosen by the workspace-scoped lookup, and a lookup that errors still exits rather than resolving to an empty baseline. The CHANGELOG section was renamed to 2.8.2 before merging, since main has since shipped 2.8.1 and a matching header is dropped silently. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2 parents 860ce6f + 6864479 commit 44746b2

42 files changed

Lines changed: 986 additions & 210 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/setup-docker/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ inputs:
1919
runs:
2020
using: "composite"
2121
steps:
22-
- uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
22+
- uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4.3.0
2323
if: inputs.enable-qemu == 'true'
24-
- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
24+
- uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
2525
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
2626
with:
2727
username: ${{ inputs.dockerhub-username }}

.github/workflows/python-tests.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,26 @@ jobs:
6767
uv export --no-hashes --no-emit-project --format requirements-txt > /tmp/req-audit.txt
6868
uvx pip-audit --strict --progress-spinner off --disable-pip --no-deps -r /tmp/req-audit.txt
6969
70+
ruff:
71+
runs-on: ubuntu-latest
72+
timeout-minutes: 10
73+
steps:
74+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
75+
with:
76+
fetch-depth: 1
77+
persist-credentials: false
78+
- name: 🐍 setup python
79+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
80+
with:
81+
python-version: ${{ env.PYTHON_VERSION }}
82+
- name: 🛠️ install deps
83+
run: |
84+
python -m pip install --upgrade pip
85+
pip install uv
86+
uv sync --extra dev
87+
- name: 🧹 run ruff
88+
run: uv run ruff check
89+
7090
unsupported-python-install:
7191
runs-on: ubuntu-latest
7292
timeout-minutes: 10

.github/workflows/version-check.yml

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- 'socketsecurity/**'
77
- 'pyproject.toml'
88
- 'uv.lock'
9+
# Included so a change to the check itself is exercised by its own PR.
10+
- '.github/workflows/version-check.yml'
911

1012
permissions:
1113
contents: read
@@ -42,16 +44,37 @@ jobs:
4244
export PR_VERSION
4345
export MAIN_VERSION
4446
45-
# Compare against both main and latest published PyPI release.
47+
# Compare against the latest published PyPI release.
4648
python3 <<'PY'
4749
import json
4850
import os
51+
import tomllib
4952
import urllib.request
5053
from packaging import version
5154
5255
pr_ver = version.parse(os.environ["PR_VERSION"])
5356
main_ver = version.parse(os.environ["MAIN_VERSION"])
5457
58+
with open("pyproject.toml", "rb") as fh:
59+
pyproject_ver = version.parse(tomllib.load(fh)["project"]["version"])
60+
61+
# The version is two hand-maintained literals with nothing deriving one
62+
# from the other: pyproject.toml is what actually gets published, and
63+
# socketsecurity/__init__.py is what the CLI reports as its User-Agent.
64+
# Every comparison below reads only __init__.py, so bumping that alone
65+
# would pass this job and then publish under the old number -- caught
66+
# late, by twine rejecting an existing file, after the merge. Require
67+
# the two to agree before comparing anything. (uv.lock carries a third
68+
# copy, but uv derives it and `uv lock --locked` in python-tests
69+
# already fails when it drifts.)
70+
if pr_ver != pyproject_ver:
71+
print(
72+
f"❌ Version mismatch inside the PR: pyproject.toml is "
73+
f"{pyproject_ver}, socketsecurity/__init__.py is {pr_ver}. "
74+
f"Bump both."
75+
)
76+
raise SystemExit(1)
77+
5578
with urllib.request.urlopen("https://pypi.org/pypi/socketsecurity/json") as response:
5679
pypi_data = json.load(response)
5780
@@ -62,19 +85,37 @@ jobs:
6285
published_versions.append(parsed)
6386
6487
pypi_ver = max(published_versions) if published_versions else version.parse("0.0.0")
65-
required_floor = max(main_ver, pypi_ver)
6688
67-
if pr_ver <= required_floor:
89+
# The only hard requirement is that the version is ahead of what is
90+
# actually released. Treating main's version as a second floor breaks
91+
# the legitimate case where several PRs share one unreleased release:
92+
# the first bumps main to the new version and the rest ride it without
93+
# bumping again, which is what keeps them under a single changelog
94+
# header. Main is therefore only a floor when this PR moves the
95+
# version -- a change to it must go forwards, never backwards.
96+
if pr_ver <= pypi_ver:
6897
print(
69-
f"❌ Version must be greater than main and PyPI! "
70-
f"Main: {main_ver}, PyPI: {pypi_ver}, PR: {pr_ver}"
98+
f"❌ Version {pr_ver} is already published on PyPI "
99+
f"(latest release: {pypi_ver}). Bump it."
100+
)
101+
raise SystemExit(1)
102+
103+
if pr_ver < main_ver:
104+
print(
105+
f"❌ Version moves backwards: main is {main_ver}, PR is {pr_ver}."
71106
)
72107
raise SystemExit(1)
73108
74-
print(
75-
f"✅ Version properly incremented. "
76-
f"Main: {main_ver}, PyPI: {pypi_ver}, PR: {pr_ver}"
77-
)
109+
if pr_ver == main_ver:
110+
print(
111+
f"✅ Riding main's unreleased {pr_ver} "
112+
f"(latest PyPI release: {pypi_ver})."
113+
)
114+
else:
115+
print(
116+
f"✅ Version properly incremented. "
117+
f"Main: {main_ver}, PyPI: {pypi_ver}, PR: {pr_ver}"
118+
)
78119
PY
79120
80121
- name: Require uv.lock update when pyproject changes

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,57 @@
1616
repository, and default branch. A baseline lookup that fails is reported as an
1717
API error instead of resolving to an empty baseline, and temporary scans are
1818
skipped when selecting one.
19+
## 2.8.1
20+
21+
### Changed: bump pinned @coana-tech/cli to 15.10.40
22+
23+
- Bumped the pinned reachability engine (`@coana-tech/cli`) from `15.10.39` to
24+
`15.10.40`. See the
25+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
26+
for engine changes.
27+
28+
## 2.8.0
29+
30+
### Changed: improve monorepo scan diagnostics and guidance
31+
32+
- Added aggregate scan configuration, manifest-count, baseline-selection, and
33+
fallback diagnostics without listing submitted manifest paths.
34+
- Clarified monorepo scan scoping, workspace flags, CI path filters, and timeout
35+
behavior, with a changed-workspace GitHub Actions example.
36+
37+
### Changed: bump socketdev to 3.6.0
38+
39+
- Bumped the pinned SDK (`socketdev`) from `3.5.0` to `3.6.0`. Its package-type
40+
enum gained ten members — `alpm`, `chrome`, `clawhub`, `edge-extension`,
41+
`firefox-extension`, `qpkg`, `socket`, `swid`, `vscode` and
42+
`vscode-extension` — so artifacts of those types are now reported under their
43+
own type instead of falling back to `unknown`.
44+
45+
### Fixed: apply configured exit codes to API failures
46+
47+
- Full-scan and streamed-diff API failures now use the configured infrastructure
48+
error exit code instead of the security-finding exit code.
49+
50+
### Fixed: mid-severity findings were dropped from the Slack summary
51+
52+
- The Slack reachability formatter keyed every severity lookup on `medium`,
53+
but the API sends `middle`. A mid-severity finding therefore missed all of
54+
them at once: it was not counted, so the summary always read `Medium: 0`; it
55+
was excluded from `total_findings`, which can drive the "and N more" count
56+
negative; and it sorted at the default order of 4, below `low`, so it was the
57+
first thing truncated when the Slack block limit was reached.
58+
- Severity is now normalized to one spelling when an alert is read, matching
59+
how the GitLab and PR-comment paths already handle both forms. The findings
60+
themselves were always listed; only the counts, ordering and truncation were
61+
wrong.
62+
63+
## 2.7.2
64+
65+
### Changed: bump pinned @coana-tech/cli to 15.10.39
66+
67+
- Bumped the pinned reachability engine (`@coana-tech/cli`) from `15.10.36` to
68+
`15.10.39`. See the [Coana changelogs](https://docs.coana.tech/changelogs) for
69+
engine changes.
1970

2071
## 2.7.1
2172

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ value — e.g. a Buildkite
229229
code, or `0` to swallow infra errors. Exit `3` is a Socket convention, not an
230230
industry standard.
231231

232+
This mapping applies to errors the CLI receives and handles. An external process
233+
supervisor (for example GNU `timeout`) can terminate the CLI before it handles an
234+
error, so the supervisor's exit status (commonly 124 or 137) takes precedence.
235+
232236
### How these options interact
233237

234238
The two flags that affect exit codes can cancel each other out, so the order of

0 commit comments

Comments
 (0)