Skip to content

fix: Keep removed package metadata in repodata#2210

Open
baszalmstra wants to merge 4 commits intomainfrom
claude/fix-repodata-removed-packages-YsKCP
Open

fix: Keep removed package metadata in repodata#2210
baszalmstra wants to merge 4 commits intomainfrom
claude/fix-repodata-removed-packages-YsKCP

Conversation

@baszalmstra
Copy link
Collaborator

@baszalmstra baszalmstra commented Mar 11, 2026

Description

Changes the package removal behavior in repodata patches to preserve package metadata for removed packages instead of deleting them entirely. When a package is marked for removal, it is now added to the removed set while keeping its metadata in the packages and packages.conda maps.

This allows consumers to:

  • Understand why a package is no longer available (via its metadata)
  • Detect when a previously available package has been yanked
  • Access historical package information for auditing or debugging purposes

The change updates the patch application logic to:

  1. Mark packages as removed by adding them to the removed set
  2. Keep package metadata in the original package maps instead of deleting it
  3. Handle both .tar.bz2 and .conda archive formats consistently

How Has This Been Tested?

The existing test snapshots have been updated to reflect the new behavior:

  • test__removing_1: Verifies that removed packages remain in the package maps with their metadata intact
  • test__removing_2: Confirms that removed packages are properly tracked in the removed set while their metadata is preserved

The snapshot updates show that packages marked for removal now appear in both their original location (with full metadata) and in the removed list.

Checklist:

  • I have performed a self-review of my own code
  • I have updated test snapshots to reflect the new behavior

claude added 3 commits March 11, 2026 15:25
When patching repodata, packages marked for removal were being deleted
from the packages/conda_packages maps. They should only be added to
the `removed` key to signal they are yanked, while keeping their
metadata available.

https://claude.ai/code/session_01WAbEdaYeU6m4cmbXTPdwSM
No need to check if the package exists in the map first — just always
insert into the removed set as instructed by the patch.

https://claude.ai/code/session_01WAbEdaYeU6m4cmbXTPdwSM
…kages

When a tar.bz2 package is removed, only also mark the equivalent .conda
package as removed if it actually exists in the conda_packages map.

https://claude.ai/code/session_01WAbEdaYeU6m4cmbXTPdwSM
@baszalmstra baszalmstra requested a review from wolfv March 11, 2026 15:36
@baszalmstra baszalmstra changed the title Keep removed package metadata in repodata fix: Keep removed package metadata in repodata Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants