Skip to content

chore: remove dead --download-mode package - #223

Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
cleanup/dead-package-mode-and-before-blobs
Open

chore: remove dead --download-mode package#223
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
cleanup/dead-package-mode-and-before-blobs

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-fable-5

Cleanup from the 2026-08-19 patches-api-proxy architecture review (depscan side landed as SocketDev/depscan#24484).

What

--download-mode package targeted GET /patch/package/<uuid> on the public proxy and GET /v0/orgs/<slug>/patches/package/<uuid> authenticated — routes no deployed server serves (the proxy's catch-all 400s the GET, api-v0's package surface is POST-only, and depscan e2e test 80 explicitly pins the route's absence). Every package-mode archive fetch failed per-UUID and then silently degraded to per-file blob downloads — slower, noisier, and never what the flag promised.

  • DownloadMode::Package, ArchiveKind (archive fetch collapsed to diff-only), and ApiClient::fetch_package are gone.
  • --download-mode package / SOCKET_DOWNLOAD_MODE=package now fails fast with a targeted removal notice (download mode 'package' was removed; use diff or file) instead of degrading — distinct from the generic unknown-mode error.
  • The POST /patch/package vendor-service flow (vendor_package_url) is unrelated and untouched.
  • The local .socket/packages/ read path in the apply pipeline is intentionally untouched: pre-staged archives still apply; only the download mode that could never populate that directory is removed.
  • README + --help text updated; tests now pin the removal error, and the repair lifecycle test asserts package mode hard-fails without ever hitting the package archive route.

What was deliberately NOT removed

The review also flagged before_blob_content / include_before_blobs as dead end-to-end (no production caller sends the query param, so the server never populates the field). I started removing it and backed out: a dozen in-process suites (gem multi-platform rollback, pypi multi-release, get manifest flows) deliberately exercise the rollback pre-cache design built on inline before-blobs — the plumbing is load-bearing in the CLI's rollback semantics, just unreachable in prod because nothing triggers the server side. Making it live (send include_before_blobs=true on the authenticated get path) is a product/payload-size decision, not cleanup — left for a separate call.

Validation

cargo build --workspace --all-targets clean; full cargo test --workspace green (2404 core lib tests + all e2e/in-process suites, zero failures).

🤖 Generated with Claude Code


Note

Medium Risk
Changes patch artifact download behavior and telemetry endpoint resolution for on-prem --api-url runs; scope is CLI/core fetch paths with broad test updates, not auth or data persistence.

Overview
Removes --download-mode package / SOCKET_DOWNLOAD_MODE=package as a supported artifact fetch path. The mode targeted GET package-archive routes that no deployed server serves, so runs always failed per patch and fell back to per-file blobs. DownloadMode::Package, ApiClient::fetch_package, and the package-archive download branch in fetch_missing_sources are deleted; diff and file remain. Choosing package now fails at DownloadMode::parse with an explicit removal message instead of degrading silently.

Docs and help text now describe only diff (default) and file. repair, fetch_stage, and tests are aligned with the two-mode model; repair hard-fails package mode before any network I/O.

apply_env_toggles now mirrors non-empty --api-url / --proxy-url into SOCKET_API_URL / SOCKET_PROXY_URL so telemetry (which reads env only) does not POST to the default api.socket.dev when the operator set an on-prem base. API token and org are still not mirrored to avoid leaking secrets into child processes. The previously ignored regression test for this mirror is enabled.

Local reads of pre-staged .socket/packages/ archives in the apply pipeline are intentionally unchanged; only the dead download mode is removed.

Reviewed by Cursor Bugbot for commit 92c2b3c. Configure here.

The mode built GET /patch/package/<uuid> (proxy) or GET
/v0/orgs/<slug>/patches/package/<uuid> (authenticated) — routes no
deployed server has served since the on-demand package flow was
dropped (depscan e2e test 80 pins their absence). Every package-mode
fetch failed per-UUID and silently degraded to per-file blob
downloads: slower, noisier, and never what the flag promised.

Now `--download-mode package` / `SOCKET_DOWNLOAD_MODE=package` fails
fast with a removal notice instead of degrading. The local
`.socket/packages/` read path in the apply pipeline is intentionally
untouched — pre-staged archives still apply.

Removed: DownloadMode::Package, ArchiveKind (collapsed to diff-only
fetch), ApiClient::fetch_package. Tests updated to pin the removal
error and that repair in package mode hard-fails without touching the
package archive route.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant