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 — Serve the rollback blob from the bun.lockb mock (#1905) · SocketDev/socket-patch@0995cba

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • crates/socket-patch-cli/tests
    • e2e_bun_lockb.rs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎crates/socket-patch-cli/tests/e2e_bun_lockb.rs‎

Copy file name to clipboardExpand all lines: crates/socket-patch-cli/tests/e2e_bun_lockb.rs
+31-1Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,24 @@ fn rollback_refuses_binary_hosted_pin_then_checkout(
144144
) {
145145
let hosted_lock = fixture.lock();
146146
let uri = server.uri();
147+
// `--api-url`: the agent leg downloads before-blobs through the patch
148+
// API, which `--patch-server-url` does not redirect; without it the
149+
// run reached the live public proxy and the outcome depended on
150+
// whether that served minimist's original `index.js` blob.
147151
let (code, env) = cli_code(
148152
&fixture.project,
149-
&["rollback", "--yes", "--patch-server-url", &uri],
153+
&[
154+
"rollback",
155+
"--yes",
156+
"--api-url",
157+
&uri,
158+
"--api-token",
159+
"fake",
160+
"--org",
161+
ORG,
162+
"--patch-server-url",
163+
&uri,
164+
],
150165
);
151166
assert_eq!(code, 1, "a binary hosted pin cannot be restored: {env}");
152167
// The refused pin counts as a failure (#1066). After a takeover a
@@ -874,6 +889,21 @@ async fn mock_api_patch(server: &MockServer, fixture: &Fixture, uuid: &str, patc
874889
)
875890
.mount(server)
876891
.await;
892+
// The original `index.js` blob. `rollback`'s missing-blob gate
893+
// downloads it when an installed copy matches neither patch hash (the
894+
// `bundled` shape's untouched nested minimist); see
895+
// `rollback_refuses_binary_hosted_pin_then_checkout`.
896+
Mock::given(method("GET"))
897+
.and(path(format!(
898+
"/v0/orgs/{ORG}/patches/blob/{}",
899+
compute_git_sha256_from_bytes(&fixture.original)
900+
)))
901+
.respond_with(
902+
ResponseTemplate::new(200)
903+
.set_body_raw(fixture.original.clone(), "application/octet-stream"),
904+
)
905+
.mount(server)
906+
.await;
877907
Mock::given(method("GET"))
878908
.and(path_regex(format!("^/patch/npm/{name}/.*$")))
879909
.respond_with(ResponseTemplate::new(200).set_body_raw(tgz, "application/octet-stream"))

0 commit comments

Comments
0 (0)
You are visitor 01402520 — 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.