Skip to content

[ci] Fix version matching between RTD pages and R-package pages - #6673

Merged
StrikerRUS merged 7 commits into
masterfrom
ci/rtd-r-version
Oct 29, 2024
Merged

StrikerRUS merged 7 commits into
masterfrom
ci/rtd-r-version

Conversation

@StrikerRUS

@StrikerRUS StrikerRUS commented Oct 10, 2024 •

Copy link
Copy Markdown
Collaborator

I believe this element selectors are quite unreliable and subject to frequent changes.
OK, it's shadow DOM, so we simply cannot access it.

image

Unfortunately, this fix will be active only with next release and is not backported to previous versions.

@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

@jameslamb Could you please enable RTD builds for this branch for testing?

@jameslamb

Copy link
Copy Markdown
Member

Sure! Done. The first build just started: https://readthedocs.org/projects/lightgbm/builds/25905740/

@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

Thank you!

@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

One more issue is that stable leads to 4.0.0 (and not 4.5.0) version of R-package docs.
https://lightgbm.readthedocs.io/en/stable/R/reference/

image

@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

I believe it's ready for reviews.

@StrikerRUS
StrikerRUS marked this pull request as ready for review October 10, 2024 22:52

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this! I don't know much about Javascript but I clicked around https://lightgbm.readthedocs.io/en/ci-rtd-r-version/R/reference/ and https://lightgbm.readthedocs.io/en/ci-rtd-r-version/ and the changes look good to me.

On vague idea to consider... could any of this version-replacement be done at build time instead of runtime, with sed or similar?

I did that recently in another project's sphinx Makefile and found it worked well:

https://github.com/rapidsai/legate-boost/blob/fea797e58718edb27e9ab5a054edeaa476ac047d/docs/Makefile#L17-L29

If that's possible, then it'd be nice for a few reasons:

  • less Javascript to maintain (which we don't have a lot of maintainer experience with)
  • docs site would load faster and more reliably

I'm marking this "Approve" because I support merging this and don't want these question to block it.

@StrikerRUS

StrikerRUS commented Oct 15, 2024 •

Copy link
Copy Markdown
Collaborator Author

@jameslamb Hey, great idea about build time changes!

I'll try to implement it in conf.py since that file already contains a lot of installation code and it won't be neccesary to duplicate the logic in make.bat.

This PR isn't critical, so I think we shouldn't merge the current fix.

@StrikerRUS StrikerRUS changed the title [ci] Fix version matching between RTD pages and R-package pages [WIP][ci] Fix version matching between RTD pages and R-package pages Oct 15, 2024
@StrikerRUS
StrikerRUS marked this pull request as draft October 15, 2024 12:47
@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

One more issue is that stable leads to 4.0.0 (and not 4.5.0) version of R-package docs.

Looks like RTD really treats stable as 4.0.0. Build hashes are the same

image

image

@jameslamb
Could you please help with this issue?

Linking
#5342
#5930

@jameslamb

Copy link
Copy Markdown
Member

hmmmm I don't understand that. Because at https://readthedocs.org/projects/lightgbm/versions/, it looks to me like readthedocs recognizes that stable and v4.5.0 refer to the same commit.

Screenshot 2024-10-15 at 10 23 06β€―PM

But I do see that the "Edit on GitHub" button at https://lightgbm.readthedocs.io/en/stable/ links to https://github.com/Microsoft/LightGBM/blob/d73c6b530b39a18a3cacaafc4e42550be853c036/docs/index.rst (which is v4.0.0). That suggests that this issue isn't limited to just the R package.

I just manually triggered a build of stable like this:

image

build link: https://readthedocs.org/projects/lightgbm/builds/25960601/

Let's see if that fixes it. If it does, then maybe we have to manually trigger a build for stable for every release (I'd assumed that just updating the stable tag here at GitHub would be enough).

@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

This PR is ready for new review.

@StrikerRUS
StrikerRUS marked this pull request as ready for review October 17, 2024 12:37
@StrikerRUS StrikerRUS changed the title [WIP][ci] Fix version matching between RTD pages and R-package pages [ci] Fix version matching between RTD pages and R-package pages Oct 17, 2024
@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

@jameslamb

I just manually triggered a build of stable like this:

Seems that helped!

Maybe the following code is related?
https://github.com/microsoft/LightGBM/blob/668bf5dadf1eb9a846302b2b76a313fbbef52870/docs/conf.py#L142-L148
Ref:
readthedocs/readthedocs.org#10935 (comment)
readthedocs/readthedocs.org#11183
and other issues in RTD repo with stable in the title: https://github.com/search?q=repo%3Areadthedocs%2Freadthedocs.org+stable&type=issues

@jameslamb

Copy link
Copy Markdown
Member

This all looks great to me @StrikerRUS , thank you for your hard work! I think the links you shared are very relevant, especially that code link showing the docs build reading VERSION.txt.

It seems to me that this PR plus manually rebuilding stable on every release should be enough.

Please merge this whenever you want.

@jameslamb jameslamb mentioned this pull request Oct 29, 2024
27 tasks done
@jameslamb

Copy link
Copy Markdown
Member

I also just added an about triggering a new stable readthedocs build to the release checklist at #6538, so we'll remember the next time we make a release.

@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

@jameslamb Thanks! Yeah, I believe that manual triggering is only the option for us for now, unfortunately.

@StrikerRUS
StrikerRUS merged commit 9b351e6 into master Oct 29, 2024
@StrikerRUS
StrikerRUS deleted the ci/rtd-r-version branch October 29, 2024 09:43
@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

@jameslamb And I'd like to ask you to remove ci-rtd-r-version branch on RTD since it's not needed anymore. πŸ˜ƒ

@jameslamb

Copy link
Copy Markdown
Member

done!

@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

Hmmm...
It's still visible in version selector widget. Hope it's temporarily before next build. Previously, removed branches disappeared immediately.

image

@jameslamb

Copy link
Copy Markdown
Member

Maybe you need to refresh your browser cache?

I don't see it when I navigate to https://lightgbm.readthedocs.io/en/latest/index.html

image

Or in the project settings at https://readthedocs.org/projects/lightgbm/versions/

image

@StrikerRUS

Copy link
Copy Markdown
Collaborator Author

Thanks for the suggestion!
Nevermind, it's gone without any actions from my side.

@jameslamb jameslamb mentioned this pull request Jan 23, 2025
32 of 33 tasks
@github-actions

github-actions Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants