8000 fix(clobber registry): directory and file clobbering by remimimimimi · Pull Request #1497 · conda/rattler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(clobber registry): directory and file clobbering #1497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

remimimimimi
Copy link
Contributor

Description

Introduce new path conflict resolver that would allow to gracefully resolve path conflicts between file/directory in addition of previously handled file/file conflicts. See tests in package_path_resolver.rs in order to understand how it will resolve different types of conflict.

Current state is draft since we don't do anything on-disk yet.

@baszalmstra
Copy link
Collaborator

This is shaping up very nicely! Awesome work so far! Much clearer!

@remimimimimi remimimimimi force-pushed the fix-clobbering branch 6 times, most recently from bf1c6e3 to 5e95fb5 Compare July 10, 2025 17:18
@remimimimimi
Copy link
Contributor Author

I changed implementation of reprioritize method so now we have performance on par with previous implementation. I'm also much more confident that this function is correct.

image

This one should handle file vs directory conflicts as well as
directory merging correctly most of the time.

There are still several places where I think code can fail. And I
think follow up should be, more rigorous, property-based testing for
`path_trie` crate.

Legends say that 2nd generation was lost somewhere in the sea of
rebases.
@remimimimimi remimimimimi marked this pull request as ready for review July 10, 2025 18:07
Copy link
Collaborator
@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

I really like the structure and your approach! I left a few comments.

8000
Comment on lines 524 to 525
assert_yaml_snapshot!(prefix_record_clobber_2.files);
assert_yaml_snapshot!(prefix_record_clobber_2.paths_data);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Having multiple snapshots in a single test can be annoying because you run the test, get a snapshot change, update the snapshot and assume the test succeeds now. However, another snapshot might still fail. If possible I prefer to combine snapshots in a single snapshot to avoid this confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See https://insta.rs/docs/cli/#test. I don't think that it would be easy or actually useful to combine snapshots.

If you want to use nextest runner, then you can call cargo insta test --test-runner nextest --review.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont particularly agree that people should just change their workflow, but this is fine for me.

We change names to more intuitive as well as fix some PR comments
along the way.
Copy link
Collaborator
@baszalmstra baszalmstra 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!

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.

3 participants
0