-
Notifications
You must be signed in to change notification settings - Fork 35
Remove build-time field to avoid changing all pages on each build #119
Conversation
We are re-uploading all pages even if they didn't change anything because on each build we inject a different date-time.
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.
The main reason of this PR is to not re-upload every single HTML file that hasn't changed at all on each build. The only reason why those files have changed is the build_date
dumped into the READTHEDOCS_DATA
object.
I'm 👍🏼 removing this. However, we are loosing some information with this change. People could be using the READTHEDOCS_DATA.build_date
to do something we are not aware. I'm not super worried about this since this is an undocumented feature, tho, but just wanted to note this could "break" someones' docs.
Also, I wanted to mentioned that we talked about creating an endpoint, for example, /api/v3/metadata/?url=https://docs.readthedocs.io/en/stable/
that returns this READTHEDOCS_DATA
object for this particular file/URL. That should be the canonical way to query this data and always be updated for that file.
As an example, for this page https://docs.readthedocs.io/en/stable/ the object looks like: {
"ad_free": false,
"api_host": "https://readthedocs.org",
"build_date": "2023-01-24T10:41:29Z",
"builder": "sphinx",
"canonical_url": null,
"commit": "e1e7a186",
"docroot": "/docs/user/",
"features": {
"docsearch_disabled": false
},
"global_analytics_code": "UA-17997319-1",
"language": "en",
"page": "index",
"programming_language": "py",
"project": "docs",
"proxied_api_host": "/_",
"source_suffix": ".rst",
"subprojects": {},
"theme": "sphinx_rtd_theme",
"user_analytics_code": "UA-17997319-6",
"version": "stable"
} |
Wort to note that projects using https://github.com/mgeier/sphinx-last-updated-by-git will also have this "problem" |
Hrm, we are adding the commit hash at the bottom of the page as well, So, I think that even removing the |
The |
- Put this new feature under a feature flag. - Works out of the box with our current settings, no rclone configuration file required. - Uses the local filesystem when running tests, uses minion during dev. - We need to install rclone in our builders for this to work. - I'm using the checks implemented in #9890, that needs to be merged first. - If we want even faster upload times for sphinx, we can merge readthedocs/readthedocs-sphinx-ext#119, since right now we are re-uploading all files. To test this, you need to re-build your docker containers. Closes #9448
I just noticed that we are including the Also, I want to note here that the new js client won't use this data. In fact, the new |
I added this feature (adding the build date to the output) that this PR removes. It was definitely more useful in the past where we had sync issues with remote storage or keeping multiple disks in sync. I'm OK with removing this feature and I think it will allow more efficient caching of files. |
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'm 👍 on this change, but also agree we should remove the commit as well, to properly solve the problem.
If we need the commit, we should be able to get it from the server.
Checked this locally, after removing the commit, pages aren't re-uploaded. But this will be noticed more when re-building the same commit, since our theme includes the commit. |
Yeah, I mentioned that in a previous comment #119 (comment) However, all the other projects not using our theme will benefit from this. Eventually, we can remove this feature from our theme and/or make it opt-in. |
We are re-uploading all pages even if they didn't change anything because on each build we inject a different date-time.
As far as I can see, we aren't using this field anywhere in our code base.