-
Notifications
You must be signed in to change notification settings - Fork 665
Readme rendering - only rerender older than a date, only rerender for a crate #1010
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
Readme rendering - only rerender older than a date, only rerender for a crate #1010
Conversation
src/bin/render-readmes.rs
Outdated
|
||
let mut page_num = 0; | ||
|
||
for version_ids_chunk in &version_ids.into_iter().chunks(page_size) { |
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 didn't know about itertools, awesome crate!
Couldn't we use enumerate here to remove the mut page_num
?
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.
oooh yep, you're absolutely right!
src/bin/render-readmes.rs
Outdated
version.num | ||
); | ||
let readme_path = | ||
format!("readmes/{}/{}-{}.html", krate_name, krate_name, version.num); |
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.
Should we change the formatting string to "readmes/{0}/{0}-{}.html"
to avoid the krate_name
duplication ?
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.
sure!
version.num | ||
)); | ||
}); | ||
tasks.push(handle); | ||
} | ||
for handle in tasks { | ||
if let Err(err) = handle.join() { | ||
println!("Thead panicked: {:?}", err); | ||
println!("Thread panicked: {:?}", err); |
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.
Good catch!
Going to need a Version instead in the next few commits.
This will enable restarting of readme rendering without needing to rerender everything.
This'll make it easier to debug and try fixing particular crates.
d1ecd5d
to
fb3f3c6
Compare
fb3f3c6
to
eee6c09
Compare
bors: r+ |
1010: Readme rendering - only rerender older than a date, only rerender for a crate r=carols10cents Only rerender in a `Box<T>`, only rerender in Firefox :) These changes add some arguments to the render-readmes script to make it easier to restart a failed run only with those readmes that have not been rendered since a particular date, and to rerender one particular crate's readmes. By default, the render-readmes script still rerenders all readmes of all versions. But if the script is killed partway through, it doesn't need to be completely restarted-- you can grab the time that the script printed out that it started, then rerun with `--older-than thattime`, and it'll only try and render the ones it hasn't gotten to yet! Another thing I've wanted is the ability to render one particular crate's readmes, so that I don't have to scroll through all the logs to see why a particular crate failed. So I added the `--crate` argument too. I'd like to get this into the same deploy as #981 since that requires rerendering everything again. @kureuil, could you look over this and see if it looks like I might be breaking anything?
Build succeeded |
Only rerender in a
Box<T>
, only rerender in Firefox :)These changes add some arguments to the render-readmes script to make it easier to restart a failed run only with those readmes that have not been rendered since a particular date, and to rerender one particular crate's readmes.
By default, the render-readmes script still rerenders all readmes of all versions. But if the script is killed partway through, it doesn't need to be completely restarted-- you can grab the time that the script printed out that it started, then rerun with
--older-than thattime
, and it'll only try and render the ones it hasn't gotten to yet!Another thing I've wanted is the ability to render one particular crate's readmes, so that I don't have to scroll through all the logs to see why a particular crate failed. So I added the
--crate
argument too.I'd like to get this into the same deploy as #981 since that requires rerendering everything again.
@kureuil, could you look over this and see if it looks like I might be breaking anything?