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-1979 Add suggestor to replace null argument in dom callback #272

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

aaronlademann-wf
Copy link
Contributor

@aaronlademann-wf aaronlademann-wf commented Feb 28, 2024

Motivation

Changes

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:
      • Run the following commands on any of the repos in this SG query locally
      dart pub global activate https://github.com/Workiva/over_react_codemod.git --source=git --git-ref=batch/fedx/FED-1979_dom_callback_null_args
      dart pub global run over_react_codemod:dom_callback_null_args --yes-to-all
      
      and verify that the dom callbacks that used to pass null literal as an argument, now have the correct empty synthetic event being passed instead.

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

@aviary2-wf
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.

@aaronlademann-wf aaronlademann-wf force-pushed the batch/fedx/FED-1979_dom_callback_null_args branch 2 times, most recently from 53c4386 to e20ab23 Compare February 28, 2024 23:17
@aaronlademann-wf aaronlademann-wf marked this pull request as ready for review February 28, 2024 23:28
@aaronlademann-wf aaronlademann-wf force-pushed the batch/fedx/FED-1979_dom_callback_null_args branch from e20ab23 to dfced0c Compare February 29, 2024 18:58
annawatson-wk
annawatson-wk previously approved these changes Mar 6, 2024
Copy link
Contributor

@annawatson-wk annawatson-wk left a comment

Choose a reason for hiding this comment

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

+10,

Excluded React DOM event callback props aren't used in the Workiva ecosystem in test files and non-test files:
sourcegraph
sourcegraph

Great test coverage!

Ran in w_comments and it updated as expected.
Screenshot 2024-03-06 at 10 37 50 AM

// See the License for the specific language governing permissions and
// limitations under the License.

export 'package:over_react_codemod/src/executables/dom_callback_null_args.dart';
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't reviewed this PR, but I have the same question on all these - do we want to have just one null_safety_prep that all these codemods can go into instead of adding a bunch of separate codemods?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sydneyjodon-wk I was wondering about that actually - I think thats a good idea...

Should I remove the individual bin/ executables here and in #273? Or can we add an aggregated executable in a follow-up PR without modifying these?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason we would need separate executables along with the aggregated one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not necessarily - was just thinking we could create the aggregate executable in a single pr rather than having to push changes to two existing PRs

Copy link
Contributor

Choose a reason for hiding this comment

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

oh yeah that works! I think we should remove the individual executables from both PRs though if we don't think they're needed if that's what you were asking!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sydneyjodon-wk done (in both PRs)

annawatson-wk
annawatson-wk previously approved these changes Mar 6, 2024
Copy link
Contributor

@annawatson-wk annawatson-wk left a comment

Choose a reason for hiding this comment

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

+10, reup - just removed standalone executable

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.

This looks great, just had the same comments as the other one!


@override
Future<void> generatePatches() async {
_result = await context.getResolvedUnit();
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if this one doesn't need to be resolved either?

_result!.unit.accept(this);
}

static const callbackToSyntheticEventTypeMap = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the values in this map just for testing purposes? I only see the keys being used in this file?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this file can be removed too in favor of adding this to the null_safety_prep codemod

@aaronlademann-wf
Copy link
Contributor Author

@sydneyjodon-wk I've made the necessary updates to get this running as part of the larger null_safety_prep executable. Should be ready to go now.

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.

+10 tested on web_skin_dart and Anna tested on w_comments as well! 🎉

@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

@rmconsole7-wk rmconsole7-wk merged commit f8399cc into master Mar 7, 2024
8 checks passed
@rmconsole7-wk rmconsole7-wk deleted the batch/fedx/FED-1979_dom_callback_null_args branch March 7, 2024 19:56
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