3 Commits

Author SHA1 Message Date
unkinben f487365f96 feat: dist_tag boolean for distro-aware release strings
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build-fedora42 Pipeline was successful
ci/woodpecker/pr/build-fedora44 Pipeline was successful
ci/woodpecker/pr/build-fedora43 Pipeline was successful
ci/woodpecker/pr/build-almalinux8 Pipeline was successful
ci/woodpecker/pr/build-almalinux9 Pipeline was successful
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 69 metadata.yaml files updated with dist_tag: true
- Exclude jellyfin from dist_tags
2026-05-17 12:36:06 +10:00
unkinben 651a38392e feat: add HTTP sessions and retry logic for Gitea/GitHub API calls
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
2026-05-17 12:35:11 +10:00
unkinben 91771c2c4a fix: make package existence check distro-aware
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.
2026-05-17 12:35:11 +10:00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -11,9 +11,9 @@ builds:
release: 1
repository:
- almalinux/el8
version: 2.1.156
version: 2.1.126
- image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
release: 1
repository:
- almalinux/el9
version: 2.1.156
version: 2.1.126
+1 -1
View File
@@ -6,7 +6,7 @@ set -e
dnf install -y unzip
# Download and extract vault
curl -L -o /app/vault.zip https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/hashicorp-releases/vault/${PACKAGE_VERSION}/vault_${PACKAGE_VERSION}_linux_amd64.zip
curl -L -o /app/vault.zip https://releases.hashicorp.com/vault/${PACKAGE_VERSION}/vault_${PACKAGE_VERSION}_linux_amd64.zip
unzip vault.zip
# Process the nfpm.yaml template with environment variables