Skip to content

Commit

Permalink
Add markdown link CI check (#1540)
Browse files Browse the repository at this point in the history
Co-authored-by: Cijo Thomas <cijo.thomas@gmail.com>
  • Loading branch information
lalitb and cijothomas committed Feb 17, 2024
1 parent 59f5371 commit 1be83bb
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 7 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Markdown link check

on:
pull_request:
push:
branches:
- main
paths:
- '**/*.md'

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install markdown-link-check
run: npm install -g markdown-link-check

- name: Run markdown-link-check
run: |
find . -type f \
-name '*.md' \
-not -path '**/CHANGELOG.md' \
| xargs ./scripts/markdown-link-check-with-retry.sh
9 changes: 5 additions & 4 deletions opentelemetry-jaeger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ opentelemetry-jaeger = { version = "..", features = ["isahc_collector_client"] }

Then you can use the [`with_collector_endpoint`] method to specify the endpoint:

[`with_collector_endpoint`]: https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/struct.PipelineBuilder.html#method.with_collector_endpoint
[`with_collector_endpoint`]: https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/config/collector/struct.CollectorPipeline.html#method.with_endpoint

```rust
// Note that this requires one of the following features enabled so that there is a default http client implementation
Expand Down Expand Up @@ -143,10 +143,11 @@ fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {

## Kitchen Sink Full Configuration

[Example]((https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/#kitchen-sink-full-configuration)) showing how to override all configuration options. See the
[`PipelineBuilder`] docs for details of each option.
[`Example`] showing how to override all configuration options. See the
[`AgentPipeline`] docs for details of each option.

[`PipelineBuilder`]: https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/struct.PipelineBuilder.html
[`Example`]: https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/#kitchen-sink-full-configuration
[`AgentPipeline`]: https://docs.rs/opentelemetry-jaeger/latest/opentelemetry_jaeger/config/agent/struct.AgentPipeline.html

## Supported Rust Versions

Expand Down
5 changes: 5 additions & 0 deletions opentelemetry-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ From the root directory, run the following command:
```sh
cargo bench
```

## Supported Rust Versions
OpenTelemetry is built against the latest stable release. The minimum supported version is 1.64. The current OpenTelemetry version is not guaranteed to build on Rust versions earlier than the minimum supported version.

The current stable Rust compiler and the three most recent minor versions before it will always be supported. For example, if the current stable compiler version is 1.64, the minimum supported version will not be increased past 1.46, three minor versions prior. Increasing the minimum supported compiler version is not considered a semver breaking change as long as doing so complies with this policy.
2 changes: 1 addition & 1 deletion opentelemetry-zipkin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ available so be sure to match them appropriately.
[Example](https://docs.rs/opentelemetry-zipkin/latest/opentelemetry_zipkin/#kitchen-sink-full-configuration) showing how to override all configuration options. See the
[`ZipkinPipelineBuilder`] docs for details of each option.

[`ZipkinPipelineBuilder`]: struct.ZipkinPipelineBuilder.html
[`ZipkinPipelineBuilder`]: https://docs.rs/opentelemetry-zipkin/latest/opentelemetry_zipkin/struct.ZipkinPipelineBuilder.html

## Supported Rust Versions

Expand Down
5 changes: 3 additions & 2 deletions opentelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ In particular, the following crates are likely to be of interest:
- [`opentelemetry-contrib`] provides additional exporters and propagators that
are experimental.
- [`opentelemetry-datadog`] provides additional exporters to [`Datadog`].
- [`opentelemetry-dynatrace`] *Deprecated, last release 0.4.0* provides additional exporters to [`Dynatrace`]. See [README](opentelemetry-dynatrace/README.md)
- [`opentelemetry-dynatrace`] *Deprecated, last release 0.4.0* provides additional exporters to [`Dynatrace`]. See [README][`opentelemetry-dynatrace-readme`]
- [`opentelemetry-http`] provides an interface for injecting and extracting
trace information from [`http`] headers.
- [`opentelemetry-jaeger`] provides a pipeline and exporter for sending trace
Expand Down Expand Up @@ -119,6 +119,7 @@ above, please let us know! We'd love to add your project to the list!
[`Dynatrace`]: https://www.dynatrace.com
[`opentelemetry-datadog`]: https://crates.io/crates/opentelemetry-datadog
[`opentelemetry-dynatrace`]: https://crates.io/crates/opentelemetry-dynatrace
[`opentelemetry-dynatrace-readme`]: https://github.com/open-telemetry/opentelemetry-rust-contrib/blob/main/opentelemetry-dynatrace/README.md
[`opentelemetry-semantic-conventions`]: https://crates.io/crates/opentelemetry-semantic-conventions
[`http`]: https://crates.io/crates/http

Expand Down Expand Up @@ -148,4 +149,4 @@ this policy.

## Contributing

See the [contributing file](CONTRIBUTING.md).
See the [contributing file](../CONTRIBUTING.md).
10 changes: 10 additions & 0 deletions scripts/markdown-link-check-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"httpHeaders": [
{
"urls": ["https://crates.io"],
"headers": {
"Accept": "text/html"
}
}
]
}
17 changes: 17 additions & 0 deletions scripts/markdown-link-check-with-retry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -e

# this script helps to reduce sporadic link check failures by retrying at a file-by-file level

retry_count=3

for file in "$@"; do
for i in $(seq 1 $retry_count); do
if markdown-link-check --config "$(dirname "$0")/markdown-link-check-config.json" \
"$file"; then
break
elif [[ $i -eq $retry_count ]]; then
exit 1
fi
sleep 5
done
done

0 comments on commit 1be83bb

Please sign in to comment.