Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ 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
- PRs build their base commit alongside the candidate with the same artifacts and regenerated Contributors page. The browser checks use the resulting HTML diff. The comparison with the merge base with `main` still covers the whole site.
- CSS or JS changes with no HTML changes run the core design sample and the usual axe sample. Core design covers the named screens, breakpoints, sample pages, home, 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
216 changes: 202 additions & 14 deletions .github/workflows/rebrand-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ name: Doors preview
# Checks: Every run also builds the merge base with main from the same data, then compares
# the two builds.
# A failed check shows on the run but does not hold back the preview.
# Layout: "Build" builds the branch and shares it as an artifact. Three jobs then check it
# side by side: the comparison with main, the designed screens and the accessibility
# rules. "Check results" fails if any of them did.
# Layout: Shared inputs feed the branch build and, on scoped PRs, the PR base build.
# The browser checks use the changed pages or a core sample for CSS/JS-only changes.
# Pushes, the full-checks label, check infrastructure changes and large diffs use the full suite.
# "Compare with main" still checks the whole site. "Check results" aggregates failures.
# Note: Uses the same data and announcement artifacts as deploy.yaml. Delete this
# workflow when the redesign launches.

Expand All @@ -20,6 +21,7 @@ on:
branches:
- rebrand-doors
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- rebrand-doors

Expand All @@ -28,6 +30,7 @@ env:
PYTHONUNBUFFERED: "1" # Output is flushed as it is printed, so the log's timestamps show which section is slow.
HUGO_VERSION: "0.158.0"
HUGO_EXTENDED: true
PLAYWRIGHT_VERSION: "1.63.0"
PREVIEW_BASE: /rebrand-doors/
PREVIEW_URL: https://forrt.org/rebrand-doors/

Expand All @@ -36,14 +39,16 @@ concurrency:
cancel-in-progress: true

jobs:
build:
name: Build
inputs:
name: Prepare shared inputs
runs-on: ubuntu-22.04
# Fork PRs get no artifacts token and have no preview to update.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
permissions:
contents: read
actions: read # Needed for artifact access
outputs:
scoped: ${{ steps.scope.outputs.scoped }}
steps:
# Full history for Hugo's Git dates, with file contents fetched only for the commit
# checked out (as in staging-aggregate.yaml).
Expand All @@ -58,6 +63,19 @@ jobs:
- name: Let Git report non-ASCII paths unquoted
run: git config core.quotepath false

- name: Select full or scoped checks
id: scope
env:
EVENT: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
FULL_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'full-checks') }}
run: |
if [ "$EVENT" != pull_request ] || [ "$FULL_LABEL" = true ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Workflow and check-script changes do not force the full browser suite: BASE_SHA is assigned but never used, so ordinary PRs remain scoped unless they carry full-checks or are pushes. Compare the PR base with HEAD for the workflow and check-script paths before setting scoped=true.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/rebrand-preview.yaml, line 73:

<comment>Workflow and check-script changes do not force the full browser suite: `BASE_SHA` is assigned but never used, so ordinary PRs remain scoped unless they carry `full-checks` or are pushes. Compare the PR base with `HEAD` for the workflow and check-script paths before setting `scoped=true`.</comment>

<file context>
@@ -58,6 +63,19 @@ jobs:
+          BASE_SHA: ${{ github.event.pull_request.base.sha }}
+          FULL_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'full-checks') }}
+        run: |
+          if [ "$EVENT" != pull_request ] || [ "$FULL_LABEL" = true ]; then
+            echo "scoped=false" >> "$GITHUB_OUTPUT"
+          else
</file context>
Suggested change
if [ "$EVENT" != pull_request ] || [ "$FULL_LABEL" = true ]; then
if [ "$EVENT" != pull_request ] || [ "$FULL_LABEL" = true ] ||
! git diff --quiet "$BASE_SHA" HEAD -- .github/workflows/rebrand-preview.yaml scripts/rebrand; then

echo "scoped=false" >> "$GITHUB_OUTPUT"
else
echo "scoped=true" >> "$GITHUB_OUTPUT"
fi

# =======================
# Artifacts, as in deploy.yaml
# =======================
Expand Down Expand Up @@ -110,7 +128,8 @@ jobs:
- name: Pack the artifacts for the reference build
run: |
mkdir -p "$RUNNER_TEMP/artifacts/data" "$RUNNER_TEMP/artifacts/announcements"
tar -cf inputs.tar -C "$RUNNER_TEMP" artifacts
cp content/contributors/tenzing.md "$RUNNER_TEMP/contributors.md"
tar -cf inputs.tar -C "$RUNNER_TEMP" artifacts contributors.md

- name: Upload the artifacts for the reference build
uses: actions/upload-artifact@v7
Expand All @@ -121,6 +140,33 @@ jobs:
overwrite: true
if-no-files-found: error

build:
name: Build
runs-on: ubuntu-22.04
needs: inputs
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
filter: blob:none

- name: Let Git report non-ASCII paths unquoted
run: git config core.quotepath false

- name: Download shared inputs
uses: actions/download-artifact@v7
with:
name: rebrand-inputs-${{ github.run_number }}
path: ${{ runner.temp }}

- name: Apply shared inputs
run: |
tar -xf "$RUNNER_TEMP/inputs.tar" -C "$RUNNER_TEMP"
scripts/rebrand/apply_artifacts.sh . \
"$RUNNER_TEMP/artifacts/data" "$RUNNER_TEMP/artifacts/announcements"
cp "$RUNNER_TEMP/contributors.md" content/contributors/tenzing.md

- name: Setup Hugo
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f
with:
Expand Down Expand Up @@ -150,6 +196,110 @@ jobs:
overwrite: true # A rerun reuses the run number.
if-no-files-found: error

reference:
name: Build PR base
runs-on: ubuntu-22.04
needs: inputs
if: needs.inputs.outputs.scoped == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
filter: blob:none

- name: Let Git report non-ASCII paths unquoted
run: git config core.quotepath false

- name: Check out the PR base
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: git worktree add --detach "$RUNNER_TEMP/pr-base" "$BASE_SHA"

- name: Download shared inputs
uses: actions/download-artifact@v7
with:
name: rebrand-inputs-${{ github.run_number }}
path: ${{ runner.temp }}

- name: Apply shared inputs
run: |
tar -xf "$RUNNER_TEMP/inputs.tar" -C "$RUNNER_TEMP"
scripts/rebrand/apply_artifacts.sh "$RUNNER_TEMP/pr-base" \
"$RUNNER_TEMP/artifacts/data" "$RUNNER_TEMP/artifacts/announcements"
cp "$RUNNER_TEMP/contributors.md" "$RUNNER_TEMP/pr-base"/content/contributors/tenzing.md

- name: Setup Hugo
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f
with:
hugo-version: ${{ env.HUGO_VERSION }}
extended: ${{ env.HUGO_EXTENDED }}

# HUGO_ENV=staging adds noindex and leaves out Google Analytics.
- name: Build the PR base
working-directory: ${{ runner.temp }}/pr-base
run: hugo --gc --minify --destination "$GITHUB_WORKSPACE/public" --baseURL "$PREVIEW_URL"
env:
HUGO_ENV: staging

- name: Point root-relative links at the subfolder
run: python3 scripts/rebrand/preview_paths.py public --base "$PREVIEW_BASE"

- name: Pack pages and bundles
working-directory: public
run: find . -type f \( -name '*.html' -o -name '*.css' -o -name '*.js' \) -print0 | tar --null -T - -cf ../site.tar

- name: Upload site artifact
uses: actions/upload-artifact@v7
with:
name: rebrand-pr-base-${{ github.run_number }}
path: site.tar
retention-days: 1
compression-level: 1
overwrite: true # A rerun reuses the run number.
if-no-files-found: error

pages:
name: Select browser checks
runs-on: ubuntu-22.04
needs: [inputs, build, reference]
if: always() && needs.build.result == 'success' && (needs.reference.result == 'success' || needs.inputs.outputs.scoped == 'false')
outputs:
mode: ${{ steps.selection.outputs.mode }}
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v7
if: needs.inputs.outputs.scoped == 'true'
with:
name: rebrand-preview-${{ github.run_number }}
path: head
- uses: actions/download-artifact@v7
if: needs.inputs.outputs.scoped == 'true'
with:
name: rebrand-pr-base-${{ github.run_number }}
path: base
- name: Compare pages and bundles
id: selection
env:
SCOPED: ${{ needs.inputs.outputs.scoped }}
run: |
if [ "$SCOPED" = true ]; then
tar -xf base/site.tar -C base
tar -xf head/site.tar -C head
python3 scripts/rebrand/changed_pages.py base head --out changed.json | tee selection.log
else
python3 scripts/rebrand/changed_pages.py --full --out changed.json | tee selection.log
fi
sed -n 's/^Check mode: /mode=/p' selection.log >> "$GITHUB_OUTPUT"
shell: bash
- uses: actions/upload-artifact@v7
with:
name: rebrand-pages-${{ github.run_number }}
path: changed.json
retention-days: 1
overwrite: true
if-no-files-found: error

compare:
name: Compare with main
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -236,22 +386,40 @@ jobs:
design:
name: Designed screens
runs-on: ubuntu-22.04
needs: build
needs: [build, pages]
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Download page selection
uses: actions/download-artifact@v7
with:
name: rebrand-pages-${{ github.run_number }}

- name: Report check mode and pages
run: PYTHONPATH=scripts/rebrand python3 -c 'from changed_pages import load_selection; load_selection("changed.json")'

- name: Download the branch's build
if: needs.pages.outputs.mode != 'none'
uses: actions/download-artifact@v7
with:
name: rebrand-preview-${{ github.run_number }}

- name: Unpack the site
if: needs.pages.outputs.mode != 'none'
run: mkdir public && tar -xf site.tar -C public

- name: Cache Chromium
if: needs.pages.outputs.mode != 'none'
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ runner.arch }}-${{ env.PLAYWRIGHT_VERSION }}-chromium

- name: Install Playwright
if: needs.pages.outputs.mode != 'none'
run: |
pip install --quiet playwright==1.63.0 pillow
pip install --quiet "playwright==$PLAYWRIGHT_VERSION" pillow
# The runner image already has Chromium's libraries; --with-deps adds fonts from the
# Ubuntu mirror. When the mirror is unreachable, install the browser without them.
playwright install --with-deps chromium || {
Expand All @@ -261,36 +429,56 @@ jobs:

# Runs its sections in four browsers side by side; each section's time is in the log.
- name: Designed screens in a browser (overflow, position, layout shift, pause, directory)
run: python3 scripts/rebrand/check_design.py public --base "$PREVIEW_BASE" --jobs 4
if: needs.pages.outputs.mode != 'none'
run: python3 scripts/rebrand/check_design.py public --pages changed.json --base "$PREVIEW_BASE" --jobs 4

axe:
name: Accessibility rules
runs-on: ubuntu-22.04
needs: build
needs: [build, pages]
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Download page selection
uses: actions/download-artifact@v7
with:
name: rebrand-pages-${{ github.run_number }}

- name: Report check mode and pages
run: PYTHONPATH=scripts/rebrand python3 -c 'from changed_pages import load_selection; load_selection("changed.json")'

- name: Download the branch's build
if: needs.pages.outputs.mode != 'none'
uses: actions/download-artifact@v7
with:
name: rebrand-preview-${{ github.run_number }}

- name: Unpack the site
if: needs.pages.outputs.mode != 'none'
run: mkdir public && tar -xf site.tar -C public

- name: Cache Chromium
if: needs.pages.outputs.mode != 'none'
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ runner.arch }}-${{ env.PLAYWRIGHT_VERSION }}-chromium

- name: Install Playwright
if: needs.pages.outputs.mode != 'none'
run: |
pip install --quiet playwright==1.63.0
pip install --quiet "playwright==$PLAYWRIGHT_VERSION"
playwright install --with-deps chromium || {
echo "::warning::Could not install Chromium's system packages; installing the browser without them"
playwright install chromium
}

- name: Accessibility rules in a browser (axe-core, by WCAG level)
if: needs.pages.outputs.mode != 'none'
run: |
curl -fsSL https://cdn.jsdelivr.net/npm/axe-core@4.11.1/axe.min.js -o "$RUNNER_TEMP/axe.min.js"
python3 scripts/rebrand/check_axe.py public --base "$PREVIEW_BASE" --axe "$RUNNER_TEMP/axe.min.js"
python3 scripts/rebrand/check_axe.py public --pages changed.json --base "$PREVIEW_BASE" --axe "$RUNNER_TEMP/axe.min.js"

deploy:
name: Deploy preview
Expand Down Expand Up @@ -322,9 +510,9 @@ jobs:
checks:
name: Check results
runs-on: ubuntu-22.04
needs: [build, compare, design, axe]
needs: [inputs, build, compare, design, axe]
# Report even when a check job failed; skip only when the build was skipped (fork PRs).
if: always() && needs.build.result != 'skipped'
if: always() && needs.inputs.result != 'skipped'
steps:
- name: Fail if any check failed
env:
Expand Down
2 changes: 1 addition & 1 deletion content/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please contact us with any questions at [info@forrt.org](mailto:info@forrt.org)

We have not appointed a data protection officer.

## Summary
## Policy summary

- Google Analytics runs only if you allow it.
- Videos, forms, calendars and teaching activities load only if you click to load them.
Expand Down
Loading
Loading