Skip to content

Commit b84fedd

Browse files
authored
Events aggregator (#325)
* feat(events): add campus event aggregator (feeds + calendar embed) * ci: run aggregator in build/deploy and add source health check * feat(events): swap Teamup for self-hosted calendar + subscribe links * fix(ci): run PR check on Node 24 and make events test runner node-version-proof * ci(pr): install Chrome for Puppeteer so pa11y a11y step can run on Node 24 * ci(pr): skip Puppeteer auto-download, install Chrome explicitly (fix partial-browser pa11y failure) * ci(pr): scope PUPPETEER_SKIP_DOWNLOAD to npm ci only so explicit Chrome install runs * ci(pr): use the runner's system Chrome for pa11y instead of Puppeteer's download * events: remove all-events subscription (confusable with network-wide) * events: refine popover to use site brand colors) * events: remove redundant link * events: theme the embed to match the site (font, colors, dark mode) - Render the calendar + popover in the site font (Atkinson Hyperlegible); aggregate-events.js vendors the woff2s to /fonts/ since MyST hashes static/ - Move every calendar + popover color onto :root variables (event tiles included) so the palette lives in one place - Add prefers-color-scheme dark mode mirroring the site's dark palette - Drop the stray internal scrollbar (overflow: hidden); the iframe is auto-sized to its content, so it never needs one * events: don't vendor the embed font (it forced Atkinson site-wide) The prior commit vendored Atkinson to /fonts/, which also satisfied the site's own (previously-broken) @font-face and forced Atkinson across the whole site. Drop the vendoring and the embed @font-face; the embed now mirrors the site's font declaration with no webfont, falling back to the reader's sans-serif like the rest of the site.
1 parent 86cdd13 commit b84fedd

17 files changed

Lines changed: 1800 additions & 14 deletions

.github/workflows/deploy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
branches: [main]
6+
# Rebuild on a schedule so the aggregated event feeds (built by `make html`)
7+
# stay current with upstream campus calendars even when no one pushes for a
8+
# while.
9+
schedule:
10+
- cron: "0 */12 * * *" # every 12h
611
workflow_dispatch:
712

813
permissions:
@@ -19,6 +24,7 @@ jobs:
1924
# Do not attempt to deploy documentation on forks
2025
if: github.repository_owner == 'UC-OSPO-Network'
2126
runs-on: ubuntu-latest
27+
timeout-minutes: 10
2228
steps:
2329
- uses: actions/checkout@v4
2430

.github/workflows/pr.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,24 @@ jobs:
2121

2222
- uses: actions/setup-node@v4
2323
with:
24-
node-version: 20
24+
node-version: 24
2525
cache: npm
2626

27+
# Puppeteer's own Chrome download is unreliable on the runner (it lands only
28+
# partially, or the install no-ops), so skip it everywhere...
29+
- run: npm ci
30+
env:
31+
PUPPETEER_SKIP_DOWNLOAD: "true"
32+
33+
# ...and point pa11y/Puppeteer at the Chrome the ubuntu image already ships.
34+
- name: Point Puppeteer at the runner's system Chrome
35+
run: |
36+
CHROME="$(command -v google-chrome || command -v google-chrome-stable || command -v chromium-browser || true)"
37+
echo "Using Chrome at: ${CHROME:-<none found>}"
38+
test -n "$CHROME"
39+
"$CHROME" --version
40+
echo "PUPPETEER_EXECUTABLE_PATH=$CHROME" >> "$GITHUB_ENV"
41+
2742
- run: make check
43+
env:
44+
PUPPETEER_SKIP_DOWNLOAD: "true"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Validate event sources
2+
3+
# Source-health alert for the campus event aggregator. Runs on a schedule and
4+
# fails loudly (red run + GitHub notification) if any campus feed breaks, so a
5+
# campus can't silently drop off the calendar.
6+
#
7+
# This does NOT deploy anything. Refreshing the live feeds is handled by the
8+
# scheduled run in deploy.yml (which rebuilds and redeploys to GitHub Pages).
9+
10+
on:
11+
schedule:
12+
- cron: "0 */12 * * *" # every 12h
13+
workflow_dispatch: {}
14+
15+
jobs:
16+
validate:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 10
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: "24"
24+
cache: "npm"
25+
- run: npm ci
26+
# Exits non-zero (failing the run) if any source errors.
27+
- run: npm run validate-events

Makefile

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help install html serve clean lint a11y check
1+
.PHONY: help install html serve clean lint a11y test check
22
.DEFAULT_GOAL := help
33

44
help:
@@ -11,15 +11,23 @@ html: ## Build MyST site in ./_build/html
1111
html: install
1212
npx myst build --html
1313
node scripts/generate-feed.js
14+
node scripts/aggregate-events.js
1415

1516
serve: ## Serve MyST site locally (live reload)
1617
serve: install
1718
npx myst start
1819

1920
lint: ## Check for broken links in the built site
2021
lint: html
21-
npx linkinator ./_build/html/
22-
22+
npx linkinator ./_build/html/ --skip /events-embed.html
23+
24+
# Accessibility. The embed (/events-embed.html) is not in the sitemap, so it is
25+
# audited separately below with `pa11y`. The --ignore'd codes are
26+
# FullCalendar-internal ARIA issues in its table markup that we cannot fix
27+
# without patching the library (fullcalendar/fullcalendar #7707, #7568, #6526).
28+
# Ignoring them is safe: the calendar was manually verified to be
29+
# keyboard-operable (Tab to an event, Enter opens its details popover), so the
30+
# ignores do not mask a real keyboard barrier.
2331
a11y: ## Run accessibility checks against the built site
2432
a11y: html
2533
npx serve _build/html -p 4117 & \
@@ -28,10 +36,19 @@ a11y: html
2836
timeout 30 bash -c 'until curl -s http://localhost:4117 > /dev/null; do sleep 1; done'; \
2937
npx pa11y-ci --sitemap http://localhost:4117/sitemap.xml \
3038
--sitemap-find 'http://localhost:[0-9]+' \
31-
--sitemap-replace 'http://localhost:4117'
32-
33-
check: ## Run full build + lint + accessibility (same as CI)
34-
check: lint a11y
39+
--sitemap-replace 'http://localhost:4117' && \
40+
npx pa11y --standard WCAG2AA \
41+
--ignore "WCAG2AA.Principle1.Guideline1_3.1_3_1.F92,ARIA4" \
42+
--ignore "aria-prohibited-attr" \
43+
--ignore "role-img-alt" \
44+
http://localhost:4117/events-embed.html
45+
46+
test: ## Run unit tests (no build needed)
47+
test: install
48+
npm test
49+
50+
check: ## Run unit tests + full build + lint + accessibility (same as CI)
51+
check: test lint a11y
3552

3653
clean: ## Remove built files
3754
clean:

events/index.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ title: Events
44

55
## Calendar
66

7-
<iframe title="UC OSPO Network event calendar" src="https://teamup.com/ksm2uwujdk3osj73h9?tz=Calendar%20default&showProfileAndInfo=0&showSidepanel=1&showViewHeader=1&showAgendaDetails=0&showDateControls=1&showDateRange=1" style="width: 100%; height: 800px; border: 1px solid #cccccc" loading="lazy" frameborder="0"></iframe>
7+
<iframe title="UC OSPO Network event calendar" src="/events-embed.html?v=6" loading="lazy"></iframe>
88

9-
:::{tip}
10-
Please note: if you add an event from the embedded calendar above, it will default to "Does not repeat". If you'd like to add all instances of a recurring event, please use the .ics file or the "Add to your Google calendar" button for the event below.
11-
:::
9+
## Subscribe
10+
11+
Add UC OSPO events to your own calendar app (Google, Apple, Outlook). Subscribe to as many feeds as you like:
12+
13+
- [**Network-wide events**](https://ucospo.net/feeds/network.ics) (all-campus meetups and network-level events)
14+
- By campus:
15+
- [**UC Davis**](https://ucospo.net/feeds/davis.ics)
16+
- [**UC Santa Barbara**](https://ucospo.net/feeds/ucsb.ics)
17+
- [**UC Berkeley**](https://ucospo.net/feeds/berkeley.ics)
18+
- [**UC San Diego**](https://ucospo.net/feeds/ucsd.ics)
19+
- [**UC Santa Cruz**](https://ucospo.net/feeds/ucsc.ics)
1220

1321
## Upcoming Events
1422

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[build]
55
publish = "_build/html"
6-
command = "npm ci && npx myst build --html && node scripts/generate-feed.js && npx linkinator ./_build/html/"
6+
command = "npm ci && npx myst build --html && node scripts/generate-feed.js && node scripts/aggregate-events.js && npx linkinator ./_build/html/ --skip /events-embed.html"
77

88
[context.deploy-preview]
99
ignore = "false"

0 commit comments

Comments
 (0)