Skip to content

Conversation

@ycherniavskyi
Copy link
Contributor

Kotlin generator creates source code that throws on executing because of missed necessary casting.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].
  • I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style].
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

Copy link
Contributor

@tarrinneal tarrinneal left a comment

Choose a reason for hiding this comment

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

Could you expand your tests to include the casting of all types and remove the 'header' from the titles of both tests? At the moment the test is technically not appropriately named for the new casting line you added.

I think this was passing our integration tests already is concerning. We may to to expand them to cover this instance.

Overall a solid pr. Thank you.

@stuartmorgan-g
Copy link
Collaborator

We may to to expand them to cover this instance.

This PR should definitely include an integration test that covers the failing case. Any fix for a runtime failure that we find going forward should include a corresponding integration test at the minimum (and if it's useful, relevant unit tests).

@stuartmorgan-g
Copy link
Collaborator

@ycherniavskyi Are you planning on adding tests per the discussion above?

@ycherniavskyi
Copy link
Contributor Author

@stuartmorgan yes sure, but I am waiting to merge #2997 to reabase over it and add tests then.

@tarrinneal
Copy link
Contributor

@stuartmorgan yes sure, but I am waiting to merge #2997 to reabase over it and add tests then.

It has now been merged!

@ycherniavskyi
Copy link
Contributor Author

@tarrinneal great, so I am going to rebase and add tests today.

@ycherniavskyi ycherniavskyi force-pushed the fix-casting-dart-int-to-kotlin-long branch from c9ba455 to b1b7f1c Compare January 19, 2023 00:57
@ycherniavskyi
Copy link
Contributor Author

@tarrinneal rebased and consolidated unit tests with properties naming style seen in #3066.

As for the integration tests, then, it seems they were already added within #3066, but disabled for Android Kotlin implementation. This PR resole the flutter/flutter#115914 that was mentioned in flutter/flutter#118726, which is the reason for some tests skipped for Android Kotlin implementation. So this PR for sure affords to remove some of this skip.

@stuartmorgan-g
Copy link
Collaborator

So this PR for sure affords to remove some of this skip.

Have you removed the relevant skips and verified locally that the tests now pass? If so, that change should be in this PR.

# Conflicts:
#	packages/pigeon/CHANGELOG.md
#	packages/pigeon/lib/generator_tools.dart
#	packages/pigeon/pubspec.yaml
@ycherniavskyi
Copy link
Contributor Author

@stuartmorgan do it in 82ab8e8. Also, merge the last main and update gen files.

@tarrinneal
Copy link
Contributor

merge the last main and update gen files.

Can you run the formatter cl tool with

dart pub global run flutter_plugin_tools format --packages pigeon

to clean up the generated files and upload them again.

By executing:
dart pub global run flutter_plugin_tools format --packages pigeon
@ycherniavskyi
Copy link
Contributor Author

@tarrinneal done.

@tarrinneal tarrinneal added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 21, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 21, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Jan 21, 2023

auto label is removed for flutter/packages, pr: 3004, due to - Please get at least one approved review if you are already a member or two member reviews if you are not a member before re-applying this label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@auto-submit
Copy link
Contributor

auto-submit bot commented Jan 21, 2023

auto label is removed for flutter/packages, pr: 3004, due to Validations Fail.

@tarrinneal
Copy link
Contributor

@tarrinneal done.
great job, will be auto merged once testing is complete!

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 21, 2023
@auto-submit auto-submit bot merged commit 14fc7a8 into flutter:main Jan 21, 2023
@ycherniavskyi ycherniavskyi deleted the fix-casting-dart-int-to-kotlin-long branch December 11, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: pigeon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants