-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Return error if patch file passed to state file.patch is malformed #59806
Merged
dwoz
merged 1 commit into
saltstack:master
from
msciciel:file-patch-state-malformed-patch
Dec 10, 2023
Merged
Return error if patch file passed to state file.patch is malformed #59806
dwoz
merged 1 commit into
saltstack:master
from
msciciel:file-patch-state-malformed-patch
Dec 10, 2023
Conversation
This file contains 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
danielrobbins
suggested changes
Apr 19, 2021
msciciel
force-pushed
the
file-patch-state-malformed-patch
branch
5 times, most recently
from
April 28, 2021 07:39
d43679b
to
6098a52
Compare
@msciciel if you can get this out of a draft status it will run the tests and I can get it reviewed! Thank you! |
Done. |
Any chance for final review and possible merge? |
msciciel
force-pushed
the
file-patch-state-malformed-patch
branch
3 times, most recently
from
April 14, 2023 19:05
daae1d4
to
17cb00a
Compare
msciciel
changed the title
Return error if patch file passed to state file.patch is malformed
WIP: Return error if patch file passed to state file.patch is malformed
Apr 14, 2023
msciciel
changed the title
WIP: Return error if patch file passed to state file.patch is malformed
Return error if patch file passed to state file.patch is malformed
Apr 15, 2023
@danielrobbins @dwoz @sagetherage is there a change for a review of this fix? |
If patch file provided for file.patch state is malformed then state returns `Patch was already applied` but patch is not applied. ID: patch_example Function: file.patch Name: /tmp/example Result: True Comment: Patch was already applied Started: 12:20:50.953163 Duration: 61.558 ms Changes: It is better to return error in such case. ID: patch_example Function: file.patch Name: /tmp/example Result: False Comment: /usr/bin/patch: **** malformed patch at line 7: Started: 12:33:44.915605 Duration: 59.202 ms Changes:
dwoz
force-pushed
the
file-patch-state-malformed-patch
branch
from
December 10, 2023 10:29
17cb00a
to
cba7986
Compare
dwoz
approved these changes
Dec 10, 2023
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.
What does this PR do?
If patch file provided for file.patch state is malformed then state
returns
Patch was already applied
but patch is not applied.It is better to return error in such case.
What issues does this PR fix or reference?
Fixes: #59805
Previous Behavior
New Behavior
Test needs to be fixed also because it return OK(false positive) with original code but log file contains and patch is not applied:
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
No