Skip to content

Conversation

@adriendelsalle
Copy link
Member

@adriendelsalle adriendelsalle commented Aug 9, 2021

Description

This PR requires libsolv modification: https://github.com/openSUSE/libsolv/pull/469/files

  • get package metadata from libsolv solvable
    • get extra keys/values to patch serialized metadata
    • get signatures
    • avoid parsing error when either extra_metadata or signatures is empty
  • test if deps are found in libsolv pool or not
    • allow to know if the serialized metadata used to produced the signature contain the key or not
  • add a json_signable method to serialize signable package metadata
    • this uses the extra_metadata to use for signature reproducibility
  • update RepoIndexChecker and RepoChecker verify_package API
    • update v0.6.0::PkgMgrRole accordingly
  • improve transaction logs for package signatures
  • improve errors messages
    • add a role_error when verification of a role fails (instead of a threshold_error)
    • update tests

get package metadata from libsolv solvable
get extra keys/values to patch serialized metadata
test if deps are found in libsolv pool or not
add a json_signable method to serialize signable package metadata
update RepoIndexChecker and RepoChecker verify_package API
update v0.6.0 PkgMgrRole accordingly
improved transaction logs
avoid parsing error when either extra_metadata or signatures is empty
@adriendelsalle adriendelsalle marked this pull request as ready for review September 21, 2021 09:44
add a role_error
raise role error when verification of a role fails
update tests
@wolfv wolfv merged commit 51072d8 into mamba-org:master Sep 21, 2021
@adriendelsalle adriendelsalle deleted the libsolv-signatures branch September 21, 2021 14:09
cursor bot pushed a commit to maresb/mamba that referenced this pull request Nov 29, 2025
…entinel

When creating a PackageInfo from a URL (explicit install), populate
the defaulted_keys field to track which fields have stub/default
values rather than real metadata.

Per package type:
- Conda: [_initialized, build_number, license, timestamp, track_features, depends, constrains]
- Wheel/TarGz: above + [build, build_string]
- Git: [_initialized, version, channel, subdir, fn, timestamp, build, build_string, build_number, license, track_features, depends, constrains]

The _initialized sentinel enables fail-hard verification that all
code paths properly initialize defaulted_keys. It can be removed in
a future refactor if desired.

The defaulted_keys infrastructure was introduced in PR mamba-org#1120 for
signature verification but fell out of use in 2023 during the libsolv
wrapper refactor. This commit revives its use for distinguishing
"field has default value" from "field intentionally set to this value".

Tests fixed (expected to pass after this commit):
- defaulted_keys_populated_for_conda_url
- defaulted_keys_populated_for_wheel_url
- defaulted_keys_populated_for_tar_gz_url
- defaulted_keys_populated_for_git_url

NOTE: Tests need to be executed to verify GREEN status.

This is part 1/2 of the fix for mamba-org#4095.
Related: mamba-org#4095
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.

2 participants