Skip to content

Resolve library repos from infra's libraries.yaml - #91

Open
partouf wants to merge 1 commit into
mainfrom
library-repos-from-infra-yaml
Open

partouf wants to merge 1 commit into
mainfrom
library-repos-from-infra-yaml

Conversation

@partouf

@partouf partouf commented Sep 20, 2026

Copy link
Copy Markdown
Member

The commit link and the "more commits" list on /cpp_library_build_results were driven by a two-entry if/else (fmt, beman_iterator_interface); every other library linked to github.com/notsupported/notsupported.

What this does

library-repos.js reads infra's libraries.yaml and resolves a library id to its upstream repo, inheriting repo/type down the nested groups (beman, nightly) and expanding the small jinja2 subset the repo: values actually use today (context[-1], optionally through replace).

Checked against the 200 C++ libraries CE currently lists: 179 resolve. The 21 that don't (boost, qt, zlib, openssl, llvm, …) are tarballs entries with no repo: in the yaml, so there is nothing to link to — those render the commit hash as plain text instead of a dead link, and the "more commits" section is left out entirely.

Resolution is version-aware, because one library's versions can come from different repos: proxy builds <= 4.0.1 from microsoft/proxy and 4.0.2+ and trunk from ngcpp/proxy. Verified correct at all 11 of its versions.

The map is refreshed on startup and on /reinitialize, both non-fatally — a missing repo map only costs us a link — and the fetch is bounded by a 10s timeout so a hung connection to raw.githubusercontent can't hold the listen socket back.

Also in here

  • gh-commits.js reads the repo from data-* attributes on .more-commits instead of the window globals a generated inline script used to set. That also gets the library name and version, both route parameters, out of an unescaped <script> body.
  • jQuery, the module and the commit list are only emitted for GitHub-hosted libraries.
  • /downloadpkg's five-argument form did res.send(404), i.e. HTTP 200 with a body of 404; it now sends the status.
  • docs/api.md gains the download, build-failure/log and service endpoints, plus the /libraries/<lang> and bulk /annotations routes.
  • buildslogs.db is gitignored.

Testing

No test harness in this repo, so: npx eslint index.js library-repos.js is clean, a live refresh() against infra parses (196 C++ ids) and a blackholed host rejects after 10.0s rather than hanging, and the full id→repo mapping was diffed against godbolt.org/api/libraries/c++.

🤖 Generated with Claude Code

The commit link and the "more commits" list on the build results page were
driven by a two-entry if/else (fmt, beman_iterator_interface); everything else
linked to github.com/notsupported/notsupported.

Add LibraryRepos, which reads infra's libraries.yaml and resolves a library id
to its upstream repo, inheriting repo/type down the nested groups and expanding
the small jinja2 subset the repo values actually use. 179 of the 200 C++
libraries CE lists now resolve; the rest are tarball entries with no repo in the
yaml, and those render the hash as plain text rather than a dead link.

Resolution is version-aware, because a library's versions can come from
different repos: proxy builds <= 4.0.1 from microsoft/proxy and the rest from
ngcpp/proxy.

The map is refreshed on startup and on /reinitialize, both non-fatally - a
missing repo map only costs us a link - and the fetch is bounded by a timeout so
a hung connection cannot hold the listen socket back.

While in here:

- gh-commits.js takes the repo from data-* attributes on .more-commits instead
  of the window globals a generated script used to set, which also gets the
  library name and version out of an unescaped script body.
- The GitHub-only part of the page (jQuery, the module, the commit list) is only
  emitted for GitHub-hosted libraries.
- /downloadpkg's five-argument form sent `404` as a 200 body; send the status.
- Document the download, build failure/log and service endpoints in docs/api.md.
- Ignore the local buildslogs.db.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant