Skip to content

Extract archive push into ArchiveIndexBranch background job#13472

Open
Turbo87 wants to merge 8 commits intorust-lang:mainfrom
Turbo87:archive-index-branch-job
Open

Extract archive push into ArchiveIndexBranch background job#13472
Turbo87 wants to merge 8 commits intorust-lang:mainfrom
Turbo87:archive-index-branch-job

Conversation

@Turbo87
Copy link
Copy Markdown
Member

@Turbo87 Turbo87 commented Apr 21, 2026

Extract the archive push from SquashIndex into a new ArchiveIndexBranch background job. The job reads GIT_ARCHIVE_REPO_URL from config::Server (loaded once at startup) and is a no-op if no URL is configured. SquashIndex enqueues it after a successful squash-and-push, warning but not failing if the enqueue itself fails. The job is also manually enqueuable via crates-admin enqueue-job archive_index_branch <branch>.

This change ensures that a failing archival will not unintentionally retrigger another index squash. It also allows us in the future to move the ArchiveIndexBranch job to a low-priority job on the default background worker queue, which unlocks the regular index repository earlier, allowing the git index sync jobs to continue earlier too.

Related

@Turbo87 Turbo87 requested a review from a team April 21, 2026 14:58
@Turbo87 Turbo87 force-pushed the archive-index-branch-job branch from f481b6d to a56c046 Compare April 21, 2026 15:12
@rustbot

This comment has been minimized.

Turbo87 added 8 commits April 22, 2026 14:36
Reading the env var once at startup instead of on every job run, and
making it overridable per test via `with_config(|c| ...)`. Named
`index_archive_url` to distinguish it from unrelated archives (e.g.
version-downloads).
`run_pending_background_jobs()` panics when any job fails, which makes
it impossible for tests to deliberately exercise a job's failure path.
Factor out a `try_*` variant that returns the `check_for_failed_jobs`
result so callers can observe failures explicitly.
Mirrors a snapshot branch from the crate index to the `index_archive_url`
configured on `config::Server`, or no-ops if no URL is configured. Runs
on the `repository` queue with payload deduplication.
Lets operators manually enqueue `ArchiveIndexBranch` jobs for a given
snapshot branch name, e.g. to re-run a push that was lost because the
archive remote was down.
Drop the inline push to `index_archive_url` and delegate it to the
dedicated `ArchiveIndexBranch` background job. The blocking squash+push
now returns the snapshot branch name; the outer async code enqueues the
follow-up job, warning but not failing on connection or enqueue errors.
@Turbo87 Turbo87 force-pushed the archive-index-branch-job branch from a56c046 to 6c89397 Compare April 22, 2026 12:36
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 22, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants