Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ The following environment variables can be used to configure the server:
| Variable | Default | Description |
| -------- | ------- | ----------- |
| `OCAMLORG_HTTP_PORT` | `8080` | HTTP server port |
| `OCAMLORG_DOC_URL` | `https://dill.caelum.ci.dev/profiles/full/docs/` | Package documentation server URL (see [External Services](#external-services)) |
| `OCAMLORG_DOC_STATUS_URL` | `https://dill.caelum.ci.dev/profiles/full/` | Documentation build status server URL (see [External Services](#external-services)) |
| `OCAMLORG_DOC_URL` | `https://sage.ci.dev/current/` | Package documentation server URL (see [External Services](#external-services)) |
| `OCAMLORG_REPO_PATH` | `~/.cache/ocamlorg/opam-repository` | Path to local opam-repository clone |
| `OCAMLORG_PKG_STATE_PATH` | `~/.cache/ocamlorg/package.state` | Path to package state cache file |
| `OCAMLORG_PACKAGE_CACHES_TTL` | `3600` | Package cache time-to-live in seconds |
Expand All @@ -156,11 +155,9 @@ The following environment variables can be used to configure the server:

The package documentation pages displayed under `/p/<package>/<version>/doc/` are not generated by the OCaml.org server itself. Instead, they are fetched from an external documentation server.

This documentation is generated by [ocaml-docs-ci](https://github.com/ocurrent/ocaml-docs-ci), an OCurrent pipeline that builds documentation for all opam packages using [odoc](https://github.com/ocaml/odoc). The pipeline runs on a server called "dill" and the generated documentation is served at `https://dill.caelum.ci.dev/profiles/full/docs/`.
This documentation is generated by [ocaml-docs-ci](https://github.com/ocurrent/ocaml-docs-ci), an OCurrent pipeline that builds documentation for all opam packages using [odoc](https://github.com/ocaml/odoc). The pipeline runs on a server called "sage" and the generated documentation is served at `https://sage.ci.dev/current/`.

The same server also reports the documentation build status of each package version at `https://dill.caelum.ci.dev/profiles/full/`. The OCaml.org server links to these status pages when documentation is missing or failed to build.

Both URLs can be configured via the `OCAMLORG_DOC_URL` and `OCAMLORG_DOC_STATUS_URL` environment variables if you need to point to a different documentation server (e.g., for testing or staging).
The documentation URL can be configured via the `OCAMLORG_DOC_URL` environment variable if you need to point to a different documentation server (e.g., for testing or staging).

### Staging Pull Requests

Expand Down
2 changes: 1 addition & 1 deletion src/ocamlorg_frontend/layouts/package_layout.eml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Layout.base
</li>
<% | Unknown -> ( %>
<li class="flex flex-auto">
<a href="<%s package.documentation_status_url %>" target="_blank" rel="noopener noreferrer" title="Documentation status is unknown — check the build status" aria-label="Documentation status is unknown — check the build status" class="w-full h-10 flex justify-center gap-2 rounded-r-lg p-1 items-center font-semibold border border-l-0 border-separator_20 dark:border-dark-separator_30 <%s (match path with | Documentation _ -> "bg-primary dark:bg-dark-primary text-title dark:text-dark-title" | _ -> "text-title dark:text-dark-title bg-sand dark:bg-dark-card")%>"><%s! Icons.error "" %> No Docs</a>
<span aria-label="Documentation status is unknown" class="w-full h-10 flex justify-center gap-2 rounded-r-lg p-1 items-center font-semibold border border-l-0 border-separator_20 dark:border-dark-separator_30 <%s (match path with | Documentation _ -> "bg-primary dark:bg-dark-primary text-title dark:text-dark-title" | _ -> "text-title dark:text-dark-title bg-sand dark:bg-dark-card")%>"><%s! Icons.error "" %> No Docs</span>
</li>
<% )
| Failure -> ( %>
Expand Down
2 changes: 0 additions & 2 deletions src/ocamlorg_frontend/package.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ type package = {
option; changes_filename : string option; license_filename : string
option;*)
documentation_status : documentation_status;
documentation_status_url : string;
(** URL of the documentation build status page on the docs build server. *)
}

let specific_version package =
Expand Down
11 changes: 8 additions & 3 deletions src/ocamlorg_frontend/pages/package_documentation_not_found.eml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Package_layout.render
~left_sidebar_html:""
~right_sidebar_html:"" @@
let version = Package.url_version package in
let docs_ci_issue_url =
Printf.sprintf "https://github.com/ocurrent/ocaml-docs-ci/issues/new?title=Missing+documentation+for+%s+%s&body=Documentation+is+missing+for+package+[%s](https://ocaml.org/p/%s/%s)+version+%s"
package.name (Package.render_version package)
package.name package.name (Package.render_version package) (Package.render_version package)
in
<div class="sm:flex max-w-max mx-auto">
<p class="text-4xl font-extrabold text-primary sm:text-5xl">404</p>
<div class="sm:ml-6">
Expand All @@ -23,19 +28,19 @@ Package_layout.render
<p class="mt-3 text-sm text-content dark:text-dark-content">
Package documentation is generated automatically by
<a href="https://github.com/ocurrent/ocaml-docs-ci" class="text-primary dark:text-dark-primary hover:underline">ocaml-docs-ci</a>.
If it is missing or failed to build, the documentation build status page linked below has the details.
If you believe this is an error, please report it to the documentation CI project.
</p>
</div>
<div class="mt-10 flex flex-wrap gap-3 sm:border-l sm:border-transparent sm:pl-6">
<a href="<%s Url.Package.overview package.name ?version %>"
class="btn">
Go To Package Overview
</a>
<a href="<%s package.documentation_status_url %>"
<a href="<%s docs_ci_issue_url %>"
class="btn btn-ghost"
target="_blank"
rel="noopener noreferrer">
View Documentation Build Status
Report Missing Docs
</a>
</div>
</div>
Expand Down
6 changes: 1 addition & 5 deletions src/ocamlorg_package/lib/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ let opam_polling =

let documentation_url =
Sys.getenv_opt "OCAMLORG_DOC_URL"
|> Option.value ~default:"https://dill.caelum.ci.dev/profiles/full/docs/"

let documentation_status_url =
Sys.getenv_opt "OCAMLORG_DOC_STATUS_URL"
|> Option.value ~default:"https://dill.caelum.ci.dev/profiles/full/"
|> Option.value ~default:"https://sage.ci.dev/current/"

let package_caches_ttl =
env_with_default "OCAMLORG_PACKAGE_CACHES_TTL" "3600" |> float_of_string
Expand Down
1 change: 0 additions & 1 deletion src/ocamlorg_package/lib/config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

val opam_polling : int
val documentation_url : string
val documentation_status_url : string
val package_caches_ttl : float
val opam_repository_path : Fpath.t
val package_state_path : Fpath.t
16 changes: 4 additions & 12 deletions src/ocamlorg_package/lib/documentation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,11 @@ end = struct
Hashtbl.find_opt cache (name, version, kind)
end

let generic_url base ~kind name version =
match kind with
| `Package -> base ^ "p/" ^ name ^ "/" ^ version ^ "/"
| `Universe s -> base ^ "u/" ^ s ^ "/" ^ name ^ "/" ^ version ^ "/"

let package_url ~kind name version =
generic_url Config.documentation_url ~kind name version

(* Build status is tracked per package version, not per universe (universes only
disambiguate cross-reference link targets), so the status URL always uses the
[`Package] form even when reached from a universe doc page. *)
let doc_status_url name version =
generic_url Config.documentation_status_url ~kind:`Package name version
match kind with
| `Package -> Config.documentation_url ^ "p/" ^ name ^ "/" ^ version ^ "/"
| `Universe s ->
Config.documentation_url ^ "u/" ^ s ^ "/" ^ name ^ "/" ^ version ^ "/"

let sidebar ~kind (t : Package.t) =
let package_url =
Expand Down
5 changes: 0 additions & 5 deletions src/ocamlorg_package/lib/ocamlorg_package.mli
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,6 @@ module Documentation : sig
pkg ->
string option Lwt.t
(** Retrieve the hash digest of the search index of a given package. *)

val doc_status_url : string -> string -> string
(** [doc_status_url name version] is the URL of the page on the documentation
build server reporting the documentation build status of the given package
version. *)
end

module Package_info = Package_info
Expand Down
4 changes: 0 additions & 4 deletions src/ocamlorg_web/lib/handler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -899,10 +899,6 @@ module Package_helper = struct
info.Ocamlorg_package.Info.url;
documentation_status =
Option.value ~default:Unknown documentation_status;
documentation_status_url =
Ocamlorg_package.Documentation.doc_status_url
(Ocamlorg_package.Name.to_string name)
(Ocamlorg_package.Version.to_string version);
}

(** Query all the versions of a package. *)
Expand Down
Loading