[#26] Publish the last release of each previous major line as an older version - #31
Conversation
maximthomas
left a comment
There was a problem hiding this comment.
praise: The extension publishes the tags without dragging their API docs or their version: ~ into the build.
extractTagarchives only${startPath}/antora.ymland${startPath}/modules(lib/versions-from-tags.js:84), so the 18,672 API-doc files ofOpenAM-15.2.2never reach the content catalogue.- The version comes from the tag name (
TAG_RX,lib/versions-from-tags.js:38,:58-59), so a tag cannot merge into the unversionedmastercomponent version. - The missing-tag fetch adds
--depth=1only in a shallow repository (lib/versions-from-tags.js:80-81), and the temp repository is removed in afinally(:64-66).
question (non-blocking): Is #28's baseline gate meant to land as written? It cannot key errors from the random temp path the tag content is read from.
lib/versions-from-tags.js:48, :56, :65, :89
fs.mkdtempSync(os.tmpdir()/antora-tags-) gives each run a new directory, and Antora logs tag content with that absolute file.path, source.refname = the temp repo's default branch (main/master) and reftype branch; the directory is deleted before anyone reads the log. #28's check.sh keys errors as .file.path | ltrimstr("$root/"), which cannot strip a temp path: at this head the OpenIG-5.3.2 copy of sec-release-levels.adoc:20 ("level 0 sections can only be used when doctype is book") gets a new key on every run, so with both PRs merged the gate fails every build and --update cannot baseline it. If #28 lands first unchanged, this PR cannot pass the gate without the change below; otherwise it is a diagnostics fix.
const tmpdir = ospath.join(playbook.dir, 'build', 'antora-tags')
fs.rmSync(tmpdir, { recursive: true, force: true })
fs.mkdirSync(tmpdir, { recursive: true })Also, in extractTag, git(worktree, 'init', '-q', '-b', tag) (git ≥ 2.28) so refname names the tag; os is then unused.
suggestion (non-blocking): A tag missing both locally and on origin aborts the build with git's bare "couldn't find remote ref".
lib/versions-from-tags.js:76-82
In a clone whose origin is a fork created before the tags were pushed (maximthomas/doc.openidentityplatform.org has none: git ls-remote --tags), npm run build now stops at the first tag source with fatal: couldn't find remote ref refs/tags/OpenDJ-4.10.2; the same clone built at the base. CI is unaffected — its origin is the upstream, which has all four tags. Failing hard is right (a skip would publish without the older versions); the message can say what to do.
try {
git(repo, 'fetch', '-q', '--no-tags', ...(shallow ? ['--depth=1'] : []), 'origin', `+refs/tags/${tag}:refs/tags/${tag}`)
} catch (err) {
throw new Error(`tag ${tag} is neither in ${repo} nor on its origin; run ` +
`git fetch https://github.com/OpenIdentityPlatform/doc.openidentityplatform.org tag ${tag}\n${err.stderr || err.message}`)
}issue (non-blocking): The temp-repo commit runs the developer's global git hooks.
lib/versions-from-tags.js:91-92
Only user.name, user.email and commit.gpgsign are overridden, so a global core.hooksPath (or init.templateDir) hook runs on git commit -m OpenAM-15.2.2. A conventional-commit commit-msg hook rejects that message, execFileSync throws and the local build aborts — reproduced with a global core.hooksPath and a commit-msg hook that exits 1. CI runners have no global hooks.
git(worktree, '-c', 'user.name=antora', '-c', 'user.email=antora@localhost', '-c', 'commit.gpgsign=false',
'-c', 'core.hooksPath=/dev/null', 'commit', '-q', '-m', tag)issue (non-blocking): tar -x reads the archive from stdin without -f -.
lib/versions-from-tags.js:88
bsdtar's default archive is system-dependent (/dev/sa0 on FreeBSD; Windows tar.exe is bsdtar), and both tars honour $TAPE: with TAPE set, macOS bsdtar 3.5.3 exits 1 ("Failed to open …") and the build aborts. The runner's GNU tar works.
execFileSync('tar', ['-x', '-f', '-', '-C', worktree], { input: archive })…missing-tag error, no hooks, tar -f - - lib/versions-from-tags.js: extract the tags into build/antora-tags/<tag> instead of a random mkdtemp directory, so that the file paths Antora logs for tag content are stable and can be listed in .github/build-baseline (OpenIdentityPlatform#28); name the temp branch after the tag - fail with a hint when a tag is neither local nor on origin (e.g. a fork created before the tags were pushed) - commit in the temp repository with core.hooksPath=/dev/null, so global hooks of the developer cannot abort the build - tar -x -f -: read the archive from stdin explicitly instead of $TAPE
bfc67ec to
e76cba2
Compare
|
@maximthomas all four points are taken in e76cba2; the branch is also rebased onto the current question — the gate of #28 and the temp path: fixed here, as suggested. The tags are extracted into so suggestion — missing tag: the fetch is wrapped; the build still fails, now with issue — global hooks: the commit runs with issue — |
maximthomas
left a comment
There was a problem hiding this comment.
praise: All four round-1 points are fixed where the defects were, and the remaining known gap is now stated.
- Tags go to a fixed
build/antora-tags/<tag>, and the temp repo is created withinit -q -b <tag>(lib/versions-from-tags.js:49,:100), so the baseline of #28 gets the same path and refname on every run. -c core.hooksPath=/dev/nullon the temp commit (:104) andtar -x -f -(:98).- The
openam/15.2→openam/15.2/apidocslinks and the merge order with #28 are in the description.
suggestion (non-blocking): Every failure of the tag fetch is reported as "tag X is neither in nor on its origin".
lib/versions-from-tags.js:86-89
The catch around the fetch at :85 rethrows any error with that first line. actions/checkout@v4 in publish.yml is shallow and fetches no tags, so CI always takes this fetch. A transient network or GitHub failure (reproduced with origin set to an unreachable URL: git says "Couldn't connect to server") then opens with a false cause and suggests a fetch that fails the same way. Git's own error is on the next line, so nothing is lost; only the first line is wrong.
} catch (err) {
// e.g. a fork created before the tag was pushed, or no network
throw new Error(`cannot fetch tag ${tag} from the origin of ${repo}; if the tag is missing there, run ` +
`git fetch https://github.com/OpenIdentityPlatform/doc.openidentityplatform.org tag ${tag}\n${err.stderr || err.message}`)
}nitpick (non-blocking): The new CDDL headers say "Portions Copyright 2026 3A Systems, LLC." in files that had no earlier copyright holder.
antora-playbook.yml:13, lib/add-pdf-link.js:14, opendj/antora.yml:13, openidm/antora.yml:13, openig/antora.yml:13
None of the five has a copyright line on master (git show b9afee40cc:<file> | grep -i copyright is empty), so "Portions" implies a holder that does not exist. This is the wording already corrected on antora-playbook.yml in the #29 review. The new lib/versions-from-tags.js:14 already has the right form.
# Copyright 2026 3A Systems, LLC.- antora-playbook.yml: content sources for the tags OpenAM-15.2.2, OpenDJ-4.10.2, OpenIDM-6.3.0 and OpenIG-5.3.2 - lib/versions-from-tags.js: extracts antora.yml and modules/ of each tag and publishes it as version <major>.<minor> (e.g. /openam/15.2/); the branch stays the unversioned latest version, so URLs do not change - <product>/antora.yml: display_version of the branch (16.x, 5.x, 7.x, 6.x) - add-pdf-link.js: PDF links only on the latest version - docsearch/config.json: do not index the older versions Fixes OpenIdentityPlatform#26
…missing-tag error, no hooks, tar -f - - lib/versions-from-tags.js: extract the tags into build/antora-tags/<tag> instead of a random mkdtemp directory, so that the file paths Antora logs for tag content are stable and can be listed in .github/build-baseline (OpenIdentityPlatform#28); name the temp branch after the tag - fail with a hint when a tag is neither local nor on origin (e.g. a fork created before the tags were pushed) - commit in the temp repository with core.hooksPath=/dev/null, so global hooks of the developer cannot abort the build - tar -x -f -: read the archive from stdin explicitly instead of $TAPE
…A copyright in header-less files - lib/versions-from-tags.js: a failed tag fetch no longer claims the tag is missing on origin; the cause (missing tag, no network) is left to git's error on the next line - lib/add-pdf-link.js, <product>/antora.yml: "Copyright 2024-2026 3A Systems, LLC." instead of "Portions Copyright" - these files had no earlier copyright holder, as for the playbook in OpenIdentityPlatform#29
e76cba2 to
01b0766
Compare
|
@maximthomas both points are taken in 01b0766; the branch is rebased onto the current suggestion — the fetch error: the message no longer names a cause: nitpick — "Portions Copyright": changed to A full build at this head: the four older versions are published, the Antora errors are the four of |
maximthomas
left a comment
There was a problem hiding this comment.
praise: Both round-2 points are fixed where they were raised, and the copyright years follow each file's history.
lib/versions-from-tags.js:88-89no longer names a cause ("cannot fetch tag from the origin of ; if the tag is missing there, run …") and still ends with git's stderr. A network failure is no longer reported as a missing tag.Copyright 2024-2026 3A Systems, LLC.inlib/add-pdf-link.js:14and the four*/antora.yml:13matches the year each file was created (2024-10-03 and 2024-09-20,git log --diff-filter=A). The newlib/versions-from-tags.js:14saysCopyright 2026.
…wler (#33) Fixes #25, together with #28 — this PR does item 5, the migration to the current DocSearch; items 1–4 are #28. The front end moves now, on the existing index; the crawler stays the legacy scraper until Algolia Crawler access is set up, for which this PR prepares the configuration. ## Changes - **Front end: `@docsearch/js` 3.9.0** instead of `docsearch.js` 2 (vendored as before, `supplemental-ui/js/vendor/docsearch.min.js` and `supplemental-ui/css/vendor/docsearch.min.css`): - the header shows the DocSearch button, which opens the search modal; shortcuts `Ctrl/Cmd+K` and `/`; - same application, key and index (`doc_openidentityplatform`): the records of the legacy scraper carry the fields the v3 front end reads (`hierarchy.lvl0–6`, `content`, `type`, `url`), so no reindexing is needed; - `transformItems` drops the `#cookie-notice` anchor that the legacy scraper gives to page titles and to the text before the first section (the first id on the page, the cookie notice); - rendered only when the build has both `ALGOLIA_SEARCH_API_KEY` and `ALGOLIA_APP_ID` (the v3 client requires `appId`); otherwise the `SITE_SEARCH_PROVIDER` branch (plain search input), which is kept, or no search. 3.9.0 is the last 3.x; 4.x and 5.x add Ask AI and a side panel, which this site does not use, and are 4–5 times larger (510 KB and 619 KB of JS against 133 KB). - **`docsearch/crawler-config.js`** (new): the same crawl for the [Algolia Crawler](https://www.algolia.com/doc/tools/crawler/) — records only from the product pages, as the `start_urls` of `config.json` (the site home page is crawled for links only), the same exclusions (API docs, generated references, and the older versions of #31) and the same selectors for the hierarchy and the content. Not carried over, because none of it changes the results: the version in lvl0 and the `desc(version)` ranking (every component has `version: ~`), the `component` attribute (nothing reads it) and `min_indexed_level`. It writes a new index, `doc_openidentityplatform_v3`, so the live search is not affected while it is checked. **Not run yet**: it needs Crawler access on the Algolia application (for an open-source site, through the DocSearch program). - **`docsearch/readme.md`**: how the search is set up, and the steps to move to the Crawler. The link it held before (how the index was set up for the legacy scraper) is kept. `publish.yml` and `config.json` are unchanged: the legacy scraper keeps reindexing after every deployment. ## Verification Local build with the public search key of the site, checked in a browser (Playwright): - the DocSearch button is rendered in the header, no console errors; - `Ctrl+K` opens the modal; "session" and "replication" return results from the live index, grouped by product; page titles link to the page with no anchor, and no result URL ends with `#cookie-notice` (in the live index every page-title record does); - a build with only `ALGOLIA_SEARCH_API_KEY` has neither the button nor the DocSearch bundle; - the `pathsToMatch` pattern of `crawler-config.js`, checked with micromatch, matches `/openam` and `/openam/` but not `/`, `/openicf/…` or `/commons/…`; - rebased onto `master` (with #29); merges with #30 and #32 without conflicts (`git merge-tree`).
…arlier holder exists index.adoc and openig/antora.yml had no copyright line before, so "Portions" named a holder that does not exist. Use "Copyright 2024-2026 3A Systems, LLC.", as antora-playbook.yml (OpenIdentityPlatform#29) and OpenIdentityPlatform#31 do; the openig/antora.yml header is now identical to OpenIdentityPlatform#31's, which removes the conflict between the two pull requests.
…leaseversion (#32) Fixes #23 ## Changes - **`ROOT/modules/ROOT/pages/index.adoc`** (start page): under the description of each product, a line with - a shields.io badge of the latest release (e.g. *latest release v16.1.3* for OpenAM), linking to `releases/latest`; - *Releases and downloads* → `github.com/OpenIdentityPlatform/<Product>/releases`; - *Docker images* → `hub.docker.com/r/openidentityplatform/<product>`; - *Security advisories* → `…/security/advisories` for OpenAM, OpenDJ and OpenIDM (OpenIG has no published advisories, so no link). - **`supplemental-ui/partials/header-content.hbs`**: a **Downloads** menu next to Projects, with the release pages of the four products, the Docker Hub organization and the security advisories of OpenDJ, OpenAM and OpenIDM. - **`openig/antora.yml`**: `releaseversion: 5.2.4` removed — no page or UI template uses it (checked in the sources and in the generated site). - **CDDL headers** added to `index.adoc` and `openig/antora.yml` with `Copyright 2024-2026 3A Systems, LLC.`: neither file had a copyright holder before, so this is the same line as `antora-playbook.yml` (#29), and the `openig/antora.yml` header is identical to the one in #31. `header-content.hbs` gets none: it overrides an antora-ui-default partial (MPL-2.0). No version number is written as text: the badge always shows the current release, and the version menus from #31 show the current line (16.x, 5.x, 7.x, 6.x) and the older versions. ## Verification Local Antora build of this branch: - all external links on the start page and in the header return 200; the badge is served as `image/svg+xml`; - the Downloads menu is present on every page (checked on the start page and `openam/admin-guide`); - no new Antora errors; - rebased onto `master` after #29 and #30; the start page keeps the *API Reference (Javadoc)* items from #30 next to the new links. No conflicts with the other open pull requests (`git merge-tree`): `openig/antora.yml` with #31, `header-content.hbs` with #33.
Fixes #26
Publishes the last release of each previous major line as an older version;
masterstays the default version, so no URL changes.master(unchanged URLs)/openam/…, shown as 16.x/openam/15.2/…, 15.2.2 (tagOpenAM-15.2.2)/opendj/…, 5.x/opendj/4.10/…, 4.10.2/openidm/…, 7.x/openidm/6.3/…, 6.3.0/openig/…, 6.x/openig/5.3/…, 5.3.2The version menus of the default UI (component list and the per-page version menu) show the older versions as soon as a component has more than one.
Why an extension (
lib/versions-from-tags.js)Listing the tags as content sources in the playbook is not enough:
antora.ymlof every tag declaresversion: ~, and Antora gives the version inantora.ymlprecedence over the version of the content source, so a tag would be merged into the unversioned component version built frommaster;OpenAM-15.2.2, against 330 pages): the build took 4m14s instead of 43s.The extension replaces
aggregateContent: the branch sources are aggregated as before; for each tag source it extracts only<product>/antora.ymland<product>/moduleswithgit archiveinto a temporary repository underbuild/antora-tags/<tag>(a fixed path, so that the errors Antora logs for tag content can be listed in the baseline of #28), aggregates it separately and sets the version from the tag name (OpenAM-15.2.2→ version15.2, display15.2.2). The build now takes about 1m16s locally. If the tag is missing — as in the shallowactions/checkoutof CI — the extension fetches it fromorigin(with--depth=1in a shallow repository), so no workflow change is needed. If the fetch fails (e.g. a fork created before the tags were pushed, or no network), the build fails with thegit fetchcommand that gets the tag from the upstream, followed by git's own error. The temporary commit runs withcore.hooksPath=/dev/null, so global git hooks of a developer cannot abort the build.Other changes
<product>/antora.yml:display_versionofmaster(16.x, 5.x, 7.x, 6.x).lib/add-pdf-link.js: the "Download PDF" link only on the latest version — the wiki PDFs are built from the current sources.lib/add-pdf-link.js,<product>/antora.yml: CDDL header withCopyright 2024-2026 3A Systems, LLC.— these files had no copyright line; the playbook got the same line in [#24] SEO: declare the sitemap in robots.txt, add description and OpenGraph tags #29.edit_url: false: no "Edit this Page" on older versions.docsearch/config.json: older versions (/<product>/<major>.<minor>/) added tostop_urls, so search does not mix them with the current docs.Verification
Local builds:
masterpages differ from the current build only by the older versions added to the version menus; the start page still links tomaster;master(e.g.…/openam/admin-guide/); no PDF or edit link on older pages;--depth 1clone without tags — the extension fetched the 4 tags and the build succeeded;masterwith [#21] Fix broken JEE agent PDF link and malformed header markup #27 and [#24] SEO: declare the sitemap in robots.txt, add description and OpenGraph tags #29 merged: the only conflict, the copyright line ofantora-playbook.yml, resolved tomaster; merges with [#25] CI: build pull requests and make the site build reproducible #28 without conflicts;--depth 1 --no-tagsclone whoseoriginis unreachable: the build fails withcannot fetch tag OpenDJ-4.10.2 from the origin of …; if the tag is missing there, run git fetch …, then git'sCouldn't connect to server;sec-release-levels.adocerror is logged asbuild/antora-tags/OpenIG-5.3.2/openig/modules/ROOT/partials/sec-release-levels.adocwith refnameOpenIG-5.3.2, the same on every run;lychee --offline: 106 broken links instead of 45. The new ones are the same legacy ForgeRock-era links inside the frozen tags, plus 8 links fromopenam/15.2pages toopenam/15.2/apidocs— the API docs are published for the current version only.Merge order with #28
#28 adds a gate that fails a pull request on an Antora error or a broken link missing from
.github/build-baseline. This PR adds one Antora error (the OpenIG-5.3.2 copy above) and the new broken links of the older versions. Whichever of the two lands second runs.github/build-baseline/check.sh --updateon its build and commits both lists.Not in this PR
display_versionare updated by hand.${TAG_NAME}(0abcd92e4f) mentioned in Publish versioned docs from existing release tags #26 is not deleted yet; deleting a tag onoriginis done separately.