Allow SyncRelease to set different source= value#228
Conversation
a4b1fb5 to
cef22a9
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a SyncRelease type that allows each release entry in a sync profile to optionally override the default source mirror URL, enabling use cases like syncing -dbgsym releases from a different mirror while keeping them grouped in the same profile.
Changes:
- Replaces
releases: Vec<String>withreleases: Vec<SyncRelease>in config and CLI args. - Adds
SyncReleaseparsing/helpers (name(),base_url()) and updates Debian/Fedora/Tails sync schedulers accordingly. - Updates example sync configuration to demonstrate per-release source overrides.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/src/schedule/tails.rs | Adapts Tails sync to use release.name() instead of assuming String. |
| tools/src/schedule/fedora.rs | Switches Fedora URL building to use SyncRelease helper for release-derived base. |
| tools/src/schedule/debian.rs | Uses release.base_url(...) for index URLs and passes release.name() through sync/import paths. |
| tools/src/config.rs | Introduces SyncRelease (string or { name, source }) and adds TOML parsing tests. |
| tools/src/args.rs | Updates CLI parsing to accept --release as SyncRelease. |
| contrib/confs/rebuilderd-sync.conf | Adds an example profile using per-release source overrides. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tools/src/schedule/debian.rs
Outdated
| let base_url = release.base_url(&sync.source); | ||
|
|
||
| // Downloading source package index | ||
| let db_url = format!("{base_url}/{component}/source/Sources.xz"); | ||
| let bytes = fetch_url_or_path(http, &db_url).await?; |
There was a problem hiding this comment.
Per-release source overrides are used to build base_url for downloading Sources.xz/Packages.xz, but the generated artifact URLs still use sync.source (via SyncState::push(..., &sync.source, ...)). For a debug release with a different mirror, this will produce wrong download URLs. Thread the selected source (override-or-default) through to artifact URL construction (e.g., pass it into import_*/push).
cef22a9 to
d1e850f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| state.import_compressed_binary_package_file( | ||
| &bytes, &sources, release, component, sync, | ||
| &bytes, | ||
| &sources, | ||
| release.name(), | ||
| component, | ||
| sync, | ||
| )?; |
There was a problem hiding this comment.
Debian sync now downloads indices from release.source(&sync.source), but the artifact URLs in reports are still built from sync.source (see SyncState::push via import_binary_pkg). For releases with an overridden source (e.g., debian-debug), this will produce incorrect artifact URLs pointing at the default mirror. Consider plumbing the per-release source through to import_*_binary_package_file/import_binary_pkg (e.g., pass release.source(&sync.source) alongside release.name()), and add a regression test covering a release with a custom source.
d61076d to
c8d6b75
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This allows a release to use a different mirror base url. This is useful for having
-dbgsymas part of the same profile (and benefit from having them grouped with the other builds).