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

FED-3248 Update non-defaulted state mixin fields to be optional #298

Merged
merged 6 commits into from
Oct 23, 2024

Conversation

sydneyjodon-wk
Copy link
Contributor

Motivation

When working on a different codemod, we noticed that ClassComponentRequiredInitialStateMigrator migrates defaulted state mixin fields, but there's no codemod to migrate the rest of state mixin fields - we should add one to set all other fields to optional.

Changes

  • Added StateMixinSuggestor to make all state mixin fields optional and run it after ClassComponentRequiredInitialStateMigrator

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed
    • Steps from PR author:
      • CI passes
      • Good test coverage
      • Run the codemod on a repo (ex. WSD)
        • dart pub global activate --source path .
        • dart pub global run over_react_codemod:null_safety_migrator_companion
    • Anything falling under manual testing criteria outlined in CONTRIBUTING.md

Merge Checklist

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

  • A Frontend Frameworks Design 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

@rmconsole2-wf rmconsole2-wf changed the title Update non-defaulted state mixin fields to be optional FED-3248 Update non-defaulted state mixin fields to be optional Oct 15, 2024
@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.

@@ -16,16 +16,16 @@ import 'dart:io';

import 'package:args/args.dart';
import 'package:codemod/codemod.dart';
import 'package:over_react_codemod/src/dart3_suggestors/null_safety_prep/class_component_required_default_props.dart';
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 went ahead and removed this since it will be moved in #297

Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

One question and a #nit

);
});

test('patches initialized state in legacy classes', () async {
Copy link
Contributor

Choose a reason for hiding this comment

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

#nit "initialized" isn't relevant here (copy-paste from other tests?)

Suggested change
test('patches initialized state in legacy classes', () async {
test('patches state fields in legacy classes', () async {

Copy link
Contributor

@greglittlefield-wf greglittlefield-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 minus merge conflicts

# Conflicts:
#	lib/src/executables/null_safety_migrator_companion.dart
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

+10

@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

@rmconsole6-wk rmconsole6-wk merged commit e99d2cc into master Oct 23, 2024
6 checks passed
@rmconsole6-wk rmconsole6-wk deleted the add-state-mixin-suggestor branch October 23, 2024 20:49
@sydneyjodon-wk sydneyjodon-wk restored the add-state-mixin-suggestor branch October 23, 2024 20:49
@sydneyjodon-wk sydneyjodon-wk deleted the add-state-mixin-suggestor branch October 23, 2024 20:50
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