pixi icon indicating copy to clipboard operation
pixi copied to clipboard

fix: trim channel url when filter packages_for_prefix_mapping

Open zen-xu opened this issue 9 months ago • 4 comments

Fixes: #1384

zen-xu avatar May 15 '24 07:05 zen-xu

I found if any the key of mapping_url or RepoDataRecord.channel end with '/' will make packages_for_prefix_mapping always filter all packages

https://github.com/prefix-dev/pixi/blob/1ec1b90a4df20fa5555d431869e6335837bbf5ee/src/pypi_mapping/custom_pypi_mapping.rs#L102-L120

zen-xu avatar May 15 '24 07:05 zen-xu

Looks very good! Thanks for spotting this.

Could you please add a small test for this usecase?

nichmor avatar May 15 '24 08:05 nichmor

Looks very good! Thanks for spotting this.

Could you please add a small test for this usecase?

I don't know how to add a test for this usecase, can you provide some suggestions?

zen-xu avatar May 15 '24 08:05 zen-xu

Looks very good! Thanks for spotting this. Could you please add a small test for this usecase?

I don't know how to add a test for this usecase, can you provide some suggestions?

sure!

you can take a look at this test:

https://github.com/prefix-dev/pixi/pull/1335/files#diff-a0d6a55fba5932c0cafe2e60f8573b8d7861f51c77e19b93100dfa8685f0ce5aR302

and add the same in tests/solve_group_tests.rs where you add some record with ending / : https://github.com/prefix-dev/pixi/pull/1335/files#diff-a0d6a55fba5932c0cafe2e60f8573b8d7861f51c77e19b93100dfa8685f0ce5aR333

but your mapping url don't have the / in channel.

So you will verify if we filter them right

Let me know if you need any help

nichmor avatar May 15 '24 10:05 nichmor

@nichmor test is done

zen-xu avatar May 16 '24 05:05 zen-xu

@nichmor test is done

Thanks for your work!

I've fixed the conflicts with main and changed a little the test to assert that we record qualifer for purl ( https://github.com/prefix-dev/pixi/pull/1391/files#diff-a0d6a55fba5932c0cafe2e60f8573b8d7861f51c77e19b93100dfa8685f0ce5aR409 )

Looks very good - I'm merging it.

nichmor avatar May 16 '24 08:05 nichmor