Skip to content

Publish combined JavaDocs from the existing Java CI build #450

@joshsh

Description

@joshsh

Goal

Publish a single combined JavaDoc site for Hydra at categoricaldata.net/hydra/…/javadoc/, built from the dist/java/ tree the Java CI workflow already generates on GitHub's runners, uploaded as a Pages artifact. Tag-triggered (matching the previous once-per-release cadence), commits nothing to any branch.

Key insight

The Java test workflow already, on every push to main, (a) builds the Haskell host, (b) generates Java into dist/java/, and (c) runs the Java tests. The fully-generated dist/java/ therefore already exists on a GitHub runner at test time. The previous Pages workflow failed only because it did a bare checkout and tried to regenerate (or resolve) Java itself, with dist/java/ gitignored/absent. The fix is to stop regenerating in a separate workflow and instead build the docs from the tree the test workflow already produced.

This is not blocked on #370. #370 (external versioned hosts) is a later optimization of step (a) — skip the local host build by pulling the published host — but the capability needed here (generated dist/java/ present in a CI run) exists today. #370 just makes it cheaper.

Approach: single job, tag-gated tail steps

Extend the existing Java CI job (the one that generates dist/java/ and runs the Java tests). After tests pass:

  • Gate on tags: the javadoc/upload/deploy steps run only when startsWith(github.ref, 'refs/tags/') (plus workflow_dispatch for manual re-runs without re-tagging). Generation + tests stay unconditional, unchanged.
  • Build one combined tree: a single javadoc invocation over the union of the published packages' sources — dist/java/{hydra-kernel,hydra-rdf,hydra-pg,hydra-java}/src/main/java — so cross-package @links resolve. (Verified locally: ~2,200 sources, full API, hydra/core/Term.html present.) Per-package trees give dead cross-links — do not split.
  • Non-fatal javadoc: apply heads/java/bin/javadoc-nonfatal.init.gradle (Java coder emits unqualified @link refs for nested case-classes, failing the Javadoc build #449 cosmetic @link/entity warnings). The strict default build stays strict; this lenience is Pages-only.
  • Upload + deploy as a Pages artifact (actions/upload-pages-artifact + actions/deploy-pages); keep Pages build_type: workflow. Commit nothing.
  • hydra-ext excluded until it ships to Maven Central — restore it to the combined sourcepath then (companion issue).
  • Landing page: carry over main's docs/index.html.
  • Preserve the public URL path (…/hydra-java/javadoc/) so existing links don't break.

Cleanup (part of this work)

  • Decommission the stale docs branch — an orphan (no common ancestor with main), last touched 2025-08-28, carrying a dead pre-restructure monolith snapshot; serves nothing under build_type: workflow. Delete once the artifact deploy is live.
  • Revert the three 0.16.0-era pages.yml edits on main that assumed a local dist/java/ (dead under this approach).

Notes

  • Cadence: tag-gated, not every-push — the public JavaDoc site should reflect the released API, not in-flight main; also avoids republishing on doc-comment-only pushes. workflow_dispatch covers re-running a failed tag publish without re-tagging.
  • Companion: Restore hydra-ext to the combined JavaDocs when it ships to Maven Central #451 — restore hydra-ext to the combined tree once published to Maven Central.

For #418. For #449.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions