-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional removal of changelogs #4943
Conversation
@sarayourfriend I am not sure if this is the right approach for this issue. Also right now I am having trouble adding further commits here, could not find what could we do here?: kb-0311@kb0311-IdeaPad-5-Pro-14ITL6:~/Desktop/openverse$ git commit -m "lint"
`pre-commit` not found. Did you forget to activate your virtualenv? |
@kb-0311 Can you confirm you have you set up #! /usr/bin/env bash
export TERM=xterm
./ov hook pre-commit "$@" If not, please follow the Let me know if you run into any issues with setting up |
Thanks a lot , fixed the env setup error : ) Coming to how the redirects are being handled here in my PR: openverse/documentation/conf.py Lines 139 to 144 in c95cc07
I am not really sure if this is the right way to go about it. Also, I could not really find the "Page not found" file location so just added a temporary value for now. |
This LGTM! I have two small requests, and then this will be good to go from my perspective. First is to add the following to nitpick_ignore_regex = () if INCLUDE_CHANGELOGS else (
("myst", ".*/changelogs/index.*"),
) This uses the Sphinx configuration option The other thing to do is address the redirect. I like the idea of using a redirect, and it simplifies things a lot to do so. However, it would be nice to redirect to a page that explains why the changelogs are missing, if someone happens to run across a link to the changelogs that doesn't resolve when they are working in docs locally. Here is a diff you can work from that does that, by adding an orphan page under diff --git a/documentation/conf.py b/documentation/conf.py
index 86035b925..a4d5e33ac 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -137,9 +137,6 @@ redirects = {
}
if "changelogs" in exclude_patterns:
- # temporary placeholder for now
- redirects["changelogs/"] = (
- "/general/contribution/github_contribution_practices.html"
- )
+ redirects["changelogs/index"] = "/meta/missing_changelogs.html"
myst_enable_extensions = ["linkify"]
diff --git a/documentation/meta/missing_changelogs.md b/documentation/meta/missing_changelogs.md
new file mode 100644
index 000000000..c98635e87
--- /dev/null
+++ b/documentation/meta/missing_changelogs.md
@@ -0,0 +1,13 @@
+---
+orphan: true
+---
+
+# Changelogs missing from local build
+
+The documentation build excludes changelogs unless it is in a CI environment or explicitly instructed to include changelogs. This significantly reduces the number of files processed for local preview builds, which cuts startup time of the documentation preview by half and improving the ergonomics of working with preview documentation locally.
+
+To force the inclusion of the changelogs, run the documentation build with `INCLUDE_CHANGELOGS=1` in your environment. For example, the following will run the preview build, including changelogs:
+
+```shell
+ov env INCLUDE_CHANGELOGS=1 just documentation/serve
+``` Let me know if these requests make sense, or if you would like help implementing them, and thanks as always for the contribution @kb-0311 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant to add that feedback to a request changes comment, sorry for the double ping.
@sarayourfriend Added the suggestions as well in the new commit, please do take a look when you are free. And thanks a lot for the help : ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I was able to test this locally by building with CI=1
and seeing the changelogs show up still and everything works perfectly. This is such a significant improvement, thanks again @kb-0311 🚀
Fixes
Fixes #4726 by @sarayourfriend
Description
Based on an environment variable conditionally removes the changelogs
Testing Instructions
Checklist
Update index.md
).main
) or a parent feature branch.ov just catalog/generate-docs
for catalogPRs) or the media properties generator (
ov just catalog/generate-docs media-props
for the catalog or
ov just api/generate-docs
for the API) where applicable.Developer Certificate of Origin
Developer Certificate of Origin