debian-forge-composer/internal
Achilleas Koutsou 177ea1b08f Replace all rpmmd.Depsolve() calls with dnfjson
All calls to rpmmd.Depsolve() are now replaced with the equivalent call
to solver.Depsolve() (or dnfjson.Depsolve() for one-off calls).

Attached an unconfigured dnfjson.BaseSolver to all APIs and server
configurations where rpmmd.RPMMD used to be.  This BaseSolver instance
loads the repository credentials from the system and carries the cache
directory, much like the RPMMD field used to do.  The BaseSolver is used
to create an initialised (configured) solver with the platform variables
(module platform ID, release ver, and arch) before running a Depsolve()
or FetchMetadata() using the NewWithConfig() method.

The FillDependencies() call in the modulesInfoHandler() of the weldr API
has been replaced by a direct call to the Depsolve() function.  This
rpmmd function was only used here.  Replacing the rpmmd.Depsolve() call
in rpmmd.FillDependencies() with dnfjson.Depsolve() would have created
an import cycle.  The FillDependencies() function could have been moved
to dnfjson, but since it's only used in one place, moving the one-line
function body into the caller is ok.

For testing:

The mock-dnf-json is compiled to a temporary directory during test
initialisation and used for each Depsolve() or FetchMetadata() call.

The weldr API tests now use the mock dnfjson.  Each rpmmd_mock.Fixture
now also has a dnfjson_mock.ResponseGenerator.

All API calls in the tests use the proper functions from dnfjson and
only the dnf-json script is mocked.  Because of this, some of the
expected results in responses_test had to be changed to match correct
behaviour:
- The "builds" array of each package in the result of a module or
  project list is now sorted by version number (ascending) because we
  sort the package list in the result of dnfjson by NVR.
- 'check_gpg: true' is added to the expected response of the depsolve
  test.  The repository configs in the test weldr API specify 'CheckGPG:
  True', but the mock responses returned it as false, so the expected
  result didn't need to include it.  Since now we're using the actual
  dnfjson code to convert the mock response to the internal structure,
  the repository settings are correctly used to set flag to true for
  each package associated with that repository.
- The word "occurred" was mistyped as "occured" in rpmmd and is now
  fixed in dnfjson.
2022-06-01 11:36:52 +01:00
..
auth go.mod: Update openshift-online/ocm-sdk-go 2022-05-19 22:18:42 +02:00
blueprint blueprint: sanitize user home directories 2022-03-28 14:08:57 +02:00
boot distro: housekeeping with cpu arch and arch.Name() 2022-05-10 19:53:41 +02:00
client Replace all rpmmd.Depsolve() calls with dnfjson 2022-06-01 11:36:52 +01:00
cloud Upload to HTTPS S3 - Support self signed certificate 2022-05-26 13:46:00 +03:00
cloudapi cloudapi: Drop bucket from composer config 2022-06-01 12:03:12 +02:00
common internal/common: introduce function to convert data sizes 2021-11-02 18:32:47 +01:00
crypt crypt: add automatic darwin support 2020-07-17 07:48:22 +02:00
disk disk: test minimum directory size calculations 2022-04-29 08:55:36 +02:00
distro Replace all rpmmd.Depsolve() calls with dnfjson 2022-06-01 11:36:52 +01:00
distroregistry distro/fedora: refactor based on RHEL 9.0 code 2022-05-09 12:25:21 +02:00
dnfjson New package: dnfjson 2022-06-01 11:36:52 +01:00
jobqueue test: use T.TempDir to create temporary test directory 2022-04-05 09:27:43 +02:00
jsondb test: use T.TempDir to create temporary test directory 2022-04-05 09:27:43 +02:00
kojiapi Replace all rpmmd.Depsolve() calls with dnfjson 2022-06-01 11:36:52 +01:00
mocks Replace all rpmmd.Depsolve() calls with dnfjson 2022-06-01 11:36:52 +01:00
osbuild1 osbuild1: support VMDK subformat in QEMU assembler 2022-05-04 16:22:29 +02:00
osbuild2 distro/rhel86: ignore SRIOV interface via new udev rule on azure-rhui 2022-05-16 15:46:46 +02:00
ostree ostree: rename errors and introduce ParameterComboError 2022-02-23 11:08:24 +01:00
prometheus prometheus/job: measure time spent pending rather than queued 2022-05-14 17:47:38 +01:00
reporegistry reporegistry: remove unused ReposByArch() function 2022-03-09 23:22:06 +00:00
rhsm internal/rhsm: implement fallback to the previous mechanism 2021-08-09 12:40:23 +02:00
rpmmd rpmmd: introduce DepsolvePackageSets() to the RPMMD interface 2022-04-28 14:42:49 +02:00
store distro/fedora: refactor based on RHEL 9.0 code 2022-05-09 12:25:21 +02:00
target Upload to HTTPS S3 - Support self signed certificate 2022-05-26 13:46:00 +03:00
test internal/test: add small library for tests 2022-03-08 12:07:00 +01:00
upload koji: fix excessive logging & monitoring 2022-04-05 23:48:30 +02:00
weldr Replace all rpmmd.Depsolve() calls with dnfjson 2022-06-01 11:36:52 +01:00
worker prometheus/job: measure time spent pending rather than queued 2022-05-14 17:47:38 +01:00
tools.go go: vendor the oapi-codegen cmd 2021-02-01 15:32:58 +01:00