Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3164196
Scope Doors preview browser checks to changed pages
LukasWallrich Nov 21, 2026
ff41859
Run full browser checks when the PR base build is skipped
LukasWallrich Nov 21, 2026
ea7d095
Cover deferred bundles and preserve cross-page checks
LukasWallrich Nov 21, 2026
79b4328
Run Doors preview builds and page selection in parallel
LukasWallrich Nov 21, 2026
5c2d1c1
Reuse the target branch cache when building a PR base
LukasWallrich Nov 21, 2026
f837119
Make Contributors regeneration consistent across preview jobs
LukasWallrich Nov 21, 2026
c7e4d03
Retain core checks and reuse matching Doors base builds
LukasWallrich Nov 21, 2026
286ca34
Build the Doors main reference in parallel and stabilize scoped inputs
LukasWallrich Nov 21, 2026
9022cea
Resolve artifact runs without a checkout
LukasWallrich Nov 21, 2026
bd31d6b
Check the source run of each production artifact
LukasWallrich Nov 21, 2026
ff313c0
Workflows README: the PR-base diff applies to PRs only
LukasWallrich Nov 22, 2026
7877c2f
Run Doors main comparisons only for launch, pushes and manual checks
LukasWallrich Nov 22, 2026
66fda65
Preserve the five known internal-link exceptions without a main build
LukasWallrich Nov 22, 2026
37ee37e
Validate Doors job results and use the launch PR merge base
LukasWallrich Nov 22, 2026
112053a
Run comparison checks on workflow dispatch
LukasWallrich Nov 22, 2026
5d293f7
Compare the Doors head at launch and match historical redirect paths
LukasWallrich Nov 22, 2026
3a4f9e4
Merge rebrand-doors into rebrand-page-scoped-ci
LukasWallrich Nov 24, 2026
4100917
Run phone reading in the core design checks
LukasWallrich Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,19 @@ Features:
| Trigger | Target | Schedule |
|---------|--------|----------|
| Push to `rebrand-doors` | forrt.org/rebrand-doors/ (`forrtproject/rebrand-doors`) | On push |
| PR into `rebrand-doors` | Checks only, no deployment | On PR events |
| Same-repository PR into `rebrand-doors` | Checks only | On PR events |
| Same-repository PR from `rebrand-doors` into `main` | Launch checks | On PR events |
| Manual run | Launch checks | On dispatch |

Features:
- Uses the same data and announcement artifacts as `deploy.yaml`, with noindex and no analytics
- Compares each build with its merge base with `main`: URL list, structured data, SEO tags and internal links. See `scripts/rebrand/README.md`
- A failed check marks the run red but still updates the preview
- After the build, the comparison, the designed-screens check and the accessibility check run as three jobs side by side; the designed-screens check runs four browsers at once
- Pushes, manual runs and the launch PR compare URLs, structured data and SEO tags with the merge base with `main`. The launch PR uses the Doors head as the candidate, so changes unique to `main` stay out of that comparison. Both builds use the same pinned production artifacts.
- The source rules, internal links and built HTML checks run from the branch build alongside the browser checks. Only pushes update the preview, even if a check fails.
- Eligible PRs into `rebrand-doors` build their PR base (or reuse the last push build when its inputs match) and limit browser checks to the pages that differ.
- The final gate checks every job's expected result. The main reference and comparison are skipped on ordinary Doors PRs, the PR base is used only in scoped mode, and only pushes deploy.
- CSS or JS changes add the core design and axe samples to the changed-page checks. Core design covers the named screens, breakpoints, sample pages, home, phone reading (with the JUST-OS launcher checks), floating controls at 390 and 1440 px, and every fourth article in the usual article set.
- Pushes, PRs labeled `full-checks`, PRs changing this workflow or the check scripts, and diffs over 60 pages run the full browser suite. With no relevant changes, both browser jobs report success without starting Chromium.
- Design and axe cache Chromium by Playwright version.
- Delete this workflow when the redesign launches

## Data Workflows
Expand Down
590 changes: 477 additions & 113 deletions .github/workflows/rebrand-preview.yaml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions scripts/rebrand/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ Tools for the long-lived `rebrand-doors` branch, which moves forrt.org to the Do

Only `check_preview.py --production` runs against production, after launch; everything else checks the branch, its builds or the preview. Delete this folder after launch unless a check has been promoted into the normal workflows.

## What runs on every push and PR
## Preview checks

`.github/workflows/rebrand-preview.yaml` builds the branch and its merge base with `main` from the same data and announcement artifacts as `deploy.yaml`, with Hugo 0.158.0 and `HUGO_ENV=staging`, and then runs:
`.github/workflows/rebrand-preview.yaml` uses the same data and announcement artifacts as `deploy.yaml`, with Hugo 0.158.0 and `HUGO_ENV=staging`. Pushes, manual runs and the launch PR also build the merge base with `main` for the comparison. Ordinary same-repository PRs into `rebrand-doors` run the other checks, and use their PR base to scope browser checks when eligible.

| Check | Script | Fails when |
|---|---|---|
| Source rules | `check_source_rules.py` | A template or menu hard-codes one of this site's own forrt.org URLs (use `relref`), or the branch edits a generated path |
| Builds compared | `compare_builds.py` | A page, feed or data file appears or goes, a structured-data count falls, JSON-LD is invalid, or a page's SEO tags change |
| Internal links | `check_internal_links.py` | A link broken here is not also broken at the merge base. Lychee excludes forrt.org, so nothing else checks these |
| Internal links | `check_internal_links.py` | An internal link is broken and its target is outside the documented exceptions in `link_allowlist.txt` |
| Built HTML | `../check_seo_html.py` | The site's standing rules on headings, conditional assets, image `alt` and home-page images |
| Designed screens | `check_design.py` | On the designed screens and every page on the reading layout (a sample of the three large collections): sideways overflow, italics, line length, small text, low contrast, broken images or more than one `h1`; an icon outside the subset or a theme asset loaded anywhere; the home page's topics too far down (A14), layout shift, pause control or the resources directory misbehaving; a call-out over the text, the card or another call-out; the chat launcher, its invitation or label, or back to top over text, a card or a control at any of several scroll positions (below 1440 px, where the launcher and back to top float in the corner, over each other mid-page or over anything at the end), or the invitation showing nowhere; specialist resources shown on a cluster page while their box is unticked; the conference programme's day tabs, abstract dialog or width misbehaving, or any of its days failing the audit with JavaScript off; the contributor network off centre or too small on its canvas, reaching another site, or not answering to its search boxes, pointer, keyboard or reduced motion; an abstract toggle that does not say Hide when open, panel text wider than the reading measure on `/clusters/` or `/disciplines/`, the booklet turning to a spread at 390 px, or the community map opening at 390 px without its members in view or unable to zoom out |
| Accessibility rules | `check_axe.py` | axe-core reports a Level A or AA problem on a sample page at 390 or 1440 px, apart from the provider's markup listed in `KNOWN` |

Pushes also run `preview_paths.py`, which prefixes root-relative paths for the subfolder and adds noindex to every HTML file, and then deploy. A failed check marks the run red but does not hold the preview back. Tests are in `../tests/test_rebrand_checks.py`.
`preview_paths.py` prefixes root-relative paths for the subfolder and adds noindex to every HTML file. Pushes deploy the preview as soon as the build is ready, alongside the checks. Tests are in `../tests/test_rebrand_checks.py`.

Agreed exceptions go in `allowed_changes.txt` (URL list) and `link_allowlist.txt` (retired paths the 404 page redirects), with a comment saying why. `link_allowlist.txt` holds `/TenureRun/`, which the Games Portal's sheet still links; it can go when the sheet has the game's new address.
Agreed exceptions go in `allowed_changes.txt` (URL list) and `link_allowlist.txt` (retired or grandfathered link targets), with a comment saying why. `link_allowlist.txt` holds `/TenureRun/`, which the Games Portal's sheet still links. Remove the exception when the sheet has the game's new address.

## Baseline

Expand Down
92 changes: 92 additions & 0 deletions scripts/rebrand/changed_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/usr/bin/env python3
"""Compare built pages and CSS/JS, and select the browser check mode."""

import argparse
import hashlib
import json
import re
from pathlib import Path

FINGERPRINT = re.compile(r"\.(?:[0-9a-f]{128}|[0-9a-f]{96}|[0-9a-f]{64}|[0-9a-f]{32})(?=\.(?:css|js)\b)")
INTEGRITY = re.compile(r"""\s+integrity=(?:"[^"]*"|'[^']*'|[^\s>]+)""")


def normalize(html):
def clean_tag(match):
return INTEGRITY.sub("", match[0])

return re.sub(r"<(?:link|script)\b[^>]*>", clean_tag, FINGERPRINT.sub("", html))


def page_path(path):
path = "/" + path.lstrip("/")
return path[:-len("index.html")] if path.endswith("/index.html") else path


def inventory(root):
pages, bundles = {}, {}
for path in sorted(root.rglob("*")):
suffix = path.suffix
if suffix not in {".html", ".css", ".js"} or not path.is_file():
continue
relative = path.relative_to(root).as_posix()
if suffix == ".html":
pages[page_path(relative)] = hashlib.sha256(normalize(path.read_text(encoding="utf-8")).encode()).digest()
else:
bundles.setdefault(FINGERPRINT.sub("", relative), set()).add(hashlib.sha256(path.read_bytes()).digest())
return pages, bundles


def compare(base, head):
before, old_bundles = inventory(base)
after, new_bundles = inventory(head)
return {
"changed": sorted(path for path in before.keys() & after.keys() if before[path] != after[path]),
"added": sorted(after.keys() - before.keys()),
"removed": sorted(before.keys() - after.keys()),
"bundles_changed": old_bundles != new_bundles,
}


def load_selection(path):
if path is None:
print("Check mode: full (all pages)")
return "full", set()
diff = json.loads(Path(path).read_text(encoding="utf-8"))
live = set(diff["changed"]) | set(diff["added"])
total = len(live) + len(diff["removed"])
if diff.get("force_full") or total > 60:
mode = "full"
elif diff["bundles_changed"]:
mode = "core"
elif live:
mode = "changed"
else:
mode = "none"
print(f"Check mode: {mode}")
for field in ("changed", "added", "removed"):
print(f"{field.capitalize()} pages: {', '.join(diff[field]) or '(none)'}")
if mode == "none":
print("no changed pages")
return mode, live


def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("base", type=Path, nargs="?")
parser.add_argument("head", type=Path, nargs="?")
parser.add_argument("--out", type=Path, required=True)
parser.add_argument("--full", action="store_true")
args = parser.parse_args()
if args.full:
diff = {"changed": [], "added": [], "removed": [], "bundles_changed": False, "force_full": True}
else:
if not all(path and (path / "index.html").is_file() for path in (args.base, args.head)):
parser.error("base and head must each contain a built index.html")
diff = compare(args.base, args.head)
args.out.write_text(json.dumps(diff, indent=2) + "\n", encoding="utf-8")
load_selection(args.out)


if __name__ == "__main__":
main()
14 changes: 14 additions & 0 deletions scripts/rebrand/check_axe.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
sys.path.insert(0, HERE)
from check_design import serve # noqa: E402

from changed_pages import load_selection # noqa: E402

LEVEL_A = {"wcag2a", "wcag21a", "wcag22a"}
LEVEL_AA = {"wcag2aa", "wcag21aa", "wcag22aa"}
EXTRA = {
Expand Down Expand Up @@ -57,14 +59,26 @@ def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("public", nargs="?")
parser.add_argument("--url")
parser.add_argument("--pages", help="JSON from changed_pages.py")
parser.add_argument("--base", default="/")
parser.add_argument("--axe", required=True, help="path to axe.min.js")
parser.add_argument("--out", help="write every finding to this JSON file")
args = parser.parse_args()
mode, pages = load_selection(args.pages)
if mode == "none":
if args.out:
with open(args.out, "w", encoding="utf-8") as handle:
json.dump([], handle)
return
base = args.url.rstrip("/") + "/" if args.url else serve(os.path.abspath(args.public), args.base)
with open(os.path.join(HERE, "sample_pages.json"), encoding="utf-8") as handle:
sample = {**json.load(handle), **EXTRA}
sample.pop("404", None)
if mode == "changed":
names = {path: name for name, path in sample.items()}
sample = {names.get(path, path): path for path in sorted(pages)}
elif mode == "core":
sample.update({path: path for path in sorted(pages - set(sample.values()))})
with open(args.axe, encoding="utf-8") as handle:
axe = handle.read()
findings, failures, practice = [], [], collections.Counter()
Expand Down
Loading
Loading