Repository navigation
feat(events): derive the events section from per-event pages (ADR 0012) - #2037
Conversation
✅ Deploy Preview for endusers ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
The required "End-to-end coverage" check fails deterministically at this head — source line coverage 99.92% against the 100% gate — and it will fail on every re-run, because two new lines are unreachable in any e2e build of the authored tree. From the run's own report (artifact e2e-coverage, run 41203899322, report.txt): src/components/EventsIndex/index.js | 97.67 | 94.12 | 21 63.
src/components/EventsIndex/index.js:21— thedayLabelternary consequentString(from.getUTCDate())is taken only for a single-day or cross-month/cross-year event. Both event pages on this branch (2025 Nov 10–13, 2026 Nov 9–12) are multi-day within one month, so no build executes that line.src/components/EventsIndex/index.js:63— the empty-statereturn <p>No events have been announced yet.</p>can never run: the plugin readsdocs/events/<year>/from the real site dir, which is non-empty on this branch.
The ADR 0007 accepted-regions registry won't absolve these: tests/tools/e2e-coverage-report.mjs computes uncoveredLines directly from line counts (≈ lines 989–996) before accepted entries are matched — acceptance drops a span from the region denominator only, and the failing gate here is --check-source 100 (lines). The existing escape hatch for exactly this shape is the fixture machinery (E2E_FIXTURE_DOCS_PLUGIN / endusersE2EDataFixtures in docusaurus.config.js:211–237), but no fixture was added for EventsIndex; the alternative is to drop the unreachable branches (the single-day/cross-month collapse and the empty state) until content can exercise them. formatDateRange's single-day/cross-year arms (src/components/shared/formatDate.js regions 42, 43, 46) are similarly unexercised but only dent the region score, which still clears 96.
Everything else I read looks correct:
scripts/lib/events-catalog.mjsvalidation is sound; theyamlpackage's default YAML 1.2 core schema keeps unquotedstart: 2026-11-09a string (unlike js-yaml's default), soisCalendarDate'stypeofcheck and the string comparisons all hold against the actual front matter indocs/events/2025/kubecon-na.mdanddocs/events/2026/kubecon-na.md.- The index and sidebar genuinely cannot disagree:
sidebars.jsandsrc/plugins/events-catalog.mjsboth consumegroupByYear(collectEvents(...)), and a malformed page throwsEventPageErrorat config load, failing the build with the page named. tests/e2e/events.spec.jsderiving expectations from the pages (with its own restated ordering rule) matches the awards.spec.js pattern and will cover new event pages on arrival.
The PR body's "e2e specs (165 pass)" is accurate for the test lane but doesn't extend to the coverage lane, which is what blocks the merge. Once lines 21/63 are either exercised by a fixture or removed, this looks ready to me. I have not approved or closed anything — flagging for the author.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
a7b761c to
fef4128
Compare
|
Rebased onto #2035 and pushed a follow-up commit (fef4128) addressing the failing "End-to-end coverage" check:
The full coverage lane passes locally with the CI thresholds (439 e2e tests, source lines 100%, no stale accepted regions); unit coverage, mutation (100 on the two touched files), lint, knip, duplication and the production build are green. |
… section Records the design for reworking /events into one page per event under docs/events/<year>/, with the index and sidebar derived from event front matter by a single Node library at build time, and no Upcoming/Past split. Status is Proposed until the implementation lands. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Rework /events per ADR 0012. Each event is now its own page at docs/events/<year>/<slug>.md carrying an event: front matter block (start, end, location, url). scripts/lib/events-catalog.mjs is the one reader of those blocks; sidebars.js builds the year-grouped events sidebar from it (newest year first, only the newest expanded) and the new src/plugins/events-catalog.mjs plugin publishes the same groups as global data for the EventsIndex component, which renders the latest year's events on the index, newest first, with links to earlier years. The two existing events (KubeCon NA 2025 and 2026) move onto their own pages, taking the Michelin award photo and the end user talk schedule with them. The Events navbar item becomes a docSidebar entry. Also: formatDateRange() in shared/formatDate.js; a useGlobalData test stub; the events suites join the content-only CI focused list and the 2026 page joins the data-backed set; src/plugins/** gets Node globals in ESLint; the plugin tolerates knip's argument-less invocation; AGENTS.md and the doc-authoring skill describe how to add an event page. ADR 0012 moves from Proposed to Accepted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
…ge lane The End-to-end coverage check requires every file under src/ to be measured in the browser and every source line to be covered. The events plugin lived in src/plugins/ but runs only in Node at build time, and the empty state, start-day-only calendar block and single-day and cross-year range text in EventsIndex and formatDateRange() are unreachable from the published event pages, which are all multi-day events within one month. - Move the plugin to scripts/lib/events-catalog-plugin.mjs beside the reader it wraps. - Split EventsIndex into a default export that reads the plugin data and a hook-free EventsCatalog that renders a years array, so a fixture page can hand it shapes the published catalog never holds. - Add tests/e2e/fixtures/docs/events-catalog.mdx and a coverage-gated spec that render the empty catalog and single-day, cross-month and cross-year events; register the spec with the describe-gate guard. - Accept formatDateRange's unparseable-date guard as a data-shape region; scripts/lib/events-catalog.mjs rejects such pages at build time. - Rebase onto cncf#2035 and move tests/events-index.test.mjs onto the focused document-only path instead of listing events-page.test.mjs in FULL_PATH_ONLY, so the two PRs no longer disagree about that suite. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
fef4128 to
52d7e93
Compare
There was a problem hiding this comment.
Read the full tree at pr2037 (head 52d7e93), not just the diff. This looks correct to me; no defects found.
What I verified:
- Front matter contract holds end to end.
scripts/lib/events-catalog.mjsreusessplitFrontMatterfromarchitecture-frontmatter.mjs, which parses with theyamlpackage's default YAML 1.2 core schema — I confirmedparse('start: 2026-11-09')yields the string"2026-11-09", not a Date, so the lexicographicevent.end < event.startcheck (events-catalog.mjs:97) andcompareEvents()'s string ordering are sound.isCalendarDate()'s UTC round-trip correctly rejects2026-02-30-style dates. - Index and sidebar cannot disagree, as ADR 0012 claims:
sidebars.js:40andscripts/lib/events-catalog-plugin.mjsboth consumecollectEvents()/groupByYear()from the single reader, andtests/events-sidebar-contract.test.mjspins the shape (index first, newest year expanded). - Both event pages validate against the contract: year directories match
event.start(2025/2026), URLs are absolute,end >= start. - Heading-level change in
EndUserTalkSchedule(h5→h3, h6→h4) is right in the new context: the schedule now renders under the event page's## End User talksrather than the old index's deeper nesting, so h3/h4 restores a correct outline. - Base #2035 has merged (main @ 01ceee8), so the "merge that first" note in the body is resolved; the branch carries the focused-path choice for
tests/events-page.test.mjsas described, anddocs/events/2026/kubecon-na.mdjoinsDATA_BACKED_DOCUMENTS(content-only-ci.mjs:23).
One dev-ergonomics note, not a defect: getPathsToWatch() reloads the plugin's global data when an event page changes, but the sidebar in sidebars.js is computed at config load, so a newly added event appears in the dev-server index before it appears in the sidebar until restart. Production builds are unaffected.
All checks are green (unit coverage, mutation, e2e, e2e coverage). Approval itself is a maintainer's signature — leaving that to a human.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
…e rules (cncf#2040) ADR 0012 (cncf#2037) made events a multi-page section with a sidebar derived from event front matter; AGENTS.md was updated in that commit but the parallel bullet in CONTRIBUTING.md was missed. Fixes cncf#2039 Signed-off-by: guide <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: guide <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Summary
Reworks
/eventsso the index shows the latest year's events, newest first, and every event is listed in a year-grouped sidebar (newest year first, only the newest expanded), per the new ADR 0012, which this PR adds and marks Accepted.Remit: end users of
/eventsget one page per event, a year-ordered sidebar listing every event, and an index that always shows the most recent year rather than a hand-maintained Upcoming/Past split.docs/events/<year>/<slug>.mdwith anevent:front matter block (start,end,location,url). KubeCon NA 2025 and 2026 move onto their own pages, taking the Michelin award photo and<EndUserTalkSchedule />with them.scripts/lib/events-catalog.mjsis the one reader of those blocks: it validates them (ISO calendar dates,end >= start, year directory matchesstart, absolute http(s) url) and sorts latest first.sidebars.jsbuilds the events sidebar from it; the Events navbar item becomes adocSidebarentry.scripts/lib/events-catalog-plugin.mjspublishes the same groups as global data (it lives beside the reader rather than undersrc/because the browser coverage lane requires everysrc/**file to be measured in the browser, and the plugin runs only in Node).src/components/EventsIndexreads it and hands the years to a hook-freeEventsCatalog, which renders the latest year with a decorative calendar block,<time>range and location, and links to earlier years.tests/e2e/fixtures/docs/events-catalog.mdxand a coverage-gated spec renderEventsCatalogwith the empty catalog and single-day, cross-month and cross-year events, shapes the published pages never hold;formatDateRange()'s unparseable-date guard is an accepted data-shape region (ADR 0007), sinceevents-catalog.mjsrejects such pages at build time.formatDateRange()joinsshared/formatDate.js; the events suites join the content-only CI focused list anddocs/events/2026/kubecon-na.mdthe data-backed set (ADR 0011).Based on #2035, which it includes; merge that first. The two PRs disagreed about
tests/events-page.test.mjs(#2035 listed it inFULL_PATH_ONLY, this PR puts the events suites on the focused path); this branch now carries the focused-path choice and drops theFULL_PATH_ONLYentry.Verification
npm run check:format,check:spelling,check:lint,check:unused,check:duplication, markdownlint on the changed documentsnpm run test:unit:coverage:check(all gates met; src 100% lines and regions)npm run test:mutation -- --mutate scripts/lib/events-catalog.mjs,src/plugins/events-catalog.mjs,src/components/EventsIndex/index.js,src/components/shared/formatDate.js: 92.31 initially, 95.36 after tightening; the remaining survivors are equivalent mutants (the Date round-trip subsumes the regex guard;<vs<=under a!==check). After the follow-up commit,--mutate scripts/lib/events-catalog-plugin.mjs,src/components/EventsIndex/index.jsscores 100.npm run build:production, thenevents,events-catalog-fixture,end-user-talk-schedule,navigation,practitioners-home,accessibility,docs-routesandsearche2e specsbuild:e2e:coverage,test:e2e:coverage, 439 pass,report:e2e:coveragewith the CI thresholds and--require-source-files): source lines 100%, no stale accepted regionsChecklist
CONTRIBUTING.md)
git commit -s)