Skip to content
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

Fix link target generation for collection test #252

Conversation

t-woerner
Copy link
Contributor

The link_target was generated only using the extract_dir and the linkname, but without the directory path that contains the link. Therefore the link_target could be outside of the extract_dir.

@t-woerner t-woerner force-pushed the fix_link_target_generation_for_collection_test branch 4 times, most recently from 0a62e0b to 503408a Compare December 6, 2023 14:22
@jctanner
Copy link
Collaborator

jctanner commented Dec 6, 2023

Can you add a unit test to cover the scenario?

@t-woerner
Copy link
Contributor Author

The issue can be seen with the ansible-freeipa collection on galaxy. For example with https://galaxy.ansible.com/ui/repo/published/freeipa/ansible_freeipa/?version=1.12.0

@felixfontein
Copy link
Contributor

This issue affects quite a few community collections (many of the failures in https://ansible.softwarefactory-project.io/zuul/builds?job_name=ansible-galaxy-importer&skip=0 come from this bug).

@t-woerner t-woerner force-pushed the fix_link_target_generation_for_collection_test branch from 503408a to 2975e77 Compare December 6, 2023 16:40
@t-woerner
Copy link
Contributor Author

t-woerner commented Dec 6, 2023

Can you add a unit test to cover the scenario?

I added test_valid_relative_symlink_in_subdir to tests/unit/test_collection_archive_extract.py

@mariolenz
Copy link

Looks like this fixes the breaking CI I see in ansible-collections/community.vmware#1938

@mariolenz
Copy link

@jctanner Would it be possible to merge this and do a new release timely? I should say this bug has quite an impact...

The link_target was generated only using the extract_dir and the
linkname, but without the directory path that contains the link. Therefore
the link_target could be outside of extract_dir.

No-Issue

Signed-off-by: Thomas Woerner <[email protected]>
@t-woerner t-woerner force-pushed the fix_link_target_generation_for_collection_test branch from 2975e77 to 320bc28 Compare December 6, 2023 17:14
@jctanner jctanner merged commit 5e19ba6 into ansible:master Dec 6, 2023
5 checks passed
@mariolenz
Copy link

Thanks @t-woerner and @jctanner for the quick fix!

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.

4 participants