Skip to content

Fix marking GitHub-sourced experiment crates as complete #756

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
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions src/results/db.rs
Original file line number Diff line number Diff line change
@@ -83,9 +83,31 @@ impl<'a> DatabaseDB<'a> {
data: &ProgressData,
encoding_type: EncodingType,
) -> Fallible<()> {
let krate = if let Some((old, new)) = &data.version {
// If we're updating the name of the crate (typically changing the hash we found on
// github) then we ought to also use that new name for marking the crate as complete.
// Otherwise, we leave behind the old (unversioned) name and end up running this crate
// many times, effectively never actually completing it.
self.update_crate_version(ex, old, new)?;

// sanity check that the previous name of the crate is the one we intended to run.
if old.id() != data.result.krate.id() {
log::warn!(
"Storing result under {} despite job intended for {} (with wrong name old={})",
new.id(),
data.result.krate.id(),
old.id(),
);
}

new
} else {
&data.result.krate
};

self.store_result(
ex,
&data.result.krate,
krate,
&data.result.toolchain,
&data.result.result,
&base64::engine::general_purpose::STANDARD
@@ -94,11 +116,7 @@ impl<'a> DatabaseDB<'a> {
encoding_type,
)?;

if let Some((old, new)) = &data.version {
self.update_crate_version(ex, old, new)?;
}

self.mark_crate_as_completed(ex, &data.result.krate)?;
self.mark_crate_as_completed(ex, krate)?;

Ok(())
}