copy action plugin diff output for multi files 2#84423
Open
simonLeary42 wants to merge 18 commits into
Open
Conversation
add changelog fragment add check:true to recursive copy test typo add .yml suffix Update changelogs/fragments/81346-copy-recursive-diff-fix.yml Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com> assert multiple diffs more strict testing assert is list accept diff as either list or dict
simonLeary42
commented
Jun 26, 2025
| if "diff" in module_return: | ||
| result['diff'].append(module_return['diff']) | ||
|
|
||
| if module_executed and len(source_files['files']) == 1: |
Contributor
Author
There was a problem hiding this comment.
if module_executed and len(source_files['files']) == 1 and len(source_files['directories']) == 0 and len(source_files['symlinks']) == 0:
result.update(module_return)
# the file module returns the file path as 'path', but
# the copy module uses 'dest', so add it if it's not there
if 'path' in result and 'dest' not in result:
result['dest'] = result['path']
else:
result.update(dict(dest=dest, src=source, changed=changed))
if 'diff' in result and not result['diff']:
del result['diff']this whole block seems fishy to me. I think it might need to be removed. Since result.changed and result.diff is handled in each iteration of each loop beforehand, I don't think this is necessary. But I didn't do the path / dest switch beforehand. Also, if it does result.update it could trash all the diffs that have been accumulated in the 3 loops.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I accidentally broke the commit history on my previous pull request and don't know how to fix / re-open it.
#81346