Skip to content

Skip running a job if the crate/version deleted #11500

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

YohDeadfall
Copy link
Contributor

Fixes #11348.

After diffing in I found only 3 jobs that can fail because of deleted data. The rest should be fine.

Copy link
Member

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

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

nice work! could you try to write a few regression tests for this too? idk if that is viable for the RenderAndUploadReadme job, but for the other two I think this should be possible.

))
| Err(diesel::result::Error::NotFound) => {
warn!(
"Skipping rendering README for vesion {}: no version found",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Skipping rendering README for vesion {}: no version found",
"Skipping rendering README for version {}: no version found",

..,
)) = res
{
warn!("Skipping update default version for crate for {crate_id}: no crate found",);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
warn!("Skipping update default version for crate for {crate_id}: no crate found",);
warn!("Skipping update default version for crate for {crate_id}: no crate found");

let publish_details = PublishDetails::for_version(version_id, &mut conn).await?;
let Some(publish_details) = PublishDetails::for_version(version_id, &mut conn).await?
else {
warn!("Skipping publish notifications for {version_id}: no version found",);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
warn!("Skipping publish notifications for {version_id}: no version found",);
warn!("Skipping publish notifications for {version_id}: no version found");

@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Background jobs are infinitely retried if crates are deleted
2 participants