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(test): unbreak main — give four get edge-case fixtures a real file for #158's guardrail by mikolalysenko · Pull Request #168 · SocketDev/socket-patch

Conversation

@mikolalysenko

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

Uh oh!

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

Copy link
Copy Markdown
Collaborator

Problem

Main is red. Merged PR #158 (5d7eb6f, "fix(get,scan): retain patch-added new files; guard empty patch records") added a correct guardrail: a fetched patch view whose files_for_manifest map is empty is now reported as a failure (patch has no applicable files, exit 1) instead of a silent applied:1. That guardrail is correct and stays.

But #158 only edited crates/socket-patch-cli/src/commands/get.rs and did not update four tests in crates/socket-patch-cli/tests/get_edge_cases_e2e.rs whose mock patch-view fixtures use "files": {} and assert the get succeeds (exit 0). Those four now fail on current main (4f58eec):

  • get_with_id_flag_selects_specific_patch
  • get_uuid_returns_paid_patch_with_token_succeeds
  • get_on_vendored_purl_warns_about_uuid_drift
  • get_uuid_replacing_existing_manifest_entry_reports_updated

cargo test -p socket-patch-cli --test get_edge_cases_e2e was 18 passed / 4 failed on main. These four are the entire breakage — the CI test, coverage, and test-release jobs all fail on exactly these.

Fix

Fix the stale fixtures, not the guardrail. Each of these tests' real concern is selection / paid-token / drift-warning / manifest-replacement logic — the empty "files": {} was only ever a lazy stand-in, never "a patch with zero files". Each view fixture now carries one recordable net-new file (all-zero beforeHash, a real git-blob afterHash computed via the shared common::git_sha256 oracle, matching base64 blobContent), modeled on the passing get_invariants::patch_response_json fixture. This makes files_for_manifest non-empty so the guard passes. Introduced via one small single_file_view() helper reused by all four. Every existing assertion is unchanged (found == 1, the selected UUID, the drift warning naming both UUIDs, the updated action + oldUuid, the manifest actually moving to the new UUID). get.rs and the guardrail are untouched. The seed manifest's old-UUID "files": {} in the replacement test is deliberately left as-is — it is pre-existing state, never fetched or applied, so the guard does not touch it.

Test

  • cargo test -p socket-patch-cli --test get_edge_cases_e2e → 22/22 (was 18/4).
  • cargo test -p socket-patch-cli --lib → 350 passed, unaffected.
  • cargo test -p socket-patch-cli --test get_invariants --test get_update_summary_e2e → 15 passed, unaffected.
  • cargo build -p socket-patch-cli clean.

Scope

One file, crates/socket-patch-cli/tests/get_edge_cases_e2e.rs (+29/-4). No production code, no guardrail change, no other suite needed touching.

This PR unbreaks main and should be merged before the other open fix/* PRs. Those PRs carry stale-green CI (they branched before #158 landed the guardrail); once rebased onto current main they will inherit this same 4-test failure until this fix is in.

🤖 Generated with Claude Code


Note

Low Risk
Test-only fixture updates in one e2e file; no production or guardrail changes.

Overview
Restores four failing get_edge_cases_e2e tests on main after PR #158 made empty patch files maps fail with "patch has no applicable files" instead of succeeding silently.

Adds a shared single_file_view() helper that returns one net-new file (beforeHash all zeros, matching afterHash / base64 blob via common::git_sha256), aligned with the passing get_invariants fixture. Four mock patch-view responses swap "files": {} for single_file_view() so files_for_manifest is non-empty under --save-only. Production get.rs and the guardrail are unchanged; assertions still target --id selection, paid-token fetch, vendored UUID drift warnings, and manifest updated / oldUuid behavior.

Reviewed by Cursor Bugbot for commit 73c16dd. Configure here.

Sorry, something went wrong.

Uh oh!

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

All reactions
@mikolalysenko @claude
fix(test): give four get edge-case fixtures a real file so #158's gua…
73c16dd
…rd passes

Merged PR #158 (5d7eb6f, "fix(get,scan): retain patch-added new files;
guard empty patch records") added a correct guardrail: a fetched patch
view whose `files_for_manifest` map is EMPTY is now an exit-1 failure
("patch has no applicable files") instead of a silent `applied:1`. But
#158 only touched get.rs and left four tests in get_edge_cases_e2e.rs
carrying stale `"files": {}` patch-view fixtures that still assert the
`get` succeeds (exit 0). Those four now fail on main:

  - get_with_id_flag_selects_specific_patch
  - get_uuid_returns_paid_patch_with_token_succeeds
  - get_on_vendored_purl_warns_about_uuid_drift
  - get_uuid_replacing_existing_manifest_entry_reports_updated

Their real concern is selection / paid-token / drift-warning /
manifest-replacement logic, not "a patch with zero files" — the empty
map was only a lazy stand-in. Give each view fixture one recordable
net-new file (all-zero `beforeHash`, real git-blob `afterHash` via the
shared `common::git_sha256` oracle, matching base64 `blobContent`),
modeled on the passing `get_invariants::patch_response_json` fixture, so
`files_for_manifest` is non-empty and the guard is satisfied. Every
existing assertion (found==1, selected UUID, drift warning, `updated`
reporting + `oldUuid`, manifest move) is unchanged. The guardrail in
get.rs is untouched.

get_edge_cases_e2e now 22/22; lib (350) and get_invariants /
get_update_summary (15) unaffected.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge (squash) August 13, 2026 17:43
@mikolalysenko @claude
fix(test): repair telemetry_e2e fixture broken by #158 empty-files gu…
28af3a0
…ardrail

Same root cause as this PR's get_edge_cases_e2e fixes: #158's guardrail
(empty applicable-files map -> "patch has no applicable files", exit 1)
broke get_emits_patch_fetched_telemetry_on_uuid_lookup_success, whose mock
patch-view used "files": {} while asserting a successful get. Give it a
recordable new-file entry (afterHash = git-blob sha256 of the decoded blob)
so the success + telemetry assertions hold; guardrail untouched. Verified
with a full `cargo test --workspace --no-fail-fast` pass that these two
binaries held the only 5 casualties, now all green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Wenxin-Jiang
Wenxin Jiang (Wenxin-Jiang) approved these changes Aug 13, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit b109645 into main Aug 13, 2026
100 of 101 checks passed

Uh oh!

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

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the fix/get-edge-cases-empty-files-fixtures branch August 13, 2026 18:36
Mikola Lysenko (mikolalysenko) added a commit that referenced this pull request Aug 13, 2026
@mikolalysenko
Merge origin/main (pick up #168: get edge-case fixtures gain a real f…
c2b09b0
…ile for #158's empty-record guard)
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.