Match wiki pages by address so names with spaces are the same page #64

Merged
Tirsvad merged 1 commits from mil-006-wiki-title-identity into main 2026-10-10 06:01:03 +02:00
Owner

Fixes how the scoped publisher identifies wiki pages. Found while preparing the pilot (MIL-006 task 4, issue #59).

Problem

Gitea stores the title Home da as the page Home-da. The publisher compared title strings, so a file Home-da.md did not match the existing page Home da and the publisher would have tried to create a page that already exists. The pilot repository TirSystem/sqa-qc-checklists has 14 hand-written pages named with spaces, and my earlier tests used names without spaces, which is why they missed it.

Changes

  • .gitea/scoped_workflows/publish-wiki.yml (embedded script):
    • a page is identified by the address Gitea reports (sub_url, percent-decoded), or by its title with spaces replaced by hyphens;
    • local file names are keyed the same way, so Home da.md and Home-da.md name one page;
    • two files that name the same page are refused with a configuration error, before any request.
  • tests/test_publish_wiki.py: 12 new offline tests (updates the existing page, identical pages are a no-op including _Sidebar, prune keeps a page that is in the folder under the other spelling, address wins over title and is decoded, collision refused). The new tests fail against the previous script (12 failures) and pass with the fix; full suite 156 passed.

Wiki pages changed (rule 8)

None.

Next in the pilot

Export the 14 existing pages byte for byte into wiki/ of sqa-qc-checklists with an empty wiki/.publish (no prune), so the first publish must report 0 created, 0 updated, 0 deleted.

Refs #59

Fixes how the scoped publisher identifies wiki pages. Found while preparing the pilot (MIL-006 task 4, issue #59). ## Problem Gitea stores the title `Home da` as the page `Home-da`. The publisher compared title strings, so a file `Home-da.md` did not match the existing page `Home da` and the publisher would have tried to create a page that already exists. The pilot repository `TirSystem/sqa-qc-checklists` has 14 hand-written pages named with spaces, and my earlier tests used names without spaces, which is why they missed it. ## Changes - `.gitea/scoped_workflows/publish-wiki.yml` (embedded script): - a page is identified by the address Gitea reports (`sub_url`, percent-decoded), or by its title with spaces replaced by hyphens; - local file names are keyed the same way, so `Home da.md` and `Home-da.md` name one page; - two files that name the same page are refused with a configuration error, before any request. - `tests/test_publish_wiki.py`: 12 new offline tests (updates the existing page, identical pages are a no-op including `_Sidebar`, prune keeps a page that is in the folder under the other spelling, address wins over title and is decoded, collision refused). The new tests fail against the previous script (12 failures) and pass with the fix; full suite 156 passed. ## Wiki pages changed (rule 8) None. ## Next in the pilot Export the 14 existing pages byte for byte into `wiki/` of `sqa-qc-checklists` with an empty `wiki/.publish` (no `prune`), so the first publish must report `0 created, 0 updated, 0 deleted`. Refs #59
Tirsvad added 1 commit 2026-10-10 06:00:47 +02:00
Match wiki pages by address so names with spaces are the same page
Validate workflows / validate (pull_request) Successful in 16s
b240ceb9f1
Gitea stores the title "Home da" as Home-da. The publisher compared title
strings, so a file named Home-da.md would have tried to create a page that
already exists. Identify a page by the address Gitea reports (sub_url),
treat a space and a hyphen as the same, and refuse two files that name one
page. Found while preparing the pilot in sqa-qc-checklists, whose wiki has
pages named with spaces.

Task: MIL-006#3
Tirsvad merged commit e73975e3a6 into main 2026-10-10 06:01:03 +02:00
Tirsvad deleted branch mil-006-wiki-title-identity 2026-10-10 06:01:03 +02:00
Sign in to join this conversation.