#776 Add configurable options to reduce downstream overrides
Opened by withenoughcoffee. Modified
withenoughcoffee/rpkg phase1-config-extensions  into  master

Download 776.patch

Add five new optional configuration keys that allow downstream tools
(fedpkg, centpkg, etc.) to customize common behavior via config rather
than Python subclasses:

  • default_branch: branch name returned when outside a Git repository
  • user_file: file path to read username from (e.g. ~/.fedora.upn)
  • build_url_prefix: string prepended to build URLs (e.g. "git+")
  • source_entry_type: sources file format type (e.g. "bsd", "old")
  • lookaside_download_path: lookaside cache download path template

All options are backward-compatible: when absent, existing behavior is
unchanged. When set, they eliminate the need for downstream packages to
override default_branch_merge(), load_user(), construct_build_url(),
and the lookasidecache property respectively.

Motivation:
Today, downstream tools like fedpkg maintain Python subclasses that
override methods just to change a string value (a branch name, a URL
prefix, a file path). This creates maintenance burden and makes rpkg
harder to adopt for new distributions. By exposing these values as
config keys, rpkg becomes truly distro-generic — any distribution can
use rpkg with just a config file, no Python fork required.

Testing:
- 16 new unit tests covering all five features (88 total, all pass)
- End-to-end verified with fedpkg: clone, verrel, sources, giturl,
gimmespec, lint, switch-branch, clog, releases-info all work
- Tested against multiple Fedora packages (python-six, curl, etc.)
- ruff clean, no style regressions

Also adds developer Makefile targets (dev-install, dev-test, dev-lint,
dev-smoke) for easier local testing of rpkg changes with fedpkg.

Signed-off-by: Autumn Nash autumnnash@microsoft.com

Metadata