feat: update crates sync script and remove legacy api#2041
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 215c5952e7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| rec = { | ||
| "crate": c_name, | ||
| "version": v, | ||
| "status": status, |
There was a problem hiding this comment.
Preserve successful manifest status when skipping imported crates
The skip path for already-imported crates relies on status == "ok" in process_one, but this function always rewrites the manifest record with the current result status. When a crate is skipped because it was already ok, this line stores "skip" and overwrites the previous "ok"; on the next run, the guard no longer matches and the crate/version is processed and pushed again. This breaks idempotent resume behavior and can trigger unnecessary large re-import/push cycles.
Useful? React with 👍 / 👎.
| vs = sorted(versions) | ||
| if max_versions_per_crate > 0: | ||
| vs = vs[-max_versions_per_crate:] |
There was a problem hiding this comment.
Order crate versions semantically before taking latest N
This sorts crate versions lexicographically and then slices the tail, which does not match semantic version ordering (for example, 1.10.0 sorts before 1.9.0 as a string). In the default streaming path, --max-versions-per-crate (including the default 1) can therefore select older releases instead of the newest versions.
Useful? React with 👍 / 👎.
No description provided.