~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

The sites test takes a site down by its repository, its record and its owner

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:serve/site-takedown

What changes

The sites test now takes a live site down as the operator would, by each subject that hides it: its repository, its dev.knotless.site record, and its owner's account. Each time, the site answers 404, and once restored, 200 again. Before, it checked only the owner's own knotless site --down.

Why

Serve hides a site whose repository, record or owner is taken down (sites.rs, Index::site), but no test held it, so a change to the lookup could serve a taken-down repository's site.

Changeset: none

🤖 Generated with Claude Code

Approved

This extends the sites test so it takes the live site down by its repository, its dev.knotless.site record and its owner's DID. It uses Index::take_down for each, expects 404, then restores and expects 200. The owner's own --down still runs last.

I checked the subjects against the code and they match the lookup:

  • Sites::map in sites.rs checks at://{did}/dev.knotless.repo/{name} against down. The test's repo URI uses site, which is the repo name from s.url("site").
  • Index::site filters on the site URI, at://{did}/dev.knotless.site/{key}, and on did. The test's record and did subjects cover both.
  • take_down with applied=false deletes the takedown row, and the takedown_up trigger clears down only when no other row keeps the subject down. Each restore therefore returns the site to 200 before the next subject.
  • take_down calls stamps.mark_all(), so the cached map is invalidated and the wait_until polls will see the change.

I did not run the test and read no check results. It touches only the test file, so Changeset: none is right. I have no concerns.

Merged as f0b4675