Skip to content

Fix VariantPaths: strict v2.0 serialization, src arch support, and public Location API#231

Merged
lubomir merged 2 commits intorelease-engineering:developmentfrom
guillermodotn:fix/variant-paths-sanitize
Mar 13, 2026
Merged

Fix VariantPaths: strict v2.0 serialization, src arch support, and public Location API#231
lubomir merged 2 commits intorelease-engineering:developmentfrom
guillermodotn:fix/variant-paths-sanitize

Conversation

@guillermodotn
Copy link
Contributor

Summary

  • Fix source_repository and other paths keyed by pseudo-arches like "src" being silently dropped during serialization and deserialization
  • Add set_location() / get_location() public API for setting Location objects on variant paths
  • Replace setattr loop with explicit attribute declarations for LSP visibility
  • Remove silent synthesis fallback in _serialize_v2 — raises ValueError if no Location is set
  • Remove silent fallback in _deserialize_v2 — raises TypeError on malformed v2.0 data
  • _serialize_v1 handles Location objects in field dicts by extracting local_path
  • convert.py uses the public API instead of accessing _locations directly

Fixes:

…dd set_location/get_location API, and enforce strict v2.0 serialization

Assisted-by: Claude Opus
@lubomir
Copy link
Contributor

lubomir commented Mar 12, 2026

I have closed #229, that's not really a problem with the code, but bad usage. It might make sense to emit some warnings if the arch key under any path doesn't match architecture configured for the variant though.

Copy link
Contributor

@lubomir lubomir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

"arches": ["x86_64"],
"paths": {
"repository": {"x86_64": "BaseOS/x86_64/os"},
"source_repository": {"src": "BaseOS/source/os"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory this should never be the case. Even for source repository, there should not be a pseudoarch in the dict.

@lubomir lubomir merged commit ee0edd4 into release-engineering:development Mar 13, 2026
11 checks passed
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