Skip to content

manual request of a documentation rebuild for crate owners #2442

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
syphar opened this issue Mar 6, 2024 · 2 comments
Closed

manual request of a documentation rebuild for crate owners #2442

syphar opened this issue Mar 6, 2024 · 2 comments
Labels
A-backend Area: Webserver backend A-builds Area: Building the documentation for a crate E-medium Effort: This requires a fair amount of work

Comments

@syphar
Copy link
Member

syphar commented Mar 6, 2024

This is split off from automated rebuilds (#464), specifically #464 (comment) by @ShadowJonathan :

One other thing that i'd like to suggest is rebuild requests, to be able to manually request somewhere to rebuild a (very) out of date documentation of a crate.
I just encountered this with anymap, and while i think a rebuild of old documentation on every major release, or after a amount of "rotting" time (lets say, longer than a year or two years), and then automatically rebuilding them (most popular crates first), while i think that would be a good approach, the best heuristic would be to be able to have users re-request a build. (and have the button visible and active only when a build is X amount of time old)
In a good-faith case, someone clicks this when they see the documentation style outdated, and they think it'd be "good" to have it be up-to-date.
In a bad faith case, someone goes around queuing this for every crate. I personally see this as alright, but it depends on how much the build system can handle, and if it's possible to queue this on a very low priority.

@syphar
Copy link
Member Author

syphar commented Mar 6, 2024

General notes from the top of my head:

  • we don't want to handle user authentication in docs.rs, so the rebuild would have to be triggered from crates.io,
  • probably using a private authenticated API between crates.io & docs.rs
  • we would use a lower priority (probably the same as manual rebuilds from the shell, -5)

Either crates.io would do a GET request first to know if a rebuild is possible, and/or we deliver a nice error message why we can't execute a rebuild for a crate.

Because it's triggered through the crates.io interface, "bulk" rebuilds would be limited anyways.

Reasons I can imagine why we would block the rebuild:

  • there is already another build queued for that release
  • last build(-try) for that releases was less than X hours ago (TBD)
  • at some point, perhaps certain build errors where we already know that a rebuild won't help? (might be too complex)
  • ?

@Nemo157
Copy link
Member

Nemo157 commented Mar 6, 2024

Depending on the expected scale, we could maybe automate this through github actions, have a rebuild request issue type and a script that runs on issue creation and queues the rebuild.

@syphar syphar added E-medium Effort: This requires a fair amount of work A-builds Area: Building the documentation for a crate A-backend Area: Webserver backend labels Jun 15, 2024
pflanze added a commit to pflanze/docs.rs that referenced this issue Jun 24, 2024
This resolves rust-lang#2442.

- adds config variable `DOCSRS_TRIGGER_REBUILD_TOKEN` /
  `Config.trigger_rebuild_token`

- adds `build_trigger_rebuild_handler` and route
  "/crate/:name/:version/rebuild"

Note: does not yet contain any kind of rate limiting!
pflanze added a commit to pflanze/docs.rs that referenced this issue Jun 27, 2024
This resolves rust-lang#2442.

- adds config variable `DOCSRS_TRIGGER_REBUILD_TOKEN` /
  `Config.trigger_rebuild_token`

- adds `build_trigger_rebuild_handler` and route
  "/crate/:name/:version/rebuild"

Note: does not yet contain any kind of rate limiting!
pflanze added a commit to pflanze/docs.rs that referenced this issue Jul 11, 2024
This resolves rust-lang#2442.

- adds config variable `DOCSRS_TRIGGER_REBUILD_TOKEN` /
  `Config.trigger_rebuild_token`

- adds `build_trigger_rebuild_handler` and route
  "/crate/:name/:version/rebuild"

Note: does not yet contain any kind of rate limiting!
@syphar syphar closed this as completed in 8165b09 Jul 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-backend Area: Webserver backend A-builds Area: Building the documentation for a crate E-medium Effort: This requires a fair amount of work
Projects
None yet
Development

No branches or pull requests

2 participants