Skip to content

Commit ea15ae5

Browse files
authored
feat: Link the CRD reference on the Stackable Hub (#888)
* feat: Link the CRD reference on the Stackable Hub The docs' own pages now link https://hub.stackable.tech/crds instead of the old CRD browser on crds.stackable.tech, using the new attributes: crd-ref: the listing {crd-ref}/<group>/<apiVersion>/<kind>{crd-ref-release}: a deep link crd-ref-release is ?release=dev on this branch and gets the release number on release branches (like crd-docs-version today). The old crd-docs attributes stay until the operator repos migrate their deep links to crd-ref (they do so in the planned operator sweep, one PR per repo). page-crd-docs is removed: nothing in the UI templates reads it. The OIDC provider deep link loses its per-property anchor: the Hub has section-level anchors only, so it points at #provider now. * fix: Rewrite crd-ref-release when cutting a release branch make-release-branch.sh already rewrites version, prerelease and crd-docs-version; without this, a release branch would keep ?release=dev and its Hub CRD links would show bleeding-edge schemas. The Hub names releases by major.minor, so this uses DOCS_VERSION (e.g. 26.7), not VERSION (e.g. 26.7.1); the Hub 301s patch-level values but major.minor is canonical. * docs: Remind release cutters about crd-ref-release Same kind of reminder comment that crd-docs-version has, in case the attribute is ever edited by hand instead of via the release script.
1 parent 63f944b commit ea15ae5

7 files changed

Lines changed: 19 additions & 9 deletions

File tree

antora.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,19 @@ asciidoc:
2727
# Whether this version is already end of life.
2828
# If true, a banner will be displayed informing the user.
2929
end-of-life: false
30-
# use the attributes below to link to the CRD docs
30+
# The CRD reference on the Stackable Hub. crd-ref links the listing;
31+
# deep links follow {crd-ref}/<group>/<apiVersion>/<kind>{crd-ref-release}
32+
crd-ref: "https://hub.stackable.tech/crds"
33+
# Keep this in line with the 'version' key above: '?release=dev' on main,
34+
# '?release=<major.minor>' on release branches (the release script sets it).
35+
crd-ref-release: "?release=dev"
36+
# DEPRECATED: the old CRD browser attributes below are still used by the
37+
# operator docs; they migrate to crd-ref repo by repo (operator sweep).
3138
crd-docs-base-url: "https://crds.stackable.tech"
3239
# used by the operator index pages, see the
3340
# operator-link-bar.adoc partial in the ROOT module
3441
hub-base-url: "https://hub.stackable.tech"
3542
crd-docs: "{crd-docs-base-url}/{crd-docs-version}"
3643
# to make attributes accessible to the UI template, they need to
3744
# be prefixed with "page-"
38-
page-crd-docs: "{crd-docs}"
3945
page-end-of-life: "{end-of-life}"

modules/ROOT/pages/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ xref:operators:index.adoc[Operator overview]
118118

119119
Read the CustomResourceDefinition (CRD) reference for all CRDs that are deployed by any Stackable operator.
120120

121-
{crd-docs}[CRD Reference {external-link-icon}^]
121+
{crd-ref}{crd-ref-release}[CRD Reference {external-link-icon}^]
122122

123123
++++
124124
</div>

modules/concepts/pages/authentication.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ In a diagram it would look like this:
3838

3939
image::image$authentication-overview.drawio.svg[]
4040

41-
NOTE: Learn more in the xref:tutorials:authentication_with_openldap.adoc[OpenLDAP tutorial] and get a full overview of all the properties in the {crd-docs}/authentication.stackable.tech/authenticationclass/v1alpha1/#spec-provider-ldap[AuthenticationClass LDAP provider CRD reference{external-link-icon}^].
41+
NOTE: Learn more in the xref:tutorials:authentication_with_openldap.adoc[OpenLDAP tutorial] and get a full overview of all the properties in the {crd-ref}/authentication.stackable.tech/v1alpha1/authenticationclass{crd-ref-release}#provider.ldap[AuthenticationClass LDAP provider CRD reference{external-link-icon}^].
4242

4343
[#OIDC]
4444
=== OpenID Connect
@@ -59,7 +59,7 @@ include::example$authenticationclass-keycloak.yaml[]
5959
<7> Optionally enable TLS and configure verification. When present, connections to the idP will use `https://` instead of `http://`. See xref:tls-server-verification.adoc[].
6060
<8> Trust certificates signed by commonly trusted Certificate Authorities.
6161

62-
NOTE: Get a full overview of all the properties in the {crd-docs}/authentication.stackable.tech/authenticationclass/v1alpha1/#spec-provider-oidc[AuthenticationClass OIDC provider CRD reference{external-link-icon}^].
62+
NOTE: Get a full overview of all the properties in the {crd-ref}/authentication.stackable.tech/v1alpha1/authenticationclass{crd-ref-release}#provider.oidc[AuthenticationClass OIDC provider CRD reference{external-link-icon}^].
6363

6464
[#tls]
6565
=== TLS
@@ -113,4 +113,4 @@ include::example$authenticationclass-static-secret.yaml[]
113113
== Further reading
114114

115115
* xref:tutorials:authentication_with_openldap.adoc[] tutorial
116-
* {crd-docs}/authentication.stackable.tech/authenticationclass/v1alpha1/[AuthenticationClass CRD reference{external-link-icon}^]
116+
* {crd-ref}/authentication.stackable.tech/v1alpha1/authenticationclass{crd-ref-release}[AuthenticationClass CRD reference{external-link-icon}^]

modules/concepts/pages/s3.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,4 @@ region:
284284

285285
== What's next
286286

287-
Read the {crd-docs}/s3.stackable.tech/s3bucket/v1alpha1/[S3Bucket CRD reference{external-link-icon}^] and the {crd-docs}/s3.stackable.tech/s3connection/v1alpha1/[S3Connection CRD reference{external-link-icon}^].
287+
Read the {crd-ref}/s3.stackable.tech/v1alpha1/s3bucket{crd-ref-release}[S3Bucket CRD reference{external-link-icon}^] and the {crd-ref}/s3.stackable.tech/v1alpha1/s3connection{crd-ref-release}[S3Connection CRD reference{external-link-icon}^].

modules/reference/nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
* Reference
2-
** {crd-docs}[CRD Reference {external-link-icon}^]
2+
** {crd-ref}{crd-ref-release}[CRD Reference {external-link-icon}^]
33
** xref:glossary.adoc[]
44
** xref:duration.adoc[]

modules/tutorials/pages/authentication_with_openldap.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ The LDAP connection details only need to be written down once, in the Authentica
367367
== Further Reading
368368

369369
- xref:concepts:authentication.adoc[Authentication concepts page]
370-
* {crd-docs}/authentication.stackable.tech/authenticationclass/v1alpha1/[AuthenticationClass CRD reference{external-link-icon}^]
370+
* {crd-ref}/authentication.stackable.tech/v1alpha1/authenticationclass{crd-ref-release}[AuthenticationClass CRD reference{external-link-icon}^]
371371
- xref:superset:getting_started/index.adoc[Getting started with the Stackable Operator for Apache Superset]
372372
- xref:trino:getting_started/index.adoc[Getting started with the Stackable Operator for Trino]
373373
// TODO Operator docs for LDAP

scripts/make-release-branch.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ sed -i "s/^prerelease:.*/prerelease: false/" "$ANTORA_YAML_FILE"
120120
# Set crd-docs-version key to the 'version' variable
121121
sed -i "s/^\(\s*\)crd-docs-version:.*/\1crd-docs-version: \"$VERSION\"/" "$ANTORA_YAML_FILE"
122122

123+
# Set the Hub release for the CRD reference links. The Hub names releases
124+
# by major.minor, so this uses DOCS_VERSION, not VERSION.
125+
sed -i "s/^\(\s*\)crd-ref-release:.*/\1crd-ref-release: \"?release=$DOCS_VERSION\"/" "$ANTORA_YAML_FILE"
126+
123127
# Display changes using git diff
124128
git diff "$ANTORA_YAML_FILE"
125129

0 commit comments

Comments
 (0)