Skip to content

Commit 800836c

Browse files
committed
Trim the changelog entry and the comments it duplicated
Cut the 2.9.7 section to two bullets: what a user of a patch release needs is the behavior they will see, not the mechanism behind it. Reword the comments the entry was echoing so each states a present-tense invariant, and name the same three statuses in both the cap's rationale and the upload path rather than two overlapping subsets.
1 parent 392935d commit 800836c

3 files changed

Lines changed: 15 additions & 32 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,13 @@
22

33
## 2.9.7
44

5-
### Fixed: cap the commit message read from the local checkout
6-
7-
- `commit_message` travels in the query string of the full scan request, so an
8-
oversized value overflows the edge proxy's request line limit and the scan
9-
fails with HTTP 431 before reaching the API. The 200-character cap already
10-
applied to `--commit-message`, but a run that omitted the flag backfilled the
11-
value straight from the checkout's HEAD commit, uncapped. Repositories whose
12-
commit messages carry generated release notes could not be scanned at all.
13-
- The cap is now an invariant of the parsed configuration and is applied to the
14-
git-derived value as well, so every source of `commit_message` lands under the
15-
limit.
16-
- A truncated message now ends in `...` and the notice is logged at INFO instead
17-
of DEBUG, so a clipped message in the dashboard is explained by the CI log of
18-
the run that produced it. The 200-character ceiling is unchanged; the marker
19-
replaces the tail rather than extending past it.
20-
21-
### Changed: name the cause when a full scan request is refused for its size
22-
23-
- Scan metadata travels in the query string of the full scan request, so an
24-
oversized value is refused by the proxy in front of the API, which reports 413,
25-
414 or 431 depending on which limit it checks. Those responses previously
26-
surfaced as the SDK's generic status-code error carrying the proxy's response
27-
body. They now name the cause and the flag to change, and remain unretried.
5+
### Fixed: oversized commit messages no longer fail the scan
6+
7+
- The 200-character cap on the commit message now applies to the value read from the
8+
repository, not only to `--commit-message`. A truncated message ends in `...` and the
9+
truncation is reported at INFO.
10+
- A full scan refused for its size (HTTP 413, 414 or 431) now reports which value to
11+
shorten.
2812

2913
## 2.9.6
3014

‎socketsecurity/config.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_plugin_config_from_env(prefix: str) -> dict:
2222
# commit_message rides in the query string of POST /v0/orgs/{org}/full-scans, so an
2323
# oversized message overflows the edge proxy's request line limit before the API ever
2424
# sees it. The API itself has no length validation on the field; the rejection comes
25-
# from the proxy, reported as either 413 or 431 depending on which one answers. 200
25+
# from the proxy, which reports 413, 414 or 431 depending on which limit it checks. 200
2626
# chars is a conservative ceiling given URL encoding can 2-3x the raw character count.
2727
MAX_COMMIT_MESSAGE_LENGTH = 200
2828

@@ -33,9 +33,9 @@ def get_plugin_config_from_env(prefix: str) -> dict:
3333
def truncate_commit_message(commit_message: Optional[str]) -> Optional[str]:
3434
"""Cap commit_message to a length the full-scan request line can carry."""
3535
if commit_message and len(commit_message) > MAX_COMMIT_MESSAGE_LENGTH:
36-
# Logged at INFO rather than DEBUG: the scan record keeps the truncated value, and
37-
# a CI job that never passes --enable-debug would otherwise have no way to tell why
38-
# the message in the dashboard is clipped.
36+
# INFO, not DEBUG: the scan keeps the truncated value, so for a CI job that does
37+
# not pass --enable-debug this line is the only explanation of why the message in
38+
# the dashboard is clipped.
3939
logging.info(
4040
f"commit_message truncated from {len(commit_message)} to "
4141
f"{MAX_COMMIT_MESSAGE_LENGTH} characters to stay within API request size limits"
@@ -229,9 +229,9 @@ class CliConfig:
229229
config_file: Optional[str] = None
230230

231231
def __post_init__(self):
232-
# Capped here rather than at the flag-parsing site so that every source of
233-
# commit_message (the --commit-message flag, a config file, the git backfill in
234-
# socketcli) lands under the limit.
232+
# Capped on construction so that every source of commit_message -- the
233+
# --commit-message flag, a config file, the git backfill in socketcli -- lands
234+
# under the limit.
235235
self.commit_message = truncate_commit_message(self.commit_message)
236236

237237
@classmethod

‎socketsecurity/socketcli.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ def apply_git_context(config: CliConfig) -> Tuple[bool, Optional[Git]]:
234234
if not config.committers:
235235
config.committers = [git_repo.get_formatted_committer()]
236236
if not config.commit_message:
237-
# Capped like the flag-supplied value: a repository's own commit message is
238-
# unbounded, and it ships in the full-scan query string.
237+
# A repository's commit message is unbounded and ships in the query string.
239238
config.commit_message = truncate_commit_message(git_repo.commit_message)
240239
return True, git_repo
241240

0 commit comments

Comments
 (0)