Skip to content

Fix unarchive file metadata setting - #85917

Open
pkingstonxyz wants to merge 13 commits into
ansible:develfrom
pkingstonxyz:fix-unarchive-become-85815
Open

pkingstonxyz wants to merge 13 commits into
ansible:develfrom
pkingstonxyz:fix-unarchive-become-85815

Conversation

@pkingstonxyz

@pkingstonxyz pkingstonxyz commented Sep 25, 2025

Copy link
Copy Markdown
Contributor
SUMMARY

Because archives can contain files without containing their parent directories, module
unarchive does not set file metadata for implicitly created folders. This PR expands
the fix in #73024 from fixing just the metadata of top-level files to all created files
or directories.

Fixes #85815

ISSUE TYPE

Bugfix Pull Request

@pkingstonxyz pkingstonxyz changed the title Fix unarchive become 85815 Fix unarchive file metadata setting Sep 25, 2025
@ansibot ansibot added bug This issue/PR relates to a bug. test This PR relates to tests. needs_triage Needs a first human triage before being processed. module This issue/PR relates to a module. has_issue labels Sep 25, 2025
Comment thread lib/ansible/modules/unarchive.py Outdated
@ansibot

This comment was marked as resolved.

@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Sep 25, 2025
@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Sep 25, 2025
@mkrizek mkrizek added P3 Priority 3 - Approved, No Time Limitation and removed needs_triage Needs a first human triage before being processed. labels Sep 30, 2025

@s-hertel s-hertel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is a good change.

Comment thread lib/ansible/modules/unarchive.py
Comment thread lib/ansible/modules/unarchive.py Outdated
s-hertel
s-hertel previously approved these changes Oct 8, 2025
Comment thread lib/ansible/modules/unarchive.py Outdated
@ansibot ansibot added the stale_review Updates were made after the last review and the last review is more than 7 days old. label Oct 15, 2025
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 29, 2025
@pkingstonxyz
pkingstonxyz force-pushed the fix-unarchive-become-85815 branch from dd55c64 to ccee557 Compare February 9, 2026 15:48
@ansibot ansibot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Feb 9, 2026
@pkingstonxyz
pkingstonxyz marked this pull request as draft February 9, 2026 17:58
@pkingstonxyz
pkingstonxyz marked this pull request as ready for review February 9, 2026 17:58
@ansibot ansibot added pending_ci and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. pending_ci labels Feb 9, 2026
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Feb 21, 2026
@pkingstonxyz
pkingstonxyz force-pushed the fix-unarchive-become-85815 branch from ea21b0a to 0e0aa23 Compare March 30, 2026 21:51
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Mar 30, 2026
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 14, 2026
@pkingstonxyz
pkingstonxyz force-pushed the fix-unarchive-become-85815 branch from 0e0aa23 to 274755c Compare May 1, 2026 20:38
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels May 1, 2026
@ansibot

This comment was marked as resolved.

@ansibot ansibot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. pending_ci and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. labels May 4, 2026
@pkingstonxyz pkingstonxyz removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. pending_ci labels May 4, 2026
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label May 18, 2026
@ansibot ansibot removed the stale_review Updates were made after the last review and the last review is more than 7 days old. label Jun 9, 2026
This fixes the ownership issue by expanding the
scope of the folders being checked. Orignally
there was a pass that owned all of the files and
then a pass that owned top level directories.
This expands the second path to most directories
Creates a new property that returns all of the files
created by the archive instead of the files included
in the archive (subtle difference).
The check was added because I erroneoulsy thought
that setting a dict key would change the order.
This is not the case.
set_fs_attributes_if_different already catches OSError.
It was cached, now it's not
@pkingstonxyz
pkingstonxyz force-pushed the fix-unarchive-become-85815 branch from b686721 to 360c052 Compare July 22, 2026 19:07
@ansibot ansibot added stale_review Updates were made after the last review and the last review is more than 7 days old. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Jul 22, 2026
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 5, 2026
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. has_issue module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. test This PR relates to tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unarchive creates discrepencies in file ownership when used with become & tgz archives

4 participants