Skip to content

Commit 5b615c8

Browse files
authored
chore(release): 3.1.0 (#109)
* docs(changelog): draft 3.1.0 entry for the bundled release Covers #97, #98, #104, #105 and #106. Internal-only changes (#104, #106) are collapsed into a short section; customer-facing changes keep the detail needed to plan an upgrade, including the behavioral change where an unresolvable changed_files scope now fails instead of scanning. * chore(deps): refresh Socket-owned tool pins Socket npm CLI 1.1.154 -> 1.1.165 across all three images, matching the current npm release. Socket Python CLI 2.6.3 -> 2.7.0 in the heavy and app-tests images. 2.7.0 is NOT published to PyPI yet (latest is 2.6.11), so this is scaffolding: the heavy and app-tests image builds and core-tool-watch both fail until it lands. Keep this commit separate so it can be dropped or held if the CLI release slips. The socketdev Python SDK is already current at 3.5.0, so no change. * chore(release): 3.1.0 Version metadata, uv.lock, CHANGELOG date stamp, and 74 current-release documentation references, via scripts/prep_release.py --version 3.1.0. * fix(app-tests): refresh socketsecurity index metadata on install This install pins an exact version, so a stale cached uv index response makes a freshly published release look like it does not exist. Use --refresh-package for just this package rather than --no-cache, which would discard the cache mount's benefit for bandit and built wheels. Dockerfile.heavy already passes --no-cache-dir on its pip equivalent. * test: assert the socketsecurity pin, not the RUN's formatting The assertion matched an exact literal, so it broke when the install gained a --refresh-package flag and a line continuation even though the version pin it guards was unchanged. Collapse continuations and match the ARG-pinned spec after 'uv tool install' instead. Verified the guard still fails for an unpinned spec and for a hardcoded version that bypasses the ARG.
1 parent 9ec9524 commit 5b615c8

15 files changed

Lines changed: 169 additions & 114 deletions

‎CHANGELOG.md‎

Lines changed: 70 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,79 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
88

99
## [Unreleased]
1010

11-
### Fixed
12-
- `changed_files` diff-only mode always resolved to zero files in the pre-built
13-
Docker GitHub Action: the container runs as root while the checkout is owned
14-
by the runner user, so git's ownership check refused every diff lookup, the
15-
scope silently resolved to nothing, and the scanners skipped with a green
16-
run. Git subprocesses now mark the scan workspace as `safe.directory` via
17-
command-scope `GIT_CONFIG_*` environment entries. No config files are
18-
touched, and caller-provided `GIT_CONFIG_*` entries (including the previously
19-
documented workaround) are preserved. The same mismatch broke git-based
20-
repository/branch/commit and default-branch discovery in local Docker runs;
21-
those lookups are covered by the same change.
22-
- A failed `changed_files` diff resolution is no longer indistinguishable from
23-
an empty diff. Git errors are captured and logged instead of discarded, and
24-
when the scope cannot be resolved — unreadable repository, unresolvable base
25-
ref, or `pr` mode with no base ref — Socket Basics now **fails with a
26-
configuration error** rather than reporting a green run that scanned nothing.
27-
Shallow checkouts get a more specific error naming `fetch-depth: 0`. A
28-
genuinely empty diff (e.g. a delete-only PR) is a successful resolution and
29-
still skips the scanners as before.
11+
## [3.1.0] - 2026-09-02
3012

3113
### Added
32-
- The resolved `changed_files` scope is now logged on every scoped run: file
33-
count at INFO, the full file list at DEBUG — so an empty diff and a failed
34-
lookup are visible and distinguishable in run logs.
35-
- `scan_all` is now a declared action input and doubles as the fail-open escape
14+
- `pr_comment_enabled` (default `true`): set to `false` to run scans without
15+
posting or updating the pull request comment. Findings still reach the Socket
16+
dashboard, since the facts upload runs before any notifier. (#97)
17+
- `pr_comment_collapse_all` (default `false`): starts the collapsible OpenGrep
18+
(SAST) and Socket Tier 1 sections collapsed, including critical findings.
19+
Flat-table outputs (TruffleHog, Trivy Dockerfile) are unaffected. (#97)
20+
- Negative `--no-*` forms for every default-true boolean CLI flag, e.g.
21+
`--no-pr-comment`. (#97)
22+
- The resolved `changed_files` scope is logged on every scoped run — file count
23+
at INFO, full list at DEBUG — so an empty diff and a failed lookup are
24+
distinguishable in run logs. (#105)
25+
- `scan_all` is now a declared action input, and doubles as the fail-open escape
3626
hatch for `changed_files`: when the scope cannot be resolved, widen to a
37-
full-repo scan with a warning instead of failing. Every enabled scanner
38-
widens consistently on that failure path. A successfully resolved scope
39-
remains authoritative, including a genuinely empty diff, which still skips
40-
scoped scanners.
27+
full-repo scan with a warning instead of failing. Every enabled scanner widens
28+
consistently on that path. (#98, #105)
29+
30+
### Changed
31+
- **Behavioral:** a `changed_files` scope that cannot be resolved (unreadable
32+
repository, missing base ref, shallow checkout with no base) now **fails the
33+
run** with a configuration error instead of scanning. Previously this exited
34+
green having scanned nothing. Pipelines with a broken diff-only setup will
35+
start failing on the first run after upgrading — read the error, which names
36+
the underlying git problem. Set `scan_all` to widen instead of failing.
37+
(#98, #105)
38+
- A successfully resolved `changed_files` scope is now authoritative over
39+
`scan_all`, which previously overrode it. `scan_all` applies only on the
40+
failure path. A genuinely empty diff (e.g. a delete-only PR) still skips the
41+
scoped scanners. (#98)
42+
- Socket toolchain refresh: Socket npm CLI 1.1.154 → 1.1.165 in every image,
43+
and Socket Python CLI 2.6.3 → 2.7.0 in the heavy and app-tests images. The
44+
socketdev Python SDK is already current at 3.5.0.
45+
- Notifier parameters from `notifications.yaml` now take CLI overrides through
46+
the same path as connector parameters, fixing flags that parsed but never
47+
reached the effective config. Absent boolean flags resolve to "unset" rather
48+
than `false`, so CLI defaults no longer clobber environment, JSON, or
49+
dashboard config. (#97)
50+
51+
### Fixed
52+
- `changed_files` diff-only mode resolved to zero files on every run of the
53+
pre-built Docker action, so scans exited green having scanned nothing: the
54+
container runs as root over a runner-owned checkout, and git refuses to read a
55+
repository it does not own. Git subprocesses now mark the workspace
56+
`safe.directory` via command-scope `GIT_CONFIG_*` entries, and any
57+
caller-supplied `GIT_CONFIG_*` entries are preserved. The same mismatch broke
58+
git-based repository, branch, and commit discovery in local Docker runs. (#105)
59+
- `changed_files` was only resolved for CLI-built configs, so environment, JSON,
60+
and dashboard configs silently scanned the whole repository, and a literal
61+
`"auto"` was iterated character by character into an empty scope. Every config
62+
source now runs through one resolver. (#98)
63+
- Pull request base detection falls back to `pull_request.base.sha`/`.ref` from
64+
the event payload when `GITHUB_BASE_REF` is unset, covering
65+
`pull_request_target`, `pull_request_review` and `pull_request_review_comment`.
66+
`issue_comment` carries no usable base and now warns to pass `GITHUB_BASE_REF`
67+
from the workflow. (#98)
68+
- TruffleHog and Trivy no longer substitute their own staged-file scope when an
69+
explicit `changed_files` request is in effect. Trivy's Dockerfile scan skips
70+
when no Dockerfile changed, and TruffleHog drops changed paths that no longer
71+
exist on disk. (#98)
72+
73+
### Internal
74+
- core-tool-watch reconciles one canonical `core-tool-drift` issue on `main`
75+
pushes, tracks the Socket Python and npm CLIs plus `Dockerfile.heavy`, and
76+
reads Trivy releases from `ghcr.io/socketdev/trivy`. The npm `socket` CLI is
77+
pinned in every image, and Docker publish no longer authors a GitHub
78+
Release. (#104)
79+
- Release prep keeps action and image references in README and `docs/**` in sync
80+
with the release version; 73 stale `2.0.3` references normalized. (#106)
81+
- Dependency updates: pyyaml (#107), docker/setup-buildx-action (#108).
82+
- app-tests image refreshes `socketsecurity` index metadata on install, so a
83+
stale cached index cannot make a freshly published pin look nonexistent.
4184

4285
## [3.0.0] - 2026-08-06
4386

‎Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ARG UV_VERSION=0.12.1
99
#
1010
# NOT Dependabot-trackable (no official Docker image with a stable binary path):
1111
ARG OPENGREP_VERSION=v1.26.0
12-
ARG SOCKET_NPM_CLI_VERSION=1.1.154
12+
ARG SOCKET_NPM_CLI_VERSION=1.1.165
1313
#
1414
# NOT Dependabot-trackable — Socket-built Trivy, rebuilt from unmodified upstream
1515
# source and published by Socket's own release pipeline. Pinned by digest; both

‎Dockerfile.heavy‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ ARG PYTHON_VERSION=3.12
33
ARG TRUFFLEHOG_VERSION=3.96.0
44
ARG UV_VERSION=0.12.1
55
ARG OPENGREP_VERSION=v1.26.0
6-
ARG SOCKET_NPM_CLI_VERSION=1.1.154
7-
ARG SOCKET_PYTHON_CLI_VERSION=2.6.3
6+
ARG SOCKET_NPM_CLI_VERSION=1.1.165
7+
ARG SOCKET_PYTHON_CLI_VERSION=2.7.0
88
# Socket-built Trivy, pinned by digest — see the note in ./Dockerfile.
99
ARG TRIVY_IMAGE=ghcr.io/socketdev/trivy:0.73.0@sha256:e3d9d5f10250cb73b0ea9446ae1191c0f2da2f5e6173eac08a840b1812f02e0b
1010

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Run Socket Basics
3636
# Pin to a commit SHA for supply-chain safety.
3737
# Dependabot will keep this up to date automatically — see docs/github-action.md.
38-
uses: SocketDev/socket-basics@<sha> # v3.0.0
38+
uses: SocketDev/socket-basics@<sha> # v3.1.0
3939
env:
4040
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
4141
with:
@@ -179,10 +179,10 @@ For GitHub Actions, see the [Quick Start](#-quick-start---github-actions) above
179179

180180
```bash
181181
# Pull the pre-built image (recommended — no build step required)
182-
docker pull ghcr.io/socketdev/socket-basics:3.0.0
182+
docker pull ghcr.io/socketdev/socket-basics:3.1.0
183183
184184
# Run scan
185-
docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.0.0 \
185+
docker run --rm -v "$PWD:/workspace" ghcr.io/socketdev/socket-basics:3.1.0 \
186186
--workspace /workspace \
187187
--python-sast-enabled \
188188
--secret-scanning-enabled \

‎action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: "Socket"
44

55
runs:
66
using: "docker"
7-
image: "docker://ghcr.io/socketdev/socket-basics:3.0.0"
7+
image: "docker://ghcr.io/socketdev/socket-basics:3.1.0"
88
env:
99
# Core GitHub variables (these are automatically available, but we explicitly pass GITHUB_TOKEN)
1010
GITHUB_TOKEN: ${{ inputs.github_token }}

‎app_tests/Dockerfile‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ ARG UV_VERSION=0.12.1
1212
# NOT Dependabot-trackable (no official Docker image with a stable binary path):
1313
ARG GOSEC_VERSION=v2.28.0
1414
ARG OPENGREP_VERSION=v1.26.0
15-
ARG SOCKET_NPM_CLI_VERSION=1.1.154
16-
ARG SOCKET_PYTHON_CLI_VERSION=2.6.3
15+
ARG SOCKET_NPM_CLI_VERSION=1.1.165
16+
ARG SOCKET_PYTHON_CLI_VERSION=2.7.0
1717
#
1818
# NOT Dependabot-trackable — Socket-built Trivy, pinned by digest; updated by
1919
# Socket's trivy-dist release process. See the note in the root ./Dockerfile.
@@ -98,9 +98,15 @@ RUN --mount=type=cache,target=/root/.npm \
9898
# Bandit + socketsecurity via uv
9999
ENV UV_LINK_MODE=copy
100100
ARG SOCKET_PYTHON_CLI_VERSION
101+
# --refresh-package: this install pins an exact version, so a stale cached index
102+
# response makes a freshly published release look like it does not exist ("no
103+
# version of socketsecurity==X"). Refresh metadata for this one package rather
104+
# than passing --no-cache, which would discard the cache mount's benefit for
105+
# bandit and for already-built wheels.
101106
RUN --mount=type=cache,target=/root/.cache/uv \
102107
uv tool install bandit \
103-
&& uv tool install "socketsecurity==${SOCKET_PYTHON_CLI_VERSION}"
108+
&& uv tool install --refresh-package socketsecurity \
109+
"socketsecurity==${SOCKET_PYTHON_CLI_VERSION}"
104110
ENV PATH="/root/.local/bin:$PATH"
105111

106112
# NOTE: the legacy socket-security-tools runner (src/, entrypoint.sh) predates

0 commit comments

Comments
 (0)