Skip to content

fix(deploy-artifacts): [INFRA-726] add RPM_DISTRIBUTIONS for distro-agnostic RPMs - #322

Open
VivekASHub wants to merge 4 commits into
mainfrom
INFRA-726
Open

fix(deploy-artifacts): [INFRA-726] add RPM_DISTRIBUTIONS for distro-agnostic RPMs#322
VivekASHub wants to merge 4 commits into
mainfrom
INFRA-726

Conversation

@VivekASHub

@VivekASHub VivekASHub commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Allow distro-agnostic RPMs (e.g. *-1.noarch.rpm) to declare YUM dist tags via RPM_DISTRIBUTIONS or --rpm-distributions when the filename has no dist token.
  • Validate that list against known tags (amzn2, amzn2023, el7, el8, el9, el10). Filename tokens still win. Staging uses the first listed tag; rpm.distribution indexes every listed tag (same pattern as INFRA-722 / DEB_DISTRIBUTIONS).

Test plan

  • npx bats .github/workflows/deploy-artifacts/tests/bats/test_metadata.bats
  • npx bats .github/workflows/deploy-artifacts/tests/bats/test_error_handling.bats
  • npx bats .github/workflows/deploy-artifacts/tests/bats/test_type_registry.bats
  • Dry-run deploy of a connector *-1.noarch.rpm with --rpm-distributions el8,el9,amzn2023

Made with Cursor

…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.
@VivekASHub
VivekASHub requested a review from a team as a code owner September 7, 2026 17:24
@alexs-aero

alexs-aero commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Two suggestions:

  • get_rpm_props parses dist twice. It calls get_dist_for_rpm and then get_rpm_metadata, which calls get_dist_for_rpm again. Keep using metadata[3] (or drop the extra call). Same fail-closed behavior, less work.
  • Unrelated edit. The JAR register_type comment removal in type_registry.sh is not part of this change. Restore it.
    CC: @arrowplum

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>
@VivekASHub VivekASHub closed this Sep 8, 2026
@VivekASHub VivekASHub reopened this Sep 8, 2026
@VivekASHub

Copy link
Copy Markdown
Contributor Author

Two suggestions:

  • get_rpm_props parses dist twice. It calls get_dist_for_rpm and then get_rpm_metadata, which calls get_dist_for_rpm again. Keep using metadata[3] (or drop the extra call). Same fail-closed behavior, less work.
  • Unrelated edit. The JAR register_type comment removal in type_registry.sh is not part of this change. Restore it.
    CC: @arrowplum

@alexs-aero suggestions incorporated
CC: @arrowplum

@arrowplum

arrowplum commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@VivekASHub did you test this against something in jfrog.
Does installing work for you?

@arrowplum arrowplum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

VivekASHub and others added 2 commits September 11, 2026 08:00
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants