Hoist the GitHub stats into one shared constant - #134
Merged
guanzhousongmicrosoft merged 1 commit intoAug 3, 2026
Conversation
The star and fork counts were hardcoded independently in app/page.tsx and app/ai/page.tsx with no shared constant, so they drifted: the homepage said 3.2k+ stars and 200+ forks while /ai said 3.4k+ and 240+. Both sections render adjacent copy about the project being built in the open, so a visitor moving between the two pages saw two different star counts. Neither figure was false - the + suffix covers the actual 3423 stars and 248 forks - but nothing stopped the next refresh from updating one page and leaving the other behind, which is exactly what happened when the AI page was refreshed in documentdb#121. Both pages now read from app/services/projectStats.ts, which also holds the TSC member and organization counts quoted on both pages (verified against upstream MAINTAINERS.md: 11 members across Microsoft 4, Amazon 4, AB InBev 1, Rippling 1, YugabyteDB 1). Values stay hardcoded rather than fetched so the build keeps no network dependency; the refresh command and the date last checked are recorded next to them. Addresses the second half of documentdb#128. The create_indexes_background row in the first half is content in documentdb/docs and needs a separate PR there.
guanzhousongmicrosoft
approved these changes
Aug 3, 2026
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.
Addresses the second half of #128 (the GitHub stats). The
create_indexes_backgroundrow in the first half is content indocumentdb/docsand needs a separate PR there — see the note at the bottom.Problem
The star and fork counts were hardcoded independently in two files with no shared constant, so they drifted apart:
app/page.tsxapp/ai/page.tsx3.2k+3.4k+200+240+Both render in adjacent sections — "Built in the open" on
/and "Built in the open, backed by a real ecosystem" on/ai— so a visitor moving between the two pages sees two different star counts for the same repository.Worth being precise about severity: neither figure is false. The
+suffix covers the actual numbers in both cases. The defect is that nothing stopped a refresh from updating one page and leaving the other behind, which is exactly what happened when #121 refreshed the AI page.Fix
Both pages now read from
app/services/projectStats.ts. The TSC member and organization counts are hoisted too — they are quoted on both pages and currently agree, so this keeps them from being the next thing to drift. They were verified against upstreamMAINTAINERS.md: 11 members across Microsoft (4), Amazon (4), AB InBev (1), Rippling (1), YugabyteDB (1).Values stay hardcoded rather than fetched at build time, so the build keeps no network dependency on a rate-limited unauthenticated API. The refresh command and the date last checked are recorded in the file so the next update is a one-line change in one place.
No rendered output changes on
/ai;/picks up the newer figures.Not in this PR
§1 of the issue — the
create_index_backgroundtable row being wrong in name, schema, and description — lives inpostgres-api/functions.mdindocumentdb/docs.articles/is a gitignored build artifact here, cloned at build time percontent.config.json, so the fix cannot land in this repo. I confirmed the upstream definition while validating:create_index_background--0.111-0.sqldefinescreate_indexes_background(plural) under__API_SCHEMA_V2__, whichMakefile:28resolves todocumentdb_api, notdocumentdb_api_internal. Happy to open that PR next.npm is blocked on this machine, so lint and the build are left to CI. The change is a constant extraction with no logic.