From 5ff3b697a5d61f2867a20df86120cfc96a08864c Mon Sep 17 00:00:00 2001 From: William Jacoby Date: Tue, 6 Oct 2026 14:01:48 -0500 Subject: [PATCH] Use the configured docs build path in the documentation check phpbbmodders/documentation is moving its default build location from ext/phpbbmodders/documentation/docs-build to store/phpbbmodders_documentation. Read phpbbmodders_documentation_docs_path so the check works for both, and check that a guest who loses access gets the login form. Co-Authored-By: Claude Opus 5.5 --- phpbb-test-board/feature_checks.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/phpbb-test-board/feature_checks.py b/phpbb-test-board/feature_checks.py index 6b7514a..4385416 100755 --- a/phpbb-test-board/feature_checks.py +++ b/phpbb-test-board/feature_checks.py @@ -129,7 +129,15 @@ def warnings() -> int: def check_documentation(b: Board) -> None: - build = b.root / "ext/phpbbmodders/documentation/docs-build" + # The default build location moved over time (ext/.../docs-build, then + # store/phpbbmodders_documentation), so write the probe build wherever + # the installed version is configured to look. + rows = b.sql("SELECT config_value FROM phpbb_config " + "WHERE config_name = 'phpbbmodders_documentation_docs_path'") + if not rows: + ok(False, "docs build path is configured") + return + build = b.root / rows[0][0] for sub, marker in (("en", "PROBE-DOCS-HOME"), ("en/userguide", "PROBE-DOCS-SECTION")): (build / sub).mkdir(parents=True, exist_ok=True) (build / sub / "index.html").write_text( @@ -147,6 +155,16 @@ def check_documentation(b: Board) -> None: ok(r.status_code == 200 and "PROBE-DOCS-HOME" in r.text, f"guest can read the docs home ({r.status_code})") r = g.get(f"{b.base}/app.php/documentation/en/userguide") ok(r.status_code == 200 and "PROBE-DOCS-SECTION" in r.text, f"guest can read a section page ({r.status_code})") + # A guest who loses access gets the login form rather than a bare 403. + b.sql("DELETE FROM phpbb_acl_groups " + "WHERE group_id = (SELECT group_id FROM phpbb_groups WHERE group_name = 'GUESTS') " + "AND auth_option_id = (SELECT auth_option_id FROM phpbb_acl_options " + "WHERE auth_option = 'u_phpbbmodders_documentation_userguide')") + b.sql("UPDATE phpbb_users SET user_permissions = ''") + b.purge_cache() + r = requests.Session().get(f"{b.base}/app.php/documentation/en/userguide") + ok('name="username"' in r.text and "PROBE-DOCS-SECTION" not in r.text, + f"guest without access gets the login form ({r.status_code})") def check_separatebots(b: Board) -> None: