Repository navigation
Conversation
--repo was documented as owner/repo, but the value is sent as the repository slug, which the API validates against [a-zA-Z0-9._-]+. Following the help text failed every scan, at repository creation or full-scan creation. Describe the slug in the help text and docs, and exit 1 up front when --repo contains "/", naming the slug to use. --pending-head was parsed and never read: set_as_pending_head follows is_default_branch. Keep accepting it so existing pipelines still parse, but hide it from --help and log a deprecation warning pointing at --default-branch. Also fix the docs examples that taught owner/repo: the GitLab CI example ($CI_PROJECT_PATH -> $CI_PROJECT_NAME) and the Slack repos filter, which is matched against the bare slug. Bump to 2.11.12.
owner/repo in --repo and deprecate --pending-head
owner/repo in --repo and deprecate --pending-headowner/repo in --repo, deprecate --pending-head
The changelog is user-facing, so it states the new behavior and leaves the background to the PR description.
Manifest links in GitHub, GitLab and Bitbucket comments were built as
{server}/{config.repo}/blob/..., but config.repo is the Socket repository
slug, which has no owner, so every link pointed at a path that doesn't
exist. The ignore telemetry's owner field split config.repo on "/" and
was always empty for the same reason.
Resolve the repository's web URL once, from the CI environment and then
the checkout's origin remote, reusing the lookups the pull request URL
already does. Manifest links and the telemetry owner use it, and links
fall back to the Socket report when it can't be resolved.
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 800fde7. Configure here.
Phil Gran (philgran)
approved these changes
Nov 6, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two flags documented behavior they don't have, and PR comment links were built from the same bare
--repovalue as if it wereowner/repo.Root Cause
--repo. The help text, metavar anddocs/cli-reference.mdall saidowner/repo. The CLI sends the value as-is as the repository slug, which the API validates against^[a-zA-Z0-9._-]+$, so any value with a/fails. Auto-detection (git remote,GITHUB_REPOSITORY) already produces the bare name, which hid the bug. Only an explicit--repo owner/repo, which is what the help text told people to pass, failed. In diff mode it fails at repository creation: before 2.11.10 that was a silent exit 2, and now it logs an HTTP 400.--pending-head. The flag is parsed intoconfig.pending_headand never read.set_as_pending_headfollowsis_default_branch, so the flag has no effect, and the docs said the two were "automatically synchronized".Fix
--repo:<repo>, and the help text describes the slug without the owner and points to--workspacefor the owner.CliConfig.from_argsexits1up front when--repocontains/, naming the slug to use (the last path segment, the same value auto-detection would produce).--pending-head:--pending_headalias, so existing pipelines don't hit an argparse error.--help, and it logs a deprecation warning pointing to--default-branch.--default-branchalready covers.docs/cli-reference.md):--repotable row and the four--repo owner/repoexamples now use a bare slug.$CI_PROJECT_NAME.$CI_PROJECT_PATHisgroup/projectand would now be rejected; before this change it failed at the API.reposfilter example usedowner/repo, but the filter is matched against the bareconfig.repo, so the documented form never matched anything.--pending-headrow, its usage-line entry and the "automatically synchronized" sentence are replaced with the deprecation note.TestRepoAndPendingHeadFlagstests intests/unit/test_config.py; 6 of the 7 fail onmain.owner/repo-style values as fixtures, and now use a bare slug. FOSSA mode creates a full scan the same way, so those values couldn't have worked against the API either.Manifest links in PR comments.
core/messages.pybuilt GitHub, GitLab and Bitbucket file links as{server}/{config.repo}/blob/....config.repois always the bare slug (with a suffix under--workspace-name), so every link pointed atgithub.com/<repo>/blob/...with no owner. Theownerfield in the ignore telemetry splitconfig.repoon/and was always"".resolve_repository_url()incore/pull_request.pyreturns the repository's web URL. It reads the CI environment first (GITHUB_REPOSITORYandGITHUB_SERVER_URL,CI_PROJECT_URLorCI_PROJECT_PATH,BITBUCKET_REPO_FULL_NAME), then the checkout'soriginremote. It reuses the lookups the PR URL already does;_github_urland_gitlab_urlnow call the same helpers.main_coderesolves it once intoconfig.repository_url. Manifest links use it, and fall back to the Socket report link when it can't be resolved, instead of building a broken link.owneris the URL path before the repository name: the owner on GitHub and Bitbucket, and the group path on GitLab.https://user:token@host/...remote are never used; only the host and path are kept.Testing
uv run pytest tests/unit tests/core: 753 passed.ruff checkis clean anduv lock --lockedis in sync.socketcli --api-token dummy --repo my-org/my-repoexits1with:--repo takes the repository slug without its owner, but got 'my-org/my-repo'. Use --repo my-repo, and --workspace for the owner if your repositories use one.socketcli --helpshows--repo <repo>with the new text and no--pending-head.origin,resolve_repository_url("github", ...)returnshttps://github.com/SocketDev/socket-python-cli, with ownerSocketDev.Fixes CE-490
Fixes CE-491
Refs CE-127
Public Changelog
--repotakes the repository slug (my-repo), notowner/repo. The CLI now explains this up front instead of failing at the API, and the docs examples are fixed.--pending-headis deprecated: it never had an effect, and it now logs a warning pointing to--default-branch. Manifest links in pull request comments now include the repository owner.Note
Medium Risk
Changes CLI flag validation and PR comment URLs used in CI; pipelines that passed
owner/repoto--repowill now exit 1 (previously failed at the API), while manifest links and telemetry owner fields behave differently whenrepository_urlis resolved.Overview
Release 2.11.12 aligns
--repowith what the Socket API actually accepts and fixes broken SCM links in PR comments that were built from the bare repo slug.--repois now a Socket repository slug only (my-repo, notmy-org/my-repo). Values containing/fail fast at exit code1with a suggested slug and a pointer to--workspacefor the owner. Help, docs, and examples (including GitLab CI--repo $CI_PROJECT_NAME) are updated accordingly.--pending-headis deprecated: still parsed for backward compatibility, hidden from--help, logs a warning, and remains a no-op—use--default-branchinstead.Manifest links in GitHub/GitLab/Bitbucket PR comments no longer use
{server}/{config.repo}/blob/.... The CLI resolvesconfig.repository_urlfrom CI env vars ororigin, builds correct blob/src URLs, and falls back to the Socket report when the owner cannot be determined. Ignore telemetryownernow comes from that URL path viarepository_owner(), not from splitting--repo.Unit tests cover the new validation, deprecation, URL resolution, and FOSSA fixtures now use bare slugs.
Reviewed by Cursor Bugbot for commit 800fde7. Configure here.