-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[pigeon] migrate to null-safety #300
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
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
@googlebot I signed it! |
|
I really need this pacakge too... How do I include this fork in my own project? |
|
@Goddchen here is your error |
|
thanks @mitchross . I didn't event notice this test failing. It's fixed. But the other one that I mentioned in the PR descriptions still puzzles me. |
|
Also the |
|
@Goddchen did lots of digging, the issue isn't the unit test, the issue is the assertion throw "fails" the unit test. The unit test will catch it, but it doesn't matter if you comment out the entire test, the test still fails! |
|
@mitchross Yeah, I see that piece of code. What puzzles me really is that if I replace the throwing |
Do what you suggested, I think this is a bad test setup, with null-safety, it doesn't even make sense anymore. |
|
Fixed it! After giving it a bit more thought, my finding was that the generated code was actually not doing exactly what it was intended to do. It should handle the |
I still don't get what is wrong with this check... The files are there... What's the problem... |
The all checks have passed by github, I think you are fine... Can you also explain the fix a bit more? I went deep into this code and I'm very curious! |
- Use generic Map and List instead of specific ArrayList and HashMap - Allow callback of the flutter api method to be null This fixes flutter/flutter#66453 This resolves java side of the flutter/flutter#58913
|
@gaaclarke Still getting this strange |
|
@Goddchen I'm not sure, I thought I saw that before in the past but I can't remember where or why. FWIW in my recent PR I switched the |
|
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
Dang, I think it just messed up 🙈 I pulled the master changes instead of rebasing. Can you hint me on how to fix this mess? Sorry 😞 |
|
3da75ed to
d61a774
Compare
I guess it worked 🥳 And I guess from your prompt reply that you see this too often 😉 Thanks |
|
@gaaclarke We're up-to-date and running again 👍 |
|
@jmagman could we get this merged? |
|
@mitchross In order to get it merged Goddchen has to request a code review from someone on the Flutter team (it'd likely be deferred to me). Then they need to go through the review process. I just happened to glance at the code the other day and didn't actually review it. I'm waiting for @Goddchen to be ready. |
|
I didn't know that I had to do anything. I used the "re-request review" button at the top now, was that correct? 🤔 |
|
Yep, thanks @Goddchen. This is a big review, I'll try to get to it soon. I'm balancing a few different priorities. If a couple weeks pass you won't be bothering me if you ping me. |
gaaclarke
left a comment
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.
Hey @Goddchen, looks like you accidentally added some changes for files outside of pigeon.
Nice review @gaaclarke ! I'll get over the points one by one in the coming days. But feel free to jump in and help if you find the time - I don't mind! |
|
I guess those changed files outside the pigeon folder come from there commits. I have to admit: I have no clue how those commit ended in this PR 🤔 Nor do I have a clue on how to remove those? 🤷♂️ I guess it has something to do with properly rebasing or something like that? Do you have an idea @gaaclarke ? |
44988cd to
726882b
Compare
|
I got rid of the other file edits by squashing your commits and force pushing. There was something weird going on with the PR. When I squash commits I don't expect to get conflicts, but I did. I'll try rebasing it on master next so are ready to merge, the squashing should have made this easier. Watch out, I'll have to force push again after this. |
726882b to
e91bc55
Compare
[pigeon] upgrade version Fix 2 tests Properly generate null-safe Dart code Fix now unused code JavaOptions.className is mandatory generate null-safe code during mock_handler_tester no need to run tests without sound null safety Fix analyzer issues in generated Dart code Fix more analyzer issues Try to fix format of generated Dart code Try to fix more format issues Adjust test to new generated code format Fix formatting Create null-safe pigeons during local tests Create null-safe pigeons during local tests Use ! instead of ?? Make PigeonOptions.input required
c0047b3 to
fb33ad7
Compare
|
(I had to rebase one last time to to resolve conflicts from a PR that just landed, hopefully that is the last time.) |
… good way to make it non-null the way things are setup.
|
Ok, getting closer. I'm going to grab lunch. I think there is a bit of documentation that has to happen before I publish this as well. I'll just write that up in a different PR once this lands. I think I can get it in by EOD. |
…he test is failing remotely, works locally
…y in the name now that it is on stable.
gaaclarke
left a comment
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.
Nice, thanks for the contribution! I'll clean up the rest of the documentation and stuff in another PR before I publish it.
One thing that would have been helpful if if you tried to keep the migration to null safety and your changes to the output as separate PRs. It was a bit of work to detangle them.
Take care dude!





Migrating pigeon package to null-safety.
I marked this as a draft because I have trouble getting one test to pass:
packages/pigeon/mock_handler_tester/test/widget_test.dart:calling methods with nulland I just can't work it out :/ The call throws an AssertionError, which is the expected behavior. Yet the test fails stating that this error was thrown. Can anyone help?