[cross_file] adopt code excerpts in README#5347
[cross_file] adopt code excerpts in README#5347auto-submit[bot] merged 10 commits intoflutter:mainfrom
Conversation
|
The test I made fails because the code in the excerpt file tries to load a text file from the cross_file/tests folder, but I'm not sure how to access that file from the cross_file/example/lib folder. |
ditman
left a comment
There was a problem hiding this comment.
Hey @mike-v2, thanks for tackling this!
A couple of quick comments:
flutter analyze is complaining about a couple of things, here's the excerpt from the error logs:
info - example/lib/readme_excerpts.dart:12:3 - Don't invoke 'print' in production code. Try using a logging framework. - avoid_print
info - example/lib/readme_excerpts.dart:13:3 - Don't invoke 'print' in production code. Try using a logging framework. - avoid_print
info - example/lib/readme_excerpts.dart:14:3 - Don't invoke 'print' in production code. Try using a logging framework. - avoid_print
info - example/lib/readme_excerpts.dart:15:3 - Don't invoke 'print' in production code. Try using a logging framework. - avoid_print
info - example/lib/readme_excerpts.dart:18:3 - Don't invoke 'print' in production code. Try using a logging framework. - avoid_print
info - example/lib/readme_excerpts.dart:18:31 - Unnecessary braces in a string interpolation. Try removing the braces. - unnecessary_brace_in_string_interps
Also, there's a failure on the "web" test runner; the problem is that on the web path doesn't mean anything, so a (real) XFile on the web can only be created from Bytes.
I've suggested a couple of fixes to readme_excerpts.dart and its test that might allow this to pass (but these are "off the top of my head" suggestions; please do test locally if they work as intended :P)
|
Hey sorry for the easy mistakes and thanks for the detailed reply, it really helps a noob like me!
|
|
(Force-pushed to rebase with latest |
Yes, however the solution is even simpler, you can add a
This is normal, everything inside "example" is its own stand-alone app, and the assets for that app must be contained inside of it. One last change I did was to remove the dependencies on "flutter" from the "example" since it seems we only need Thanks for your contribution! |
|
This PR is not updating after my changes (similar to: https://stackoverflow.com/questions/45626986). I'll check again on monday, but if it doesn't work I might have to ask you to close and re-create this PR @mike-v2! |
15c5c16 to
30463d9
Compare
|
I think my I guess I'll revert my change and go back to |
038434c to
1aa314f
Compare
|
Oh that's what was causing the 5 failing checks? Interesting. Waiting for all those tests to go green is like watching the longest spin of the Price is Right wheel. |
@mike-v2 I think that was causing only the "web" tests to fail. The others were most likely flaky tests that had nothing to do with your change, in fact :)
Do you have access to the test failure logs, by following links from Github into the Flutter dashboard?
Thanks!! And most importantly: Yes please, do keep the fixes coming! |
|
Yeah I have access to the failure logs, which is awesome because it allows me to fix many of those simple mistakes. That's why I had a few commits in a row awhile back - I kept watching it fail and then looking through the logs to find what went wrong. Definitely learned a lot by doing that! |
|
I think this should be ready to land now. Adding @stuartmorgan as 2nd team reviewer, for when he has a while. Stuart, in this PR, we're attempting to test the code of the file that is used to generate the excerpts, I think this is a 1st! |
ditman
left a comment
There was a problem hiding this comment.
LGTM!
(It might be a little odd testing the file that is used to generate the excerpts, but it looks good to me! The weird part is not using integration_test in the example, but since cross_file is a dart package, I didn't want to add any flutter deps, and the CI seems to Just Work™)
stuartmorgan-g
left a comment
There was a problem hiding this comment.
LGTM with some nits. Thanks!
Stuart, in this PR, we're attempting to test the code of the file that is used to generate the excerpts, I think this is a 1st!
Not quite a first, but definitely something we aren't doing very much of yet. It's great to see more of it!
4f1793d to
c8f265d
Compare
|
auto label is removed for flutter/packages/5347, due to - The status or check suite Linux repo_checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
auto label is removed for flutter/packages/5347, due to - The status or check suite Linux_android android_platform_tests_shard_4 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
auto label is removed for flutter/packages/5347, due to - The status or check suite Linux_android android_platform_tests_shard_4 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
flutter/packages@c9933fc...2102327 2023-11-22 [email protected] [cross_file] adopt code excerpts in README (flutter/packages#5347) 2023-11-21 [email protected] Manual roll Flutter from 9c9e061 to ab721f9 (16 revisions) (flutter/packages#5461) 2023-11-21 [email protected] [url_launcher_web] migrate to pkg:web (flutter/packages#5451) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
|
This landed and got published, thanks @mike-v2 for the contribution, and @tarrinneal for keeping the PR alive :D! |
flutter/packages@c9933fc...2102327 2023-11-22 [email protected] [cross_file] adopt code excerpts in README (flutter/packages#5347) 2023-11-21 [email protected] Manual roll Flutter from 9c9e061 to ab721f9 (16 revisions) (flutter/packages#5461) 2023-11-21 [email protected] [url_launcher_web] migrate to pkg:web (flutter/packages#5451) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Updates the README to use a compiled excerpt source for its example of instantiating an
XFile.Part of flutter/flutter#102679
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.mdto add a description of the change, [following repository CHANGELOG style].///).