Skip to content

add single-crate consistency check, using the sparse index - #3479

Open
syphar wants to merge 2 commits into
rust-lang:mainfrom
syphar:new-consistency
Open

add single-crate consistency check, using the sparse index#3479
syphar wants to merge 2 commits into
rust-lang:mainfrom
syphar:new-consistency

Conversation

@syphar

@syphar syphar commented Aug 27, 2026

Copy link
Copy Markdown
Member

thinking about the future where the git index might be only updated once an hours, we need another source for the consistency check.

So with this, when the db is outdated for a single crate, we can just sync that.

I imagine that we could also run a scheduler similar to the repo stats.

the removed queue.attempt was obsolete code that's not needed any more

( test failure is unrelated)

@syphar syphar self-assigned this Aug 27, 2026
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Aug 27, 2026
@syphar syphar changed the title confs add single-crate consistency check, using the sparse index Aug 27, 2026
@syphar
syphar marked this pull request as ready for review August 27, 2026 08:40
@syphar
syphar requested a review from a team as a code owner August 27, 2026 08:40
@syphar

syphar commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

r? @GuillaumeGomez

@rustbot rustbot assigned GuillaumeGomez and unassigned syphar Aug 27, 2026
@GuillaumeGomez

Copy link
Copy Markdown
Member

Failed CI.

@syphar

syphar commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

Failed CI.

that test failure is unrelated

Ok(crates)
}

pub(super) async fn load_single(conn: &mut sqlx::PgConnection, name: &KrateName) -> Result<Crates> {

@GuillaumeGomez GuillaumeGomez Aug 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't it be better to return Result<Option<Crate>> instead since we always return 0 or 1?

View changes since the review

@syphar syphar Aug 27, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

initially I would have answered we need the list, so we can reuse the same calculate_diff algo that we have for the whole index.

But then I rememnered:

  • the algorithm just needs an Iterator
  • and Option implements that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants