Skip to content

Commit

Permalink
Replace linkinator with lychee (rerun-io#5969)
Browse files Browse the repository at this point in the history
### What

Use https://github.com/lycheeverse/lychee instead of Linkinator and fix
a bunch of links.

Advantages of lychee:
* can run locally easily, config is an easy to read file and not on the
ci job
* finds a bunch of links linkinator missed
* caches successful links for a while

Unfortunately, there's no conda package, so I couldn't make this a pixi
task. But this is rarely needed to run locally and the install
instructions are simple.


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/5969?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/5969?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/5969)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
Wumpf authored Apr 15, 2024
1 parent 0e4b213 commit 8aed310
Show file tree
Hide file tree
Showing 9 changed files with 528 additions and 319 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To get an auto-generated PR description you can put "copilot:summary" or "copilo
* [ ] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
* [ ] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/{{ pr.number }})
- [PR Build Summary](https://build.rerun.io/pr/{{pr.number}})
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,65 +14,3 @@ By convention:
If you are going to be doing any editing of workflows, the
[VS Code extension](https://marketplace.visualstudio.com/items?itemName=cschleiden.vscode-github-actions)
for GitHub Actions is highly recommended.

## Reusable workflows

- [reusable_checks.yml](reusable_checks.yml) - These are all the checks that run to ensure the code is formatted,
linted, and tested. This job produces no artifacts other than a pass/fail criteria for the build.
- `SAVE_CACHE` - If true, the rust cache will be saved. Generally we only do this for builds on `main`
- [reusable_bench.yml](reusable_bench.yml) - This job runs the benchmarks to check for performance regressions.
- `SAVE_BENCH` - If true, then the benchmark results are saved to update https://ref.rerun.io/dev/bench/
- [reusable_deploy_docs](reusable_deploy_docs.yml) - This job deploys the python and rust documentation to https://ref.rerun.io
- `PY_AND_CPP_DOCS_VERSION_NAME` - The name to use for versioning the python docs. This should generally match the version in
`Cargo.toml`.
- `UPDATE_LATEST` - If true, then the docs will be deployed to `latest/` as well as the versioned directory.
- [reusable_build_and_test_wheels.yml](reusable_build_and_test_wheels.yml) - This job builds the wheels, runs the
end-to-end test, and produces a sample RRD. The artifacts are accessible via GitHub artifacts, but not otherwise
uploaded anywhere.
- `MATURIN_FEATURE_FLAGS` - The feature flags to pass to maturin.
- `PLATFORM` - Which platform to build for: `linux-arm64`, `linux-x64`, `macos-arm64`, `macos-x64`, or `windows-x64`.
- `RELEASE_VERSION` - If producing a release, the version number. This must match the version in `Cargo.toml`.
- `RRD_ARTIFACT_NAME` - Intermediate name of the GitHub rrd artifact for passing to `reusable_upload_wheels.yml`
- `SAVE_CACHE` - If true, the rust cache will be saved. Generally we only do this for builds on `main`
- `WHEEL_ARTIFACT_NAME` - Intermediate name of the GitHub wheel artifact for passing to `reusable_upload_wheels.yml`
- [reusable_upload_wheels.yml](reusable_upload_wheels.yml) - This job uploads the wheels to google cloud
- `RRD_ARTIFACT_NAME` - Intermediate name of the GitHub rrd artifact. This should match the name passed to
`reusable_build_and_test_wheels.yml`
- `WHEEL_ARTIFACT_NAME` - Intermediate name of the GitHub wheel artifact. This should match the name passed to
`reusable_build_and_test_wheels.yml`
- [reusable_build_web.yml](reusable_build_web.yml) - This job builds the wasm artifacts for the web.
- `RELEASE_VERSION` - If producing a release, the version number. This must match the version in `Cargo.toml`.
- [reusable_upload_web.yml](reusable_upload_web.yml) - This job uploads the web assets to google cloud. By default this
only uploads to: `app.rerun.io/commit/<commit>/`
- `MARK_TAGGED_VERSION` - If true, then the web assets will go to `app.rerun.io/version/<RELEASE_VERSION>`
- `RELEASE_VERSION` - If producing a release, the version number.
- `RRD_ARTIFACT_NAME` - Intermediate name of the GitHub rrd artifact. This should match the name passed to
`reusable_build_and_test_wheels.yml`
- `UPLOAD_COMMIT_OVERRIDE` - If set, will replace the value of `<commit>`. This is necessary because we want pull
request builds associated with their originating commit, even if the web-build happens on an ephemeral merge-commit.
- [reusable_build_web_demo.yml](reusable_build_web.yml) - This job builds the assets uploaded to `demo.rerun.io`.
- `SOURCE_LINK_COMMIT_OVERRIDE` - If set, will replace the value of `<commit>` in the built app. This ensures that the
source code link in the built app always points to the pull request's `HEAD`.
- [reusable_upload_web_demo.yml](reusable_upload_web_demo.yml) - This job uploads the `demo.rerun.io` assets to google cloud. By default this
only uploads to: `demo.rerun.io/commit/<commit>/`
- `MARK_TAGGED_VERSION` - If true, then the web assets will go to `demo.rerun.io/version/<RELEASE_VERSION>`
- `RELEASE_VERSION` - If producing a release, the version number.
- `UPLOAD_COMMIT_OVERRIDE` - If set, will replace the value of `<commit>`. This is necessary because we want pull
request builds associated with their originating commit, even if the web-build happens on an ephemeral merge-commit.
- `PR_NUMBER` - If set, will upload `demo.rerun.io/pr/<PR_NUMBER>`
- [reusable_pr_summary.yml](reusable_pr_summary.yml) - This job updates the PR summary with the results of the CI run.
- This summary can be found at:
`https://build.rerun.io/pr/<PR_NUMBER>/`
- `PR_NUMBER` - The PR number to update. This will generally be set by the `on_pull_request.yml` workflow using:
`${{github.event.pull_request.number}}`

## Manual workflows

- [manual_dispatch](manual_dispatch.yml) - This workflow is used to manually trigger the assorted reusable workflows for
testing.
- See the workflow file for the list of parameters.
- [manual_build_wheels_for_pr.yml](manual_build_wheels_for_pr.yml) - This workflow can be dispatched on a branch and
will build all of the wheels for the associated pull-request. Uses:
- [reusable_build_and_test_wheels.yml](reusable_build_and_test_wheels.yml)
- [reusable_upload_wheels.yml](reusable_upload_wheels.yml)
- [reusable_pr_summary.yml](reusable_pr_summary.yml)
37 changes: 0 additions & 37 deletions .github/workflows/documentation.yaml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,27 @@ jobs:

- name: prettier --check
run: pixi run misc-fmt-check

# ---------------------------------------------------------------------------

link-checker:
name: Check links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Restore link checker cache
uses: actions/cache@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

# Check https://github.com/lycheeverse/lychee on how to run locally.
- name: Link Checker
id: lychee
uses: lycheeverse/[email protected]
with:
fail: true
lycheeVersion: "0.14.3"
args: "--base . --cache --max-cache-age 1d ."
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ We're still ramping up for programmable blueprints (soon!), but meanwhile enjoy
- 🔺 Built-in STL mesh support.
- 🎥 First-person camera.
- 🐛 Fixes regressions in Space View spawn heuristics from 0.13, and many more bugfixes.
- 🧑‍🏫 Two new examples: [Gesture Recognition](https://github.com/rerun-io/rerun/tree/release-0.14.0/examples/python/gesture_detection) & [RRT* Pathfinding](https://github.com/rerun-io/rerun/tree/release-0.14.0/examples/python/rrt-star)
- 🧑‍🏫 Two new examples: [Gesture Recognition](https://github.com/rerun-io/rerun/tree/0.14.0/examples/python/gesture_detection) & [RRT* Pathfinding](https://github.com/rerun-io/rerun/tree/0.14.0/examples/python/rrt-star)

### 🔎 Details
### 🔎 Details
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ We use [Trunk Based Development](https://trunkbaseddevelopment.com/), which mean

All PR:s are merged with [`Squash and Merge`](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits), meaning they all get squashed to just one commit on the `main` branch. This means you don't need to keep a clean commit history on your feature branches. In fact, it is preferable to add new commits to a branch rather than rebasing or squashing. For one, it makes it easier to track progress on a branch, but rebasing and force-pushing also discourages collaboration on a branch.

Our CI will run benchmarks on each merged PR. The results can be found at <https://rerun-io.github.io/rerun/dev/bench/>.
Our CI will [record various binary sizes](https://build.rerun.io/graphs/sizes.html) and run [some benchmarks](https://build.rerun.io/graphs/crates.html) on each merged PR.

Pull requests from external contributors require approval for CI runs. This can be done manually, by clicking the `Approve and run` button:

Expand Down
2 changes: 0 additions & 2 deletions examples/rust/revy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ thumbnail_dimensions = [480, 480]
<source media="(max-width: 480px)" srcset="https://static.rerun.io/revy/d451ab9e75a1bcdf140f592feaf15e0cf0041259/480w.png">
<source media="(max-width: 768px)" srcset="https://static.rerun.io/revy/d451ab9e75a1bcdf140f592feaf15e0cf0041259/768w.png">
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/revy/d451ab9e75a1bcdf140f592feaf15e0cf0041259/1024w.png">
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/revy/d451ab9e75a1bcdf140f592feaf15e0cf0041259/1200w.png">
</picture>


## Overview

Revy is a proof-of-concept time-travel debugger for the [Bevy](https://github.com/bevyengine/bevy) game engine, built using [Rerun](https://github.com/rerun-io/rerun).
Expand Down
60 changes: 60 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
################################################################################
# Config for the link checker lychee.
#
# Download & learn more at:
# https://github.com/lycheeverse/lychee
#
# Example config:
# https://github.com/lycheeverse/lychee/blob/master/lychee.example.toml
#
# Run `lychee . --dump` to list all found links that are being checked.
################################################################################

# Maximum number of concurrent link checks.
# Workaround for "too many open files" error on MacOS, see https://github.com/lycheeverse/lychee/issues/1248
max_concurrency = 32


# URLs to check (supports regex). Has preference over all excludes.
exclude_path = [
# Unfortunately lychee doesn't yet read .gitignore https://github.com/lycheeverse/lychee/issues/1331
# The following entries are there because of that:
"__pycache__",
"_deps/",
".pixi",
"build",
"docs/python/",
"rerun_cpp/docs/html",
"rerun_cpp/docs/xml",
"rerun_py/site/",
"target_ra",
"target_wasm",
"target",
"rerun_cpp/tmp/",

# Actually ignored files beyond .gitignore
"scripts/screenshot_compare/assets/templates/",
]

# Exclude URLs and mail addresses from checking (supports regex).
exclude = [
'.*?speculative-link', # Skip speculative links
'.github/workflows/.*.yml', # GitHub action workflows cause issues on CI.
'\$relpath\^', # Relative paths as used by rerun_cpp's doc header.
'%7B%7B.+%7D%7D', # Ignore things that look like links because of `href` but are actually replacement strings. The URL escaping is for '{{.+}}' (this seems to be needed for html embedded urls since lychee assumes they use this encoding).
'https://crates.io/crates/.*', # Avoid crates.io rate-limiting
'https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html', # Nyud links are down every now and then.
'https://eigen.tuxfamily.org/', # Website down https://gitlab.com/libeigen/eigen/-/issues/2804
'https://fonts.googleapis.com/', # Font API entrypoint, not a link.
'https://fonts.gstatic.com/', # Font API entrypoint, not a link.
'https://github.com/rerun-io/rerun/pull/\.*', # Ignore links to our own pull requests (typically in changelog).
'https://github.com/rerun-io/rerun/commit/\.*', # Ignore links to our own commits (typically in changelog).
'https://stackoverflow.com/.', # Stackoverflow links are no longer accessible from CI.
'https://www.tensorflow.org/', # tensorflow.org apparently blocks CI.

# Works but is really slow at times:
'https://openaccess.thecvf.com/content/CVPR2023/html/Du_Learning_To_Render_Novel_Views_From_Wide-Baseline_Stereo_Pairs_CVPR_2023_paper.html',
'https://anaconda.org/conda-forge/arrow-cpp',

#'^file:///', # Ignore local file links. They need to be tested, but it's useful for external links we have to ping.
]
Loading

0 comments on commit 8aed310

Please sign in to comment.