Skip to content

Conversation

@jameslamb
Copy link
Member

@jameslamb jameslamb commented Aug 12, 2025

Followup to #654

And earlier version of these changes were already approved in #657 ... I'll repurpose that PR to just be about adding the "Inactive Projects" section.

This project does some post-processing to ensure that links like /stable, /latest, /legacy, and /nightly point to the correct versions. I misunderstood how that worked and so missed it in #654, resulting in some broken and incorrect links.

This consolidates duplication implementations of the same "what versions of the API docs should be built?" logic to help reduce the risk of such mistakes in the future.

Notes for Reviewers

Ugh MORE PRs?

If this works well, there should be only 1 more PR to fully restore the changes from #654 and finish rapidsai/build-planning#197.

Then 1 more with docs on all this (#664 (comment)).

Then I'll stop fiddling with this and move on 😅

How to review this

I know this looks like a lot, but I think the end state is actually simpler than the current state, even if the diff is kind of gross.

Real-world purpose of each of the files in the diff:

  • ci/download_from_s3.sh = download rendered HTML docs from the S3 bucket rapids-upload-docs posts to,
  • ci/update_symlinks.sh = implement paths like /stable via local symlinks, e.g. create a symbolic link _site/api/cudf/stable pointing to local directory ./_site/api/cudf/25.08
  • ci/customization/customize_doc.py = populate custom release selectors (dropdowns that say things like "stable (25.10)")
  • ci/customization/customize_docs_in_folder.sh = figure out which files to invoke customize_doc.py for, and invoke it

On main, those files have their own (and slightly different!) implementations of "figure out which versions of docs to build for which projects". That leads to issues like those that led to #658

This proposes centralizing that in one place that's re-used by all of them:

  • (new!) ci/get-projects-to-versions.sh = parse the configuration files in _data/ and determine which projects to build and what types + versions of docs to build for them

How I tested this

Check that this new script determines the expected set of projects and versions:

ci/get-projects-to-versions.sh
ci/customization/projects-to-versions.json (click me)
{
  "cucim": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "cudf": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "cudf-java": {
    "legacy": "25.06",
    "stable": "25.08"
  },
...
  "rapidsmpf": {
    "nightly": "25.10"
  },
  "rmm": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  }
}
``

<details><summary>full output (click me)</summary>

```text
Skipping: cuspatial | nightly | 25.10
Skipping: cuspatial | stable | 25.08
Skipping: cuproj | nightly | 25.10
Skipping: cuproj | stable | 25.08
Skipping: cusignal | legacy | 25.06
Skipping: cusignal | nightly | 25.10
Skipping: cusignal | stable | 25.08
Skipping: cudf-java | nightly | 25.10
Skipping: rapidsmpf | legacy | 25.06
Skipping: rapidsmpf | stable | 25.08
Skipping: libcuspatial | nightly | 25.10
Skipping: libcuspatial | stable | 25.08
Skipping: libcuproj | nightly | 25.10
Skipping: libcuproj | stable | 25.08
{
  "cucim": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "cudf": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "cudf-java": {
    "legacy": "25.06",
    "stable": "25.08"
  },
  "cugraph": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "cuml": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "cuproj": {
    "legacy": "25.06"
  },
  "cusignal": {},
  "cuspatial": {
    "legacy": "25.06"
  },
  "cuvs": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "cuxfilter": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "dask-cuda": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "dask-cudf": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "kvikio": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "libcudf": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "libcuml": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "libcuproj": {
    "legacy": "25.06"
  },
  "libcuspatial": {
    "legacy": "25.06"
  },
  "libkvikio": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "librmm": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "libucxx": {
    "legacy": "0.44",
    "nightly": "0.46",
    "stable": "0.45"
  },
  "raft": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "rapids-cmake": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  },
  "rapidsmpf": {
    "nightly": "25.10"
  },
  "rmm": {
    "legacy": "25.06",
    "nightly": "25.10",
    "stable": "25.08"
  }
}

Tested this locally end-to-end (including really downloading all the API docs from S3) following the docs added in #659

All looked good! API docs links worked, and selector dropdowns were correctly populated and their links worked. For example, for rapidsmpf (which should only have nightly docs):

image

and cuml (which should have nightly, stable, and legacy):

image

@netlify
Copy link

netlify bot commented Aug 12, 2025

Deploy Preview for docs-rapids-ai ready!

Name Link
🔨 Latest commit cca5af1
🔍 Latest deploy log https://app.netlify.com/projects/docs-rapids-ai/deploys/689ab6a01ede8f0008468441
😎 Deploy Preview https://deploy-preview-666--docs-rapids-ai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

**[{{ version_name }} ({{ site.data.releases[version_name].version }})](/api/{{ api.path }}/{{ version_name }})**
{%- endif -%}
{%- unless forloop.last %} | {% endunless -%}
{%- endfor %}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation change was already approved, merged, and proved working in #654 ... but it needs to show up here again because that was reverted (for other, unrelated reasons) in #658

# given a version number like "25.10", figure out the corresponding version name like "stable", "nightly", or "legacy"
for version_name, version_number in versions_dict.items():
if version_number == version_number_from_filepath:
return {"name": version_name, "number": version_number_from_filepath}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started the changes in this function to account for projects which don't have requested versions of all of nightly, stable, and legacy. For example, for rapidsmpfwe only hostnightly` API docs today:

docs/_data/docs.yml

Lines 170 to 179 in 5c2a36d

rapidsmpf:
name: RapidsMPF
path: rapidsmpf
desc: 'RAPIDS Multi-Process Foundation (rapidsmpf) is a collection of multi-GPU, distributed memory algorithms written in C++ and exposed to Python.'
ghlink: https://github.com/rapidsai/rapidsmpf
versions:
# enable or disable links; 0 = disabled, 1 = enabled
legacy: 0
stable: 0
nightly: 1

Because the version number we're comparing here is just {major}.{minor} (doesn't need to account for hotfix versions like 25.10.01), I think we can rely on always having exact matches.

And so don't need the r_versions class and its version-comparison logic.

@jameslamb jameslamb changed the title WIP: post-processing: consolidate project-to-versions implementations post-processing: consolidate project-to-versions implementations Aug 12, 2025
@jameslamb jameslamb marked this pull request as ready for review August 12, 2025 03:40
@jameslamb jameslamb requested a review from a team as a code owner August 12, 2025 03:40
@jameslamb
Copy link
Member Author

Thanks @ajschmidt8 ! I'll merge this so we can get some feedback from a deployment.

We're getting close, I swear 😅

@jameslamb jameslamb merged commit b04146f into main Aug 12, 2025
6 checks passed
@jameslamb jameslamb deleted the centralize-version-handling branch August 12, 2025 21:47
@jameslamb
Copy link
Member Author

The deployment succeeded!

https://github.com/rapidsai/docs/actions/runs/16921632721/job/47948902232

And the API docs (https://docs.rapids.ai/api/ and everything linked from it) look right... correct versions and labels, working and correct selectors on individual projects' pages.

Almost there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants