fix/distro-aware-package-check #164

Merged
unkinben merged 3 commits from fix/distro-aware-package-check into master 2026-05-17 23:43:36 +10:00
Owner
No description provided.
unkinben added 3 commits 2026-05-17 11:39:27 +10:00
check_package_exists was only checking name+version+release, so an
almalinux package already in Gitea would cause fedora builds to be
skipped incorrectly.

Now passes the target distro from PackageInfo through to
check_package_exists, which maps it to an RPM dist suffix (.el9,
.fc43, etc.) and queries the Gitea package files endpoint to confirm
a distro-specific file exists before skipping the build.

Also adds fedora/42, fedora/43, fedora/44 to the allowed repository
values in the metadata schema.
Creates two module-level requests.Session objects (_gitea_session,
_github_session) with an HTTPAdapter backed by urllib3 Retry:
- 3 retries with 0.5s exponential backoff
- retries on 429, 500, 502, 503, 504 and connection errors
- GET-only to avoid unsafe retries

Benefits:
- TCP connections are pooled and reused across all package checks,
  including concurrent builds in ThreadPoolExecutor
- Transient network blips no longer cause spurious rebuilds
- Per-request timeouts tightened to 10s (Gitea) / 15s (GitHub)
  so failures surface quickly and the retry budget is actually useful
feat: dist_tag boolean for distro-aware release strings
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build-fedora44 Pipeline was successful
ci/woodpecker/pr/build-fedora42 Pipeline was successful
ci/woodpecker/pr/build-fedora43 Pipeline was successful
ci/woodpecker/pr/build-almalinux8 Pipeline failed
ci/woodpecker/pr/build-almalinux9 Pipeline failed
649373ff73
Adds a per-package dist_tag: true/false metadata flag (default false).
When enabled the build tool appends the RPM dist tag to the release
at build time so each distro produces a unique version in the Gitea
package registry:

  release: 1  +  almalinux/el9  ->  PACKAGE_RELEASE=1.el9
  release: 1  +  fedora/43      ->  PACKAGE_RELEASE=1.fc43

This ensures Gitea package existence checks don't confuse packages built
for one distro with those built for another (the original bug).

Changes:
- Add effective_release() and get_rpm_dist_tag() helpers
- Revert the broken files-endpoint check from the previous commit;
  dist disambiguation is now handled purely via the release string
- discover_packages and build_single both compute the effective release
  before constructing PackageInfo
- check_package_exists simplified back to a single version-level check
- dist_tag added to METADATA_SCHEMA and PackageMetadata dataclass
- All 72 metadata.yaml files updated with dist_tag: true
unkinben force-pushed fix/distro-aware-package-check from 649373ff73 to 13af3aeedf 2026-05-17 12:02:13 +10:00 Compare
unkinben force-pushed fix/distro-aware-package-check from 13af3aeedf to f487365f96 2026-05-17 12:36:36 +10:00 Compare
unkinben merged commit 8a3a585f8c into master 2026-05-17 23:43:36 +10:00
unkinben deleted branch fix/distro-aware-package-check 2026-05-17 23:43:36 +10:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/rpmbuilder#164