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

[PR #3036/31189e96 backport][stable-3] archive - fixing determination of archive root when root is '/' #3062

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Jul 24, 2021

This is a backport of PR #3036 as merged into main (31189e9).

SUMMARY

Fixes an existing bug in archive that sets the archive root to '///' when the longest common root amongst all paths in path is '/'

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

plugins/modules/files/archive.py

ADDITIONAL INFORMATION
  • Uses standard lib and inline functions where possible for clarity
  • Also makes root calculation a "query" as it's a derived value from paths
  • Replaced regex substitution with built-in methods to reduce repetition and marginally improve performance
  • Added units instead of integration tests.

* Initial commit

* Fixing units and path joins

* Ensuring paths are consistently ordered

* Adding changelog fragment

* Using os.path.join to ensure trailing slashes are present

* optimizing use of root in add_targets

* Applying initial review suggestions

(cherry picked from commit 31189e9)
@ansibullbot
Copy link
Collaborator

cc @bendoh
click here for bot help

@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug community_review files module module needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_maintainer needs_triage new_contributor Help guide this first time contributor performance plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging tests tests unit tests/unit labels Jul 24, 2021
@felixfontein felixfontein merged commit 93027a3 into stable-3 Jul 24, 2021
@felixfontein felixfontein deleted the patchback/backports/stable-3/31189e96458f199d1cd0a1c384057a2a85a5ff8d/pr-3036 branch July 24, 2021 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review files module module needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_maintainer needs_triage new_contributor Help guide this first time contributor performance plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging tests tests unit tests/unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants