forge(docs): the host-side du runs at the bind source, not at /data (#1507) #1787

Merged
jaylouisw merged 1 commit from fix/1117-0405 into main 2026-11-17 04:42:45 +00:00
Owner

Refs #1507 - repo side only; the storage decision still needs a shell on the host.

What was wrong

The cross-check in "Which repository owns the space" was introduced as "From the host, the same question from the other end" and printed:

du -sh /data/git/repositories/*/*.git | sort -h | tail -5

/data is the container's mount point. On a host shell that path matches nothing, du prints its miss (and with any 2>/dev/null habit, prints nothing at all), and the reader concludes no repository owns the space. The same page records the bind .../forgejo/data -> /data in "Diagnosing which path the database is actually on", so the page contradicted itself 30 lines later. This is the same defect #1784 fixes for the LFS probe at the end of the section, left behind one paragraph earlier - and the test asserted the container path as the host command, so the suite certified the bug.

What changed

  • the cross-check loops the two bind sources - the pool path and the FUSE view of the same directory - instead of /data;
  • a candidate that is not there is echoed as absent: <path>, not left as silence;
  • the docker exec forgejo du -s /data/git/repositories/... form is kept, explicitly inside the container, which is where it is correct;

Tests

test/forge-space-accounting.test.js: 17 assertions, 0 failed; the single assertion that certified the container path as a host command is replaced by three, all three red on the previous page (checked against origin/main's copy of the doc: host-bind RED, /data-outside-container RED, absent-echo RED).

Full suite: 303 suites, 10,595 assertions, 0 failed (node scripts/run-tests.js --concurrency=8, 216 s).

node scripts/syntax-check.js: 374 files, all OK. audit-port-types, check-control-bytes, check-canonical-urls (3,012 files) all clean.

The printed loop was run in this session on a host with neither mount: it prints the two absent: lines and exits 0, which is what the page says it does.

Refs #1507 - repo side only; the storage decision still needs a shell on the host. ## What was wrong The cross-check in "Which repository owns the space" was introduced as **"From the host, the same question from the other end"** and printed: ```bash du -sh /data/git/repositories/*/*.git | sort -h | tail -5 ``` `/data` is the container's mount point. On a host shell that path matches nothing, `du` prints its miss (and with any `2>/dev/null` habit, prints nothing at all), and the reader concludes no repository owns the space. The same page records the bind `.../forgejo/data -> /data` in "Diagnosing which path the database is actually on", so the page contradicted itself 30 lines later. This is the same defect #1784 fixes for the LFS probe at the end of the section, left behind one paragraph earlier - and the test asserted the container path *as* the host command, so the suite certified the bug. ## What changed - the cross-check loops the two bind sources - the pool path and the FUSE view of the same directory - instead of `/data`; - a candidate that is not there is echoed as `absent: <path>`, not left as silence; - the `docker exec forgejo du -s /data/git/repositories/...` form is kept, explicitly inside the container, which is where it is correct; ## Tests `test/forge-space-accounting.test.js`: **17 assertions, 0 failed**; the single assertion that certified the container path as a host command is replaced by three, **all three red on the previous page** (checked against `origin/main`'s copy of the doc: host-bind RED, /data-outside-container RED, absent-echo RED). Full suite: **303 suites, 10,595 assertions, 0 failed** (`node scripts/run-tests.js --concurrency=8`, 216 s). `node scripts/syntax-check.js`: 374 files, all OK. `audit-port-types`, `check-control-bytes`, `check-canonical-urls` (3,012 files) all clean. The printed loop was run in this session on a host with neither mount: it prints the two `absent:` lines and exits 0, which is what the page says it does.
forge(docs): the host-side du runs at the bind source, not at /data (#1507)
All checks were successful
CI / Classify the change (pull_request) Successful in 11s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 16s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 25s
CI / Test (Node 20) (pull_request) Successful in 54s
CI / Test (Node 22) (pull_request) Successful in 1m0s
CI / Test (Node 18) (pull_request) Successful in 1m6s
CI / Arm auto-merge (pull_request) Successful in 10s
5e53debc65
The cross-check under "Which repository owns the space" was labelled "From the
host" and printed

    du -sh /data/git/repositories/*/*.git | sort -h | tail -5

`/data` is the container's mount point; on the host that path matches nothing,
`du` prints its miss, and the same page records the bind
`.../forgejo/data -> /data` in a later section. A reader on the host gets no
output and reads it as "no repository owns the space" - the empty-result-as-
measurement mistake this section exists to correct, and the same defect #1784
fixes one paragraph further down for the LFS probe.

The cross-check now loops the two bind sources (pool path and FUSE view),
prints `absent: <path>` for a candidate that is not there, and keeps the
`docker exec ... /data/git/repositories` form explicitly inside the container,
which is where it is correct.

test/forge-space-accounting.test.js: the assertion that certified the container
path as a host command is replaced by three - the host du runs at a /mnt bind
source, a /data/git path appears only inside `docker exec` (or a comment), and a
missing candidate is echoed. 17 assertions, 3 red on the previous page.
jaylouisw force-pushed fix/1117-0405 from 5e53debc65
All checks were successful
CI / Classify the change (pull_request) Successful in 11s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 16s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 25s
CI / Test (Node 20) (pull_request) Successful in 54s
CI / Test (Node 22) (pull_request) Successful in 1m0s
CI / Test (Node 18) (pull_request) Successful in 1m6s
CI / Arm auto-merge (pull_request) Successful in 10s
to f9c897fa3b
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 9s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 22s
CI / Test (Node 18) (pull_request) Successful in 59s
CI / Test (Node 20) (pull_request) Successful in 51s
CI / Test (Node 22) (pull_request) Successful in 56s
CI / Arm auto-merge (pull_request) Successful in 44s
2026-11-17 04:24:45 +00:00
Compare
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-17 04:31:15 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!1787
No description provided.