Repository navigation
fix: resolve release calendar date at build time and add render tests - #566
Closed
Alex Iannicelli (atiannicelli) wants to merge 4 commits into
Closed
Alex Iannicelli (atiannicelli) wants to merge 4 commits into
Alex Iannicelli (atiannicelli) wants to merge 4 commits into
Conversation
Add static/release-calendar.json and its JSON Schema, render the release schedule and history from it, and replace hardcoded release versions in docs examples with the __OVERTURE_RELEASE placeholder. Rename the 2024 release notes posts to the standard filename and redirect their old paths. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: John McCall <john@overturemaps.org>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: John McCall <john@overturemaps.org>
Remove an extra blank line in ibis.mdx, render TBD for a null schemaVersion in the history table, validate release dates with the date format, and drop the stale tutorial pinning example from CONTRIBUTING. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: John McCall <john@overturemaps.org>
Follow-up to #565 addressing the three should-fix items from the deep-dive review. - Compute today's date once in docusaurus.config.js (buildDate) and expose it via customFields so ReleaseCalendar.jsx splits shipped/upcoming with the same date on the server and in the browser, avoiding a hydration mismatch once a scheduled release date passes before the site is rebuilt. splitReleases now requires today explicitly. - Collapse ReleaseTable's render props into a single renderer; upcoming rows naturally have no notes post or schema link, so both tables render the same way. The major-change footnote only renders when an upcoming row carries it. - Add RTL render tests for ReleaseSchedule/ReleaseHistory and the CodeBlock swizzle (renamed to index.jsx so vitest can parse it), with vitest aliases and mocks for @docusaurus/useDocusaurusContext, @docusaurus/Link and @theme-original/CodeBlock. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Alex Iannicelli <atiannicelli@gmail.com>
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
Contributor
Author
|
bad A.I. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull Request
Summary
Stacked on #565 (
feat/release-calendar-json), with suggested fixes for the three "should fix" items from the deep-dive review of that PR. Intended to be merged into the feature branch (or cherry-picked by John McCall (@lowlydba)) before #565 lands.Refs #565, #525, OvertureMaps/ops-team#588
Changes
1. Resolve "today" at build time, not in the browser (
docusaurus.config.js,src/releaseCalendar.js,src/components/ReleaseCalendar.jsx)ReleaseCalendar.jsxcalledsplitReleases(calendar.releases)at module scope, which defaultedtodaytonew Date(). That runs once during SSR and again in the browser, so once a scheduled release date passes before the next deploy the client splits the rows differently from the server-rendered HTML and React warns on hydration. The config now computesbuildDateonce, uses it for the STAC fallback, and exposes it viacustomFields(same mechanism asreleaseNoteDates). The component reads it through auseReleases()hook.splitReleasesnow requirestodayexplicitly; the existing unit tests already passed it.2. Add render tests for the new React code (
vitest.config.mjs,src/__mocks__/*,src/components/__tests__/ReleaseCalendar.test.jsx,src/__tests__/codeBlock.test.jsx)Follows the existing RTL pattern (
SmartTable.test.jsx,CommunityTable.test.jsx) and the existing@docusaurus/useBaseUrlalias-to-mock approach. Adds aliases + mocks for@docusaurus/useDocusaurusContext(withsetCustomFields()for tests),@docusaurus/Link, and@theme-original/CodeBlock. The calendar JSON is replaced with a small fixture viavi.mockso the tests exercise ordering, the shipped/upcoming boundary (including a release dated onbuildDate), the*marker and footnote,TBD, release-notes links (shared by patch releases), and the pre-1.0 schema-link rule. The CodeBlock swizzle is renamedindex.js→index.jsxso vitest can parse its JSX (Docusaurus resolves either extension); its tests cover placeholder replacement, non-string children pass-through, and prop forwarding.3. Collapse
ReleaseTablerender props into one renderer (src/components/ReleaseCalendar.jsx)releaseNotesPath()returnsnullfor versions with no notes post andschemaLink(null)isnull, so upcoming rows naturally render without links — one renderer serves both tables. This also removes the inconsistency where the history table wrappedTBD/schema in<code>and the schedule didn't. The "*reserved for quarterly major breaking change release" footnote now only renders when an upcoming row is actually markedmajorChangeMonth.Not included (left as "consider" items in the review): cwd-relative
readdirSync('blog'), themajorChangeMonth: falseentries in the JSON, and the duplicated JSON mention inrelease-calendar.mdx.Testing
npm test(vitest run)npm run lintnpx prettier --check <changed files>src/__mocks__/docusaurus-useBaseUrl.jsalready fails on the base branch; not touched)npm run build[SUCCESS] Generated static files;build/release-calendar/index.htmlrenders footnote, 3×TBD, 28 schema links, 28 notes links;__OVERTURE_RELEASEresolved to2026-09-23.1in all 5 example pages (wherobots, spark, sedona, pandas, ibis) with 0 unresolved placeholders