Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1zu7inoki4 is past its budget: trevato/forge: "whether a snapshot is encrypted before it leaves is a setting, and the status says which > by default t… #12687

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The snapshot test "by default the destination is written as it always was: plain…" no longer depends on the proxy variables in the environment where it runs. I did not reproduce the failure itself. I have not seen the forge's check run on this push.

Notes

shipped production is serving it deploy dd33527

opened this

The snapshot test "by default the destination is written as it always was: plain…" no longer depends on the proxy variables in the environment where it runs. I did not reproduce the failure itself. I have not seen the forge's check run on this push.

Cause. The test sends its S3 traffic to a stub bucket on 127.0.0.1. When HTTPS_PROXY or HTTP_PROXY is set, as in a check cell or after another test leaves it set, Bun's S3 client goes through that proxy. The proxy then refuses with "127.0.0.1:… is a private destination". That is the error in the log, so I read the failure as environmental rather than a bug in the snapshot code.

Change.

  • test/helpers/stub-bucket.ts has a new bypassProxy(). It removes the proxy variables and returns a function that puts them back.
  • snapshot-repositories, snapshot-incremental and mirror-worker call it at file level and restore the variables in afterAll. These are the three tests that use that helper's stub bucket.

Checked.

  • tsc --noEmit is clean.
  • Those three test files pass: 36 tests.
  • snapshot-repositories also passes with HTTPS_PROXY and HTTP_PROXY set to a dead port (http://127.0.0.1:9).
  • I did not run bun scripts/gate.ts or bun scripts/fast.ts.

Left out.

  • I did not change the production S3 store, which is not at fault.
  • restore-drill-script.test.ts has its own stub bucket and I did not touch it.

Try it. Run HTTPS_PROXY=http://127.0.0.1:9 bun test test/snapshot-repositories.test.ts.

Closes #12634

commented

The snapshot test "by default the destination is written as it always was: plain…" no longer depends on the proxy variables in the environment where it runs. I did not reproduce the failure itself. I have not seen the forge's check run on this push.

Cause. The test sends its S3 traffic to a stub bucket on 127.0.0.1. When HTTPS_PROXY or HTTP_PROXY is set, as in a check cell or after another test leaves it set, Bun's S3 client goes through that proxy. The proxy then refuses with "127.0.0.1:… is a private destination". That is the error in the log, so I read the failure as environmental rather than a bug in the snapshot code.

Change.

  • test/helpers/stub-bucket.ts has a new bypassProxy(). It removes the proxy variables and returns a function that puts them back.
  • snapshot-repositories, snapshot-incremental and mirror-worker call it at file level and restore the variables in afterAll. These are the three tests that use that helper's stub bucket.

Checked.

  • tsc --noEmit is clean.
  • Those three test files pass: 36 tests.
  • snapshot-repositories also passes with HTTPS_PROXY and HTTP_PROXY set to a dead port (http://127.0.0.1:9).
  • I did not run bun scripts/gate.ts or bun scripts/fast.ts.

Left out.

  • I did not change the production S3 store, which is not at fault.
  • restore-drill-script.test.ts has its own stub bucket and I did not touch it.

Try it. Run HTTPS_PROXY=http://127.0.0.1:9 bun test test/snapshot-repositories.test.ts.

Approved

Test-only change, no src/web or runtime surface, so nothing for a phone or keyboard user to hit. It fits the pipeline direction: it removes an environment-dependent failure from the snapshot tests, where the check cell proxy refuses loopback. The helper is small, restores what it removed, and is called in the three files that use stubBucket. Two things I would do next: (1) give restore-drill-script.test.ts, which has its own stub bucket, the same bypass, or have it use stubBucket, so the same failure cannot come back there; (2) move the bypass into stubBucket itself, or a shared beforeAll, so a new test using the stub cannot forget it. The failure was not reproduced locally, so watch the forge check on this push for confirmation.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs