You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Doc][improve] Auto-detect broken links and integrate into CI process #18026
I searched in the issues and found nothing similar.
What issue do you find in Pulsar docs?
After #17495 and #17599, we can see many broken links in the Pulsar document. And more links may break during further evolution.
What is your suggestion?
In #17599 I use a script but it's not reliable enough so I have to check the links list manually. I suggest developing a reliable script to auto-detect the incorrect links in the Pulsar document. Maybe we can integrate this script into the CI process which is related to document change.
Before development, I'd like to enumerate all kinds of broken links.
The markdown content is [Pulsar Functions CLI](/tools/pulsar-admin/), but this refers to a confusing page:
4. invalid title anchor
We can use # to refer to a specific block of HTML this way: [dataDir](reference-configuration.md#zookeeper-dataDir). So if our script can detect the anchor will be better.
Our script should be able to detect these broken links and print warning messages to users.
Since we build some pages on the fly instead of all content static, we may need an external sensor/crawler for the online version, or static check after the site was built.
#18014 Looks great, but it seems like a big change. If we build the site dynamically, I think detecting the generated HTML files may be better than the external crawler.
Before #18014 finishes, I think 1. wrong markdown file reference and 4. invalid title anchors are still worth detecting.
The detect script see here. PR #18109 fix almost all invalid title anchors. But there are still many invalid markdown file references about reference-configuration.md:
administration-pulsar-shell.md has 1 errors:
[pulsar-client](reference-cli-tools#pulsar-client.md) -> reference-cli-tools#pulsar-client.md not exist
administration-geo.md has 2 errors:
[per-tenant basis](#concepts-multi-tenancy) -> administration-geo.md doesn't have anchor: #concepts-multi-tenancy
[broker configuration](reference-configuration.md#broker) -> reference-configuration.md not exist
security-athenz.md has 1 errors:
[Broker Configuration](reference-configuration.md#broker) -> reference-configuration.md not exist
client-libraries-websocket.md has 6 errors:
[`webSocketServiceEnabled`](reference-configuration.md#broker-webSocketServiceEnabled) -> reference-configuration.md not exist
[`conf/broker.conf`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`conf/websocket.conf`](reference-configuration.md#websocket) -> reference-configuration.md not exist
[`configurationMetadataStoreUrl`](reference-configuration.md#websocket) -> reference-configuration.md not exist
[`webServicePort`](reference-configuration.md#websocket-webServicePort) -> reference-configuration.md not exist
[`clusterName`](reference-configuration.md#websocket-clusterName) -> reference-configuration.md not exist
security-authorization.md has 4 errors:
[`conf/broker.conf`](reference-configuration.md#broker) -> reference-configuration.md not exist
[Broker Configuration](reference-configuration.md#broker) -> reference-configuration.md not exist
[`conf/broker.conf`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`conf/broker.conf`](reference-configuration.md#broker) -> reference-configuration.md not exist
cookbooks-non-persistent.md has 3 errors:
[`enableNonPersistentTopics`](reference-configuration.md#broker-enableNonPersistentTopics) -> reference-configuration.md not exist
[`standalone.conf`](reference-configuration.md#standalone) -> reference-configuration.md not exist
[`enablePersistentTopics`](reference-configuration.md#broker-enablePersistentTopics) -> reference-configuration.md not exist
security-tls-authentication.md has 1 errors:
[the configuration to enable TLS encryption](security-tls-transport.md#configure-tls-encryption-in-cli-tools) -> security-tls-transport.md doesn't have anchor: #configure-tls-encryption-in-cli-tools
administration-zk-bk.md has 7 errors:
[`conf/zookeeper.conf`](reference-configuration.md#zookeeper) -> reference-configuration.md not exist
[`dataDir`](reference-configuration.md#zookeeper-dataDir) -> reference-configuration.md not exist
[`conf/global_zookeeper.conf`](reference-configuration.md#configuration-store) -> reference-configuration.md not exist
[parameters](reference-configuration.md#zookeeper) -> reference-configuration.md not exist
[`metadataStoreBatchingEnabled`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`conf/bookkeeper.conf`](reference-configuration.md#bookkeeper) -> reference-configuration.md not exist
[`zkServers`](reference-configuration.md#bookkeeper-zkServers) -> reference-configuration.md not exist
client-libraries-node.md has 1 errors:
[these instructions](client-libraries-cpp.md#compilation) -> client-libraries-cpp.md doesn't have anchor: #compilation
admin-api-tenants.md has 1 errors:
[configuration](reference-configuration.md) -> reference-configuration.md not exist
developing-binary-protocol.md has 5 errors:
[`BaseCommand`](#pulsar.proto.BaseCommand) -> developing-binary-protocol.md doesn't have anchor: #pulsar.proto.BaseCommand
[`Type`](#pulsar.proto.Type) -> developing-binary-protocol.md doesn't have anchor: #pulsar.proto.Type
[`brokerEntryMetadataInterceptors`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`brokerEntryMetadataInterceptors`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`exposingBrokerEntryMetadataToClientEnabled`](reference-configuration-broker.md#exposingbrokerentrymetadatatoclientenabled) -> reference-configuration-broker.md not exist
concepts-multiple-advertised-listeners.md has 1 errors:
[broker configuration file](reference-configuration.md#broker) -> reference-configuration.md not exist
admin-api-clusters.md has 1 errors:
[configuration](reference-configuration.md) -> reference-configuration.md not exist
concepts-architecture-overview.md has 2 errors:
[non-persistent](concepts-messaging.md#non-persistent-topics.md) -> concepts-messaging.md doesn't have anchor: #non-persistent-topics.md
[`journalMaxSizeMB`](reference-configuration.md#bookkeeper) -> reference-configuration.md not exist
admin-api-brokers.md has 3 errors:
[Configuration](reference-configuration.md#broker) -> reference-configuration.md not exist
[configuration](reference-configuration.md#broker) -> reference-configuration.md not exist
[`brokerShutdownTimeoutMs`](reference-configuration.md#broker-brokerShutdownTimeoutMs) -> reference-configuration.md not exist
administration-proxy.md has 1 errors:
[Pulsar proxy](reference-configuration.md#pulsar-proxy) -> reference-configuration.md not exist
cookbooks-retention-expiry.md has 1 errors:
[`broker.conf`](reference-configuration.md#broker) -> reference-configuration.md not exist
deploy-bare-metal.md has 11 errors:
[broker configuration](reference-configuration.md#broker) -> reference-configuration.md not exist
[ZooKeeper configuration](reference-configuration.md#zookeeper) -> reference-configuration.md not exist
[`conf/zookeeper.conf`](reference-configuration.md#zookeeper) -> reference-configuration.md not exist
[`dataDir`](reference-configuration.md#zookeeper-dataDir) -> reference-configuration.md not exist
[`conf/bookkeeper.conf`](reference-configuration.md#bookkeeper) -> reference-configuration.md not exist
[`zkServers`](reference-configuration.md#bookkeeper-zkServers) -> reference-configuration.md not exist
[here](reference-configuration.md#bookkeeper) -> reference-configuration.md not exist
[`metadataStoreUrl`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`configurationMetadataStoreUrl`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`conf/broker.conf`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`conf/client.conf`](reference-configuration.md#client) -> reference-configuration.md not exist
reference-metrics.md has 4 errors:
[Request metrics](#request-metrics) -> reference-metrics.md doesn't have anchor: #request-metrics
[Server metrics](#server-metrics-1) -> reference-metrics.md doesn't have anchor: #server-metrics-1
[Replication metrics](#replication-metrics-1) -> reference-metrics.md doesn't have anchor: #replication-metrics-1
[Connection metrics](#connection-metrics) -> reference-metrics.md doesn't have anchor: #connection-metrics
functions-concepts.md has 1 errors:
[cluster-mode](functions-deploy.md#depoy-a-function-in-cluster-mode) -> functions-deploy.md doesn't have anchor: #depoy-a-function-in-cluster-mode
client-libraries-java.md has 3 errors:
[above](#client-configuration) -> client-libraries-java.md doesn't have anchor: #client-configuration
[partitioned topics](concepts-architecture-overview.md#partitioned-topics) -> concepts-architecture-overview.md doesn't have anchor: #partitioned-topics
[above](#client-configuration) -> client-libraries-java.md doesn't have anchor: #client-configuration
concepts-messaging.md has 2 errors:
[configure](reference-configuration.md#broker) -> reference-configuration.md not exist
[configuration](reference-configuration.md#broker-enableNonPersistentTopics) -> reference-configuration.md not exist
admin-api-overview.md has 1 errors:
[`conf/client.conf`](reference-configuration.md#client) -> reference-configuration.md not exist
cookbooks-deduplication.md has 1 errors:
[`broker.conf`](reference-configuration.md#broker) -> reference-configuration.md not exist
develop-schema.md has 1 errors:
[`broker.conf`](reference-configuration.md#broker) -> reference-configuration.md not exist
reference-pulsar-admin.md has 2 errors:
[here](reference-configuration.md#broker) -> reference-configuration.md not exist
[here](reference-configuration.md#broker) -> reference-configuration.md not exist
cookbooks-compaction.md has 1 errors:
[broker configuration](reference-configuration.md#broker) -> reference-configuration.md not exist
admin-api-topics.md has 2 errors:
[here](reference-configuration.md#broker) -> reference-configuration.md not exist
[here](reference-configuration.md#broker) -> reference-configuration.md not exist
deploy-bare-metal-multi-cluster.md has 14 errors:
[broker configuration](reference-configuration.md#broker) -> reference-configuration.md not exist
[ZooKeeper configuration](reference-configuration.md#zookeeper) -> reference-configuration.md not exist
[`conf/zookeeper.conf`](reference-configuration.md#zookeeper) -> reference-configuration.md not exist
[`dataDir`](reference-configuration.md#zookeeper-dataDir) -> reference-configuration.md not exist
[`conf/global_zookeeper.conf`](reference-configuration.md#configuration-store) -> reference-configuration.md not exist
[`conf/bookkeeper.conf`](reference-configuration.md#bookkeeper) -> reference-configuration.md not exist
[`zkServers`](reference-configuration.md#bookkeeper-zkServers) -> reference-configuration.md not exist
[`conf/broker.conf`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`metadataStoreUrl`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`configurationMetadataStoreUrl`](reference-configuration.md#broker) -> reference-configuration.md not exist
[`clusterName`](reference-configuration.md#broker-clusterName) -> reference-configuration.md not exist
[endpoint](reference-configuration.md) -> reference-configuration.md not exist
[`conf/client.conf`](reference-configuration.md#client) -> reference-configuration.md not exist
[`serviceUrl`](reference-configuration.md#client-serviceUrl) -> reference-configuration.md not exist
reference-cli-pulsar-shell.md has 1 errors:
[pulsar-client](#pulsar-client) -> reference-cli-pulsar-shell.md doesn't have anchor: #pulsar-client
@Anonymitaet Then we should properly redirect or update the links. Or host the deprecated tools content on an archived source (and properly redirect there).
@Anonymitaet So I think we can replace all reference-configuration.md with https://pulsar.apache.org/reference. Right?
@labuladong at least for the maintained versions (2.10.x, 2.9.x, 2.8.x, 2.7.x) you can do the replacement. My comments above hint that it can not be applied simply globally - you should check the result instead of making assumptions.
@Anonymitaet one comment here is about #17438. Otherwise, when a release note refers to the latest stable version, it can only use /docs/path/to/page instead of a stable /docs/version/path/to/page. If we later make some refactors for the next version and after the next stable version is released, those links can be broken. Even we don't break the link, when the next stable version is released, the target of the link is semantically wrong.
For example, [Kafka Connector](https://pulsar.apache.org/docs/en/io-kafka/) in this page links to a removed page.
@Anonymitaet one comment here is about #17438. Otherwise, when a release note refers to the latest stable version, it can only use /docs/path/to/page instead of a stable /docs/version/path/to/page. If we later make some refactors for the next version and after the next stable version is released, those links can be broken. Even we don't break the link, when the next stable version is released, the target of the link is semantically wrong.
For example, [Kafka Connector](https://pulsar.apache.org/docs/en/io-kafka/) in this page links to a removed page.
@Anonymitaet yes. I think that we should retain the URL /docs/<path> for convenience and current usage, but it helps to serve it as an alias.
That is, the source of truth is /docs/<latest-version>/<path> and we set up /docs/<content> as an alias to the latest stable versioned one. In this way, users can use /docs/<path> to access the latest stable version (which can be changed), while where there needs an immutable link, it uses /docs/<latest-version>/<path>.
I think this should be done in the building stage. And let's move the discussion to #17438 instead of polluting this thread :)
Activity
tisonkun commentedon Oct 13, 2022
Since we build some pages on the fly instead of all content static, we may need an external sensor/crawler for the online version, or static check after the site was built.
Related issue: #18014
Anonymitaet commentedon Oct 13, 2022
For external tools, normally we use https://www.drlinkcheck.com/ to check URLs.
labuladong commentedon Oct 13, 2022
#18014 Looks great, but it seems like a big change. If we build the site dynamically, I think detecting the generated HTML files may be better than the external crawler.
Before #18014 finishes, I think
1. wrong markdown file referenceand4. invalid title anchorsare still worth detecting.tisonkun commentedon Oct 13, 2022
It helps detect this issue apache/pulsar-site#252, PTAL.
labuladong commentedon Oct 19, 2022
The detect script see here. PR #18109 fix almost all invalid title anchors. But there are still many invalid markdown file references about
reference-configuration.md:administration-pulsar-shell.mdhas 1 errors:administration-geo.mdhas 2 errors:security-athenz.mdhas 1 errors:client-libraries-websocket.mdhas 6 errors:security-authorization.mdhas 4 errors:cookbooks-non-persistent.mdhas 3 errors:security-tls-authentication.mdhas 1 errors:administration-zk-bk.mdhas 7 errors:client-libraries-node.mdhas 1 errors:admin-api-tenants.mdhas 1 errors:developing-binary-protocol.mdhas 5 errors:concepts-multiple-advertised-listeners.mdhas 1 errors:admin-api-clusters.mdhas 1 errors:concepts-architecture-overview.mdhas 2 errors:admin-api-brokers.mdhas 3 errors:administration-proxy.mdhas 1 errors:cookbooks-retention-expiry.mdhas 1 errors:deploy-bare-metal.mdhas 11 errors:reference-metrics.mdhas 4 errors:functions-concepts.mdhas 1 errors:client-libraries-java.mdhas 3 errors:concepts-messaging.mdhas 2 errors:admin-api-overview.mdhas 1 errors:cookbooks-deduplication.mdhas 1 errors:develop-schema.mdhas 1 errors:reference-pulsar-admin.mdhas 2 errors:cookbooks-compaction.mdhas 1 errors:admin-api-topics.mdhas 2 errors:deploy-bare-metal-multi-cluster.mdhas 14 errors:reference-cli-pulsar-shell.mdhas 1 errors:Anonymitaet commentedon Oct 19, 2022
@labuladong FYI: currently, https://pulsar.apache.org/reference rather than https://pulsar.apache.org/tools/ is used (a new change).
tisonkun commentedon Oct 19, 2022
@Anonymitaet Then we should properly redirect or update the links. Or host the deprecated tools content on an archived source (and properly redirect there).
labuladong commentedon Oct 21, 2022
@Anonymitaet So I think we can replace all
reference-configuration.mdwithhttps://pulsar.apache.org/reference. Right?tisonkun commentedon Oct 21, 2022
@labuladong not exactly. You may be aware that https://pulsar.apache.org/reference doesn't contain all versions of references. So it's a bit tricky if you globally do the replacement (apply for all versions), you actually cause new issues.
labuladong commentedon Oct 21, 2022
OK. But all the
reference-configuration.mdis 404... I think we should do something to optimize it.tisonkun commentedon Oct 21, 2022
@labuladong at least for the maintained versions (2.10.x, 2.9.x, 2.8.x, 2.7.x) you can do the replacement. My comments above hint that it can not be applied simply globally - you should check the result instead of making assumptions.
Anonymitaet commentedon Oct 21, 2022
Exactly
Anonymitaet commentedon Oct 21, 2022
FYI: https://github.com/apache/pulsar/pull/18132/files#diff-2f6afd23b9f4fddf8ea934eb85c62599f7d05e01bb457cbabc2a178cd92ddab9 is adding
reference-configuration.mdbackCC @SignorMercurio
tisonkun commentedon Oct 21, 2022
@Anonymitaet one comment here is about #17438. Otherwise, when a release note refers to the latest stable version, it can only use
/docs/path/to/pageinstead of a stable/docs/version/path/to/page. If we later make some refactors for the next version and after the next stable version is released, those links can be broken. Even we don't break the link, when the next stable version is released, the target of the link is semantically wrong.For example,
[Kafka Connector](https://pulsar.apache.org/docs/en/io-kafka/)in this page links to a removed page.Anonymitaet commentedon Oct 21, 2022
Thanks! Release notes might not be affected because all release notes have specific versions. The data is pulled from https://github.com/apache/pulsar-site/tree/main/site2/website-next/release-notes/versioned and https://github.com/apache/pulsar/releases
cc @SignorMercurio
Anonymitaet commentedon Oct 24, 2022
@tisonkun sorry for the misunderstanding.
Oh, I see, you mean the links in the release notes might be broken.
For example, now the stable version is 2.10.1.
If we publish the next version (2.10.2) and add doc links in the 2.10.2 release note, say https://pulsar.apache.org/docs/io-connectors/#kafka, it will be 404 if the next stable version (2.11.x) is published since https://pulsar.apache.org/docs/io-connectors/#kafka is updated to https://pulsar.apache.org/docs/2.10.x/io-connectors/#kafka.
So does it make sense to add <version-NO.> to the latest stable doc link? @momo-jun @urfreespace @DaveDuggins @D-2-Ed
tisonkun commentedon Oct 24, 2022
@Anonymitaet yes. I think that we should retain the URL
/docs/<path>for convenience and current usage, but it helps to serve it as an alias.That is, the source of truth is
/docs/<latest-version>/<path>and we set up/docs/<content>as an alias to the latest stable versioned one. In this way, users can use/docs/<path>to access the latest stable version (which can be changed), while where there needs an immutable link, it uses/docs/<latest-version>/<path>.I think this should be done in the building stage. And let's move the discussion to #17438 instead of polluting this thread :)
github-actions commentedon Nov 24, 2022
The issue had no activity for 30 days, mark with Stale label.
tisonkun commentedon Jan 8, 2023
I'm adding Docu's builtin support now. Integrate into CI can be a follow-up.