Skip to content

feat: add RPM packaging and Packit CI/CD for complytime-providers#5

Open
marcusburghardt wants to merge 2 commits intocomplytime:mainfrom
marcusburghardt:005-rpm-packaging-ci
Open

feat: add RPM packaging and Packit CI/CD for complytime-providers#5
marcusburghardt wants to merge 2 commits intocomplytime:mainfrom
marcusburghardt:005-rpm-packaging-ci

Conversation

@marcusburghardt
Copy link
Copy Markdown
Contributor

@marcusburghardt marcusburghardt commented Apr 24, 2026

Summary

Add complete Fedora RPM packaging pipeline for complytime-providers. A single source RPM produces two binary sub-packages so users can install only the providers they need:

  • complytime-providers-openscap — OpenSCAP scanning provider (requires complyctl, scap-security-guide)
  • complytime-providers-ampel — Ampel scanning provider (requires complyctl)

No main complytime-providers binary RPM is produced.

Files added:

  • complytime-providers.spec — Fedora Go packaging guidelines compliant spec with vendored dependencies, automatic bundled provides via vendor/modules.txt, and unit tests in %check
  • .packit.yaml — Full Packit CI/CD: COPR builds on PRs, Testing Farm tests on PRs, propose-downstream on release, Koji builds and Bodhi updates on dist-git commits
  • .fmf/version — FMF metadata root for Testing Farm plan discovery
  • plans/test-RPM-providers.fmf — TMT smoke test validating both provider binaries are installed at /usr/libexec/complytime/providers/ with executable permissions

Companion PR: complytime/complyctl#485 (complyctl side — spec simplification, GoReleaser cleanup, release docs)

Related Issues

Review Hints

  • Review the two commits in sequence:

    1. RPM spec (feat:): the complytime-providers.spec file with sub-package definitions
    2. CI/CD (ci:): Packit configuration, FMF metadata, and TMT test plan
  • Both rpmlint complytime-providers.spec and packit validate pass with zero errors. The packit validate warning about the package not existing is expected — it requires a Fedora package review first.

  • To build and test the RPM locally:

    # Download the source tarball
    spectool -g -R complytime-providers.spec
    
    # Build the SRPM
    rpmbuild -bs complytime-providers.spec \
      --define "_sourcedir $(pwd)" \
      --define "_srcrpmdir $(pwd)"
    
    # Build in mock (Fedora rawhide)
    mock -r fedora-rawhide-x86_64 rebuild complytime-providers-*.src.rpm
    
    # Verify two sub-packages produced (no main package)
    ls /var/lib/mock/fedora-rawhide-x86_64/result/*.rpm | grep -v src | grep -v debug
    # Expected:
    #   complytime-providers-openscap-*.x86_64.rpm
    #   complytime-providers-ampel-*.x86_64.rpm
    # Must NOT have: complytime-providers-0.0.1-*.x86_64.rpm (no main pkg)
    
    # Verify provider binary paths
    rpm -qlp /var/lib/mock/fedora-rawhide-x86_64/result/complytime-providers-openscap-*.x86_64.rpm
    rpm -qlp /var/lib/mock/fedora-rawhide-x86_64/result/complytime-providers-ampel-*.x86_64.rpm
    
    # Verify dependency on complyctl
    rpm -qp --requires /var/lib/mock/fedora-rawhide-x86_64/result/complytime-providers-openscap-*.x86_64.rpm \
      | grep complyctl
    
    # Verify bundled provides are auto-generated
    rpm -qp --provides /var/lib/mock/fedora-rawhide-x86_64/result/complytime-providers-openscap-*.x86_64.rpm \
      | grep "bundled(golang"

    Alternatively: packit build locally

  • The Requires: complyctl >= 0.0.8 version is a placeholder — it should be set to the first complyctl release that includes the provider SDK rename (pkg/provider/).

  • There is a simple release JOB in the workflow, but it is expected to be changed when integrating with Fedora.

Add Fedora RPM spec that builds from a single source package and
produces two binary sub-packages:
- complytime-providers-openscap (requires complyctl, scap-security-guide)
- complytime-providers-ampel (requires complyctl)

No main binary RPM is produced. Follows Fedora Packaging Guidelines
for Go projects with vendored dependencies. Uses vendor/modules.txt
via %license for automatic bundled provides generation.

rpmlint passes with 0 errors, 0 warnings.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Add Packit configuration with:
- COPR builds on PRs (Fedora rawhide/43/42, CentOS Stream 9/10)
- Testing Farm tests on PRs via TMT plans
- propose_downstream on release (rawhide, f43, f42)
- Koji builds and Bodhi updates on dist-git commits

Add FMF metadata root and TMT test plan that validates both
provider binaries are installed at the expected path with
executable permissions after RPM installation.

packit validate confirms configuration is valid.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.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.

1 participant