Skip to content

tests/release-upload: refuse dotted URLs, not a dotted scratch path - #593

Merged
derekross merged 1 commit into
derekross:mainfrom
only21mil:build/release-upload-dot-path
Nov 10, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
only21mil:build/release-upload-dot-path

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

What and why

On #586 the maintainer asked whether tests/release-upload fails on main when the path contains /.. It does, but the cause is the test's stand-in server, not tools/release-upload.

The stand-in curl (tests/release-upload:118 on main) 404s any name with a dot component, to match tools/server/releases-nginx.sh's location ~ /\. { deny all; }, which keeps the upload's .<version>.partial staging directory from being served. It tested the whole local file path ($S/<url path>), though, and $S lives under $(mktemp -d). So when $TMPDIR sits under a dot directory (for example a checkout's logs/tmp in ~/.something/), every file 404s and the test fails at "a good bundle uploads" with "the published files don't match". The checkout's own path doesn't matter; $TMPDIR does.

tools/release-upload is unchanged. Its /. check (line 159) refuses dotted paths in manifest.json's file list, which are always relative to the bundle, and it stays as it is.

The change:

  • the stand-in applies the dot rule to the URL's path, as nginx matches the request URI;
  • the test's scratch directory is always $(mktemp -d)/.scratch, so every run (CI included) covers a dot path;
  • a new check in the resumed-upload section: the stand-in still refuses releases/cheetah/.<version>.partial/junk.

Evidence (TMPDIR under each checkout):

  • main, from a dot path: not ok - a good bundle uploads; from a path without a dot: 8/8 ok
  • the new test with main's curl line: not ok - a good bundle uploads
  • this branch: 8/8 ok; with the stand-in's dot rule deleted: not ok - a staging directory is never served …

Device and build

  • Phone: none: tests only
  • Kernel release (uname -r): n/a
  • Packages changed, with versions: none

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes (492 ok, 0 not ok, run from a dot path and from a path without one)
  • tests/packages: no package touched
  • Each changed package has its version bumped, and the new version is in the commit subject (no package changed)
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

On the phone

  • I ran this on my own phone, booted into this build: not applicable, the change is to a test that never runs on a phone
  • Runbook steps passed (plan, step, result): none
  • What I did not test: nothing on a phone
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)
tools/phone-smoke report

Not applicable: a test-only change (CONTRIBUTING.md §6.5).

Generated with Claude Opus 5.5 in T3 Code Nightly

The stand-in curl 404s any name with a dot component, as
tools/server/releases-nginx.sh's `location ~ /\. { deny all; }` does
for the upload's .<version>.partial staging. It tested the whole local
file path ($S/<url path>), though, so when $TMPDIR (and with it the
scratch "server") sat under a dot directory, such as a checkout under
~/.something with TMPDIR inside it, every file 404ed and the test
failed at "a good bundle uploads" with "the published files don't
match". tools/release-upload was never involved: its "/." check
(manifest.json's file paths) sees only bundle-relative paths.

The stand-in now applies the rule to the URL's path, as nginx matches
the request URI. The scratch directory always sits under a dot
directory, so every run covers this, and a new check confirms a dotted
URL (a staging directory) is still refused.

Asked on derekross#586.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you, this answers what I asked on #586 exactly, and it was the test's stand-in rather than the tool, as you say. I reproduced it here: with TMPDIR under a dot directory main fails at "a good bundle uploads", and your branch merged onto today's main passes 8 of 8. With the stand-in's dot rule taken out, your new staging-directory check fails, so it does guard what it says. Putting the scratch directory under .scratch on every run is a nice touch, because CI now covers the case too. Merging.

@derekross
derekross merged commit 541b612 into derekross:main Nov 10, 2026
2 checks passed
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…erekross#593)

The test's stand-in refused any path with a dot in it, so "a good bundle uploads" failed whenever TMPDIR sat under a dotted directory. It now refuses dotted URLs only, which is what the tool itself guards. Tests only.
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.

2 participants