debian-forge-composer/internal/mocks
Achilleas Koutsou 1c4d8f9988 dnfjson: use repo config hash as repo ID
Defined a Hash() method on rpmmd.RepoConfig that calculates a SHA-256 ID
for a repository based on its configuration.  Identical configurations
should produce the same ID.  The Name and ImageTypeTags of a repository
aren't taken into account.  These attributes affect a repository's
functional configuration.

This ID lets us change the way we handle repository configurations in a
few places:
- Preparing the depsolve job arguments is simpler since we have
  predictable IDs for the repository configurations.  We don't need to
  rely on the index of a RepoConfig in a list to identify or access it,
  which prevented us from building a list of all repository
  configurations, since we needed them to be placed in the list in a
  certain order.
- Associating packages from the depsolve result with the repository
  configuration (in depsToRPMMD) no longer relies on an ID string
  converted from and back to an integer index.  Repositories define
  their own IDs.
- Tests are a bit messier now but the changes simplify the main code, so
  it's an acceptable trade-off.
    - Fixtures need to change based on the repository configuration for
      the test.
    - We need to calculate the ID for the repository configuration for
      the temporary file server URL.
2022-06-01 11:36:52 +01:00
..
distro Make the Distroregistry FromHost() return distro with correct name 2021-05-14 15:43:00 +02:00
dnfjson dnfjson: use repo config hash as repo ID 2022-06-01 11:36:52 +01:00
rpmmd Replace all rpmmd.Depsolve() calls with dnfjson 2022-06-01 11:36:52 +01:00
rpmrepo dnfjson: add package tests 2022-06-01 11:36:52 +01:00