fix(deploy-artifacts): [INFRA-726] add RPM_DISTRIBUTIONS for distro-agnostic RPMs - #322
fix(deploy-artifacts): [INFRA-726] add RPM_DISTRIBUTIONS for distro-agnostic RPMs#322VivekASHub wants to merge 4 commits into
Conversation
…gnostic RPMs Mirror INFRA-722: when an RPM filename has no dist token, index it for every tag in RPM_DISTRIBUTIONS instead of inventing a path from the version string.
|
Two suggestions:
|
Avoid calling get_dist_for_rpm twice; get_rpm_metadata already returns dist as metadata[3]. Restore the JAR register_type comment unrelated to this change. Co-authored-by: Cursor <cursoragent@cursor.com>
@alexs-aero suggestions incorporated |
|
@VivekASHub did you test this against something in jfrog. |
arrowplum
left a comment
There was a problem hiding this comment.
I went and checked and it breaks so this will need reworking. The debs are fine but all installs for rpm based distros fail just because of how rpm indexes. It doesn't have the same approach as debian so there can't just be a single package that gets referenced by all of the distros. The files have to physically be there.
from slack:
I saw the connector releases that went out this morning https://github.com/citrusleaf/aerospike-connect/actions/runs/34500080450. I think they were just for testing but still giving this heads up. The noarch RPMs aren't installable from anywhere. I checked by installing: pointed rockylinux:8, rockylinux:9 and amazonlinux:2023 at the documented baseurl and all three fail. The one place it installs from is connect-rpm-dev-local/el8/noarch/, which nothing points at.
The deb half is fine. Debian indexing reads deb.distribution and the .all.deb installs from jammy, noble, bookworm and trixie off a single copy in pool/jammy/.
RPM doesn't work that way. Artifactory builds YUM metadata from the folder tree at yumRootDepth, which is 2, so only el8/noarch/repodata indexes the file. rpm.distribution=el8,el9,amzn2023 is stored and read by nothing. On top of that the published client config is baseurl=.../rpm/${DIST}/$ARCH/ with ARCH=$(uname -m), which never returns noarch, so el8/noarch/ is unreachable on el8 too.
The only workable shape is a copy in every / folder, not /noarch. A customer has one stanza and shouldn't have to know which of our packages are noarch. That's how Rocky does it.
Artifactory builds YUM metadata from the folder tree at yumRootDepth, so an RPM is only installable from the <dist>/<arch>/ folders it physically occupies; rpm.distribution is stored but indexes nothing. Staging a distro-agnostic package once under <dist>/noarch/ left it unreachable everywhere, including on the dist it was staged for, because client config resolves baseurl=.../<dist>/$basearch/ and $basearch never expands to noarch. process_rpm now writes one copy per <dist>/<arch> pair. Arch-specific packages keep their own folder; noarch packages fan out across RPM_ARCHITECTURES (--rpm-architectures, default x86_64,aarch64), validated like the dist list. discover_and_process iterates multi-line processor output so each copy gets its own companions and manifest entry, and get_rpm_props tags a copy with the dist folder it occupies rather than the whole requested list. The existing process_rpm test asserted the old <dist>/noarch layout yet stayed green: test_metadata.bats disables errexit in setup(), so its mid-test assertions were dead and only the trailing rm decided the result. Rewritten to assert last. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
*-1.noarch.rpm) to declare YUM dist tags viaRPM_DISTRIBUTIONSor--rpm-distributionswhen the filename has no dist token.amzn2,amzn2023,el7,el8,el9,el10). Filename tokens still win. Staging uses the first listed tag;rpm.distributionindexes every listed tag (same pattern as INFRA-722 /DEB_DISTRIBUTIONS).Test plan
npx bats .github/workflows/deploy-artifacts/tests/bats/test_metadata.batsnpx bats .github/workflows/deploy-artifacts/tests/bats/test_error_handling.batsnpx bats .github/workflows/deploy-artifacts/tests/bats/test_type_registry.bats*-1.noarch.rpmwith--rpm-distributions el8,el9,amzn2023Made with Cursor