Skip to content

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

Merged

Conversation

carols10cents
Copy link
Member

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?

@carols10cents carols10cents requested a review from sgrif August 25, 2017 18:45

let mut page_num = 0;

for version_ids_chunk in &version_ids.into_iter().chunks(page_size) {
Copy link
Contributor

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 ?

Copy link
Member Author

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!

version.num
);
let readme_path =
format!("readmes/{}/{}-{}.html", krate_name, krate_name, version.num);
Copy link
Contributor

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 ?

Copy link
Member Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

@carols10cents carols10cents force-pushed the readme-rerendering-convenience branch 2 times, most recently from d1ecd5d to fb3f3c6 Compare August 26, 2017 17:33
@carols10cents carols10cents force-pushed the readme-rerendering-convenience branch from fb3f3c6 to eee6c09 Compare August 26, 2017 17:34
@carols10cents
Copy link
Member Author

bors: r+

bors-voyager bot added a commit that referenced this pull request Aug 26, 2017
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?
@bors-voyager
Copy link
Contributor

bors-voyager bot commented Aug 26, 2017

Build succeeded

@bors-voyager bors-voyager bot merged commit eee6c09 into rust-lang:master Aug 26, 2017
@carols10cents carols10cents deleted the readme-rerendering-convenience branch August 26, 2017 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants