GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(scan): honor --vendor-source in the vendored flow by mikolalysenko · Pull Request #160 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Aug 12, 2026 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Problem

scan --mode vendored (default) and the standalone vendor command default to DIFFERENT vendor-sources, producing DIFFERENT committed bytes / lock integrity for the same patch.

  • crates/socket-patch-cli/src/commands/scan/vendor_flow.rs unconditionally passed service = None to vendor_records (build-only), and --vendor-source (a GLOBAL flag) was parsed but silently ignored by scan.
  • crates/socket-patch-cli/src/commands/vendor.rs:292 builds a VendorServiceConfig from --vendor-source (default auto = service download).

Confirmed against real prod ([email protected] / patch 80630680): scan --mode vendored produced tarball sha256 d5050fe… + lock integrity sha512-N1gyz3… (== vendor --vendor-source build), while plain vendor produced sha256 607e4e3… + sha512-YzCNS0… (== vendor --vendor-source service). Both are deterministic, so committing a lock written by one entry point then running the other rewrites the integrity though nothing changed — lock churn / merge conflicts. (Content installs identically either way.)

Fix

Make scan --mode vendored build the SAME VendorServiceConfig the vendor command does and thread it through the vendored path, defaulting to the same default (auto/service).

  • New pure assembler scan_vendor_service_config (vendor_flow.rs) mirrors vendor::run's config construction (source from --vendor-source, plus --vendor-url / --patch-server-url / --offline).
  • run_scan_vendor_step (vendor_flow.rs) now builds the run-level client via get_api_client_with_overrides and passes Some(&service) into boxed_vendor_records (vendor_flow.rs:646), which forwards it to vendor_records instead of the hardcoded None. Dry runs short-circuit before this step, so no client is built in preview mode.

After the fix, scan --mode vendored and vendor produce byte-identical committed artifacts + lock integrity by default, and scan --mode vendored --vendor-source build matches vendor --vendor-source build.

Test

cargo test -p socket-patch-cli --lib service_config_tests — 4 hermetic tests in vendor_flow.rs asserting the vendored flow builds its service config FROM --vendor-source (not hardcoded None):

  • default_source_permits_service_like_vendor_command (regression: default auto must permit the service, matching vendor)
  • service_source_requires_service, build_source_never_uses_service, overrides_thread_through

Full commands::scan:: suite: 42 passed. cargo clippy -p socket-patch-cli --lib clean.

Scope

Touches only scan/vendor_flow.rs (config construction + threading) and a one-line stale doc comment on vendor_records' service param in vendor.rs. No signature changes to the JSON/interactive path or mod.rs, to minimize conflict surface with parallel PRs. The client is rebuilt in the vendored step (mirroring vendor::run) rather than threaded down from scan::run; a follow-up could thread the already-resolved client to avoid the second get_api_client_with_overrides call.

🤖 Generated with Claude Code


Note

Medium Risk
Changes how vendored artifacts are produced for scan (default shifts from local build to service-capable auto), which affects committed bytes and lockfiles but aligns scan with vendor and is covered by regression tests.

Overview
Fixes a parity bug where scan --mode vendored always vendored build-only (service = None) while the standalone vendor command honored --vendor-source (default auto, service download). The same patch could therefore produce different tarball hashes and lock integrity, causing lock churn when teams mixed entry points.

scan_vendor_service_config mirrors vendor::run: it assembles VendorServiceConfig from --vendor-source, --vendor-url, --patch-server-url, and --offline. run_scan_vendor_step resolves the API client via get_api_client_with_overrides, passes Some(&service) through boxed_vendor_records into vendor_records (dry runs still skip this path). Four hermetic unit tests lock in auto / service / build and override threading.

Reviewed by Cursor Bugbot for commit 8bab316. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge (squash) August 12, 2026 23:41
@mikolalysenko @claude
fix(scan): honor --vendor-source in the vendored flow
ab5b4a7
scan --mode vendored hardcoded service=None (build-only), while the
vendor command builds a VendorServiceConfig from --vendor-source
(default auto = service download). For the same patch the two entry
points committed different tarball bytes + lock integrity, so
committing a lock made by one then running the other rewrote the
integrity with nothing changed (lock churn / merge conflicts).

Build the same service config the vendor command builds inside
run_scan_vendor_step (respecting --vendor-source / --vendor-url /
--patch-server-url, defaulting to auto) and thread it through
boxed_vendor_records into vendor_records. scan --mode vendored and
vendor now produce byte-identical artifacts by default.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@mikolalysenko
Mikola Lysenko (mikolalysenko) force-pushed the fix/scan-honor-vendor-source branch from 8bab316 to ab5b4a7 Compare August 13, 2026 18:44
Wenxin-Jiang
Wenxin Jiang (Wenxin-Jiang) approved these changes Aug 13, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit e15a676 into main Aug 13, 2026
62 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the fix/scan-honor-vendor-source branch August 13, 2026 21:22
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Aug 14, 2026
fix(gem): bundler vendored+hosted audit — 13 confirmed bugs fixed, tests hardened #175
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Wenxin-Jiang Wenxin Jiang (Wenxin-Jiang) Wenxin-Jiang approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mikolalysenko @Wenxin-Jiang
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.