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

CPLAT-10515 Preserve consumed props behavior defaults #89

Merged
merged 6 commits into from
Apr 14, 2020

Conversation

greglittlefield-wf
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf commented Apr 13, 2020

Motivation

Since over_react's new boilerplate will be consuming all mixed in props by defaults (via Workiva/over_react#485), we need to update the codemod to preserve the same set of consumed props when converting legacy boilerplate.

Changes

1. Update migrators to preserve this behavior via consumedProps impl updates:

  • simple_props_and_state_migrator - No changes necessary.

    These classes will result in only one props mixin being used, so the default behavior change still results in the single mixin being consumed.

  • advanced_props_and_state_migrator

    Cases:

    1. Component already overrides consumedProps; do nothing
    2. Props class had no members, so no mixin was created: add consumedProps override that consumes no props
    3. Mixin was created from props/state class; add consumedProps override that consumes that mixin
    4. Props were moved from class into existing mixin; add consumedProps override that consumes that mixin and add a fixme

    Also, if any of these extend from a non-base component, add a fixme to ensure that that consumedProps impl shouldn't be inherited instead of overriding it in the base class

2. Update tests, which already had all of these cases covered, to match new behavior

Release Notes

  • Update boilerplate migrator to preserve consumedProps behavior

Review

Please review: @aaronlademann-wf @joebingham-wk @sydneyjodon-wk

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Client Platform member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@aviary3-wk
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@@ -387,7 +414,6 @@ void advancedPropsAndStateClassMigratorTestHelper({
'ADifferentPropsClass': 'ADifferentPropsClassMixin',
},
)(
expectedPatchCount: 6,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed most of the expectedPatchCount assertions in this file, since they don't provide much value (patches are already tested via expectedOutput) and are a pain to update.

I left the ones where the value was 0/1`.

@rmconsole5-wk rmconsole5-wk changed the title Preserve consumed props behavior defaults CPLAT-10515 Preserve consumed props behavior defaults Apr 13, 2020
Copy link
Contributor

@aaronlademann-wf aaronlademann-wf left a comment

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@sydneyjodon-wk sydneyjodon-wk left a comment

Choose a reason for hiding this comment

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

QA+1 codemod ran without issues on web_skin_dart and wdesk_sdk

@greglittlefield-wf
Copy link
Contributor Author

@Workiva/release-management-p

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@rmconsole2-wf rmconsole2-wf merged commit ef79086 into master Apr 14, 2020
@rmconsole2-wf rmconsole2-wf deleted the new_consumed_props_defaults branch April 14, 2020 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants