-
Notifications
You must be signed in to change notification settings - Fork 11
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
CPLAT-6431 Add option to skip overlapping patches #22
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
…wn option; add tests and fixtures
552c00c
to
bc6bfa8
Compare
lgtm |
skippedPatches.addAll(userSkipped); | ||
|
||
// Don't apply the patches the user skipped. | ||
for (var patch in userSkipped) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#nit could put this logic in a local function since it's duplicated here and below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna leave the nit -- I'd prefer not to modify the instance of appliedPatches
and skippedPatches
within a helper function as there’s already a lot of scope to keep in mind in _runInteractiveCodemod
.
QA +1
@Workiva/release-management-p |
Motivation
I'm writing a codemod where it is inevitable that some patches will overlap. I'd like to be able to optionally skip overlapping patches instead of throw an exception when it happens. Also, I'd like to be able to output what was skipped at the end of the code modification for consumers to be able to manually edit should they so desire.
Changes
applyPatchesAndSave
. When overlapping patches are passed toapplyPatches
, the current behavior of throwing an exception will stay the same. It's just that now when running a codemod, we'll always pull them out (or quit early) before giving them to the apply methods.Release Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
QA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: