Skip to content

Commit 3075ac0

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/strict-blocking-keep-each-existing-advisory
2 parents 132b514 + b398288 commit 3075ac0

6 files changed

Lines changed: 38 additions & 17 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 2.13.1
3+
## 2.13.2
44

55
### Fixed
66

@@ -18,6 +18,20 @@
1818
applies to existing alerts in the `--enable-gitlab-security` and
1919
`--legal-format fossa` output.
2020

21+
### Changed: bump the Socket Python SDK to 3.6.4
22+
23+
- Bumped the pinned Socket Python SDK (`socketdev`) from `3.6.3` to `3.6.4`.
24+
The release keeps each advisory as its own alert instead of one per alert
25+
type and severity, which changes what the CLI reports; see Fixed above.
26+
27+
### Changed
28+
29+
- Manifest file links in PR comments and reports pick the source host only from
30+
`--scm`. The fallback that guessed GitHub, GitLab, or Bitbucket from the Socket
31+
diff URL never produced a link and has been removed.
32+
33+
## 2.13.1
34+
2135
### Documentation
2236

2337
- New [API token permissions](docs/troubleshooting.md#api-token-permissions) guide:
@@ -33,9 +47,6 @@
3347
- Bumped the pinned Socket Python SDK (`socketdev`) from `3.6.2` to `3.6.3`.
3448
The release fixes `settings.integration_events()`, which the CLI does not
3549
call, so CLI behavior is unchanged.
36-
- Bumped it again, to `3.6.4`, which keeps each advisory as its own alert
37-
instead of one per alert type and severity. Unlike `3.6.3`, this changes what
38-
the CLI reports; see Fixed above.
3950

4051
## 2.13.0
4152

‎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.13.1"
9+
version = "2.13.2"
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,4 +1,4 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.13.1'
2+
__version__ = '2.13.2'
33
USER_AGENT_NAME = 'socket-python-cli'
44
USER_AGENT = f'{USER_AGENT_NAME}/{__version__}'

‎socketsecurity/core/messages.py‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,10 @@ def get_manifest_file_url(diff: Diff, manifest_path: str, config=None) -> str:
7878
# Remove leading slashes
7979
clean_path = clean_path.lstrip('/')
8080

81-
# Determine SCM type from config or diff_url
82-
scm_type = "api" # Default to API
81+
# diff.diff_url points at Socket, not the SCM, so only config decides.
82+
scm_type = "api"
8383
if config and hasattr(config, 'scm'):
8484
scm_type = config.scm.lower()
85-
elif hasattr(diff, 'diff_url') and diff.diff_url:
86-
diff_url = diff.diff_url.lower()
87-
if 'github.com' in diff_url or 'github' in diff_url:
88-
scm_type = "github"
89-
elif 'gitlab' in diff_url:
90-
scm_type = "gitlab"
91-
elif 'bitbucket' in diff_url:
92-
scm_type = "bitbucket"
9385

9486
# Generate URL based on SCM type using config information
9587
# NEVER use diff.diff_url for SCM URLs - those are Socket URLs for "View report" links

‎tests/unit/test_messages.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,21 @@ def test_manifest_link_falls_back_to_the_report_without_a_repository_url():
102102
url = Messages.get_manifest_file_url(diff, "app/package.json", config)
103103

104104
assert url == "https://socket.dev/report/123?tab=files&file=app%2Fpackage.json"
105+
106+
107+
108+
def test_manifest_link_does_not_guess_the_scm_from_the_diff_url():
109+
"""Without an explicit scm, a GitHub-looking diff_url falls back to the report."""
110+
111+
class _NoScmConfig:
112+
branch = "main"
113+
repository_url = "https://github.com/acme/widgets"
114+
115+
diff = Diff(
116+
diff_url="https://github.com/acme/widgets/pull/1",
117+
report_url="https://socket.dev/report/123",
118+
)
119+
120+
url = Messages.get_manifest_file_url(diff, "app/package.json", _NoScmConfig())
121+
122+
assert url == "https://socket.dev/report/123?tab=files&file=app%2Fpackage.json"

‎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)