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

[go_router_builder] Activate leak testing #8059

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ValentinVignal
Copy link
Contributor

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@ValentinVignal
Copy link
Contributor Author

cc @polina-c

@ValentinVignal
Copy link
Contributor Author

I think this PR is eligible for the tags override: no versioning needed and override: no changelog needed

@polina-c
Copy link

polina-c commented Nov 12, 2024

I think this PR is eligible for the tags override: no versioning needed and override: no changelog needed

For changelog you can say something like "Increased protection against memory leaks.".

Why versioning is not needed? Can you add more details?

Versioning is a good thing as a concrete version can be declared as 'bad', so users may want to be able to choose or hard code a version to avoid issues. (if i understand it right)

@ValentinVignal
Copy link
Contributor Author

@polina-c I was copying what we did for #7546.

I don't mind adding a new version (I guess a patch increase?). Let me just explain why I thought it wouldn't need one first:
This change won't impact any user of the package. I see it as an update of the infra tools used by the maintainers. There won't be any changes in the API or the behavior of the package.

Having said that. Let me know if you still prefer me to update the version number and changelog. If yes, I'll do it :)

@ValentinVignal
Copy link
Contributor Author

ValentinVignal commented Nov 14, 2024

Also @polina-c @chunhtai , it looks like the ci Linux analyze_downgraded stable is not happy.

If I understand correctly, it runs flutter downgrade before analyzing the repo, and from the logs, it looks like it cannot find the symbol LeakTesting used in flutter_test_config.dart. Looking Looking at the logs, it seems the install versions leak_tracker_flutter_testing: 2.0.0 and leak_tracker_testing: 1.0.5.

But LeakTracking was added to leak_testing: 1.0.12 (dart-lang/leak_tracker#152, dart-lang/leak_tracker#188).

Having said that, it didn't complain for the PR activating leak tracking on go_router (#7546). Both of them have the same flutter and dart constraints:

sdk: ^3.3.0
flutter: ">=3.19.0"

environment:
sdk: ^3.3.0
flutter: ">=3.19.0"

environment:
sdk: ^3.3.0
flutter: ">=3.19.0"

So I'm not sure what is the difference here or what I should do.

I found that go_router was listed in script/configs/custom_analysis.yaml but not go_router_builder. I don't know if that's relevant:

# Packages that deliberately use their own analysis_options.yaml.
#
# Please consult with #hackers-ecosystem before adding anything to this list,
# as the goal is to have consistent analysis options across all packages.
#
# All entries here shoud include a comment explaining why they use different
# options.
# DO NOT move or delete this file without updating
# https://github.com/dart-lang/sdk/blob/main/tools/bots/flutter/analyze_flutter_packages.sh
# and
# https://github.com/flutter/flutter/blob/main/dev/bots/test.dart
# which reference this file from source, but out-of-repo.
# Contact stuartmorgan or devoncarew for assistance if necessary.
# Opts out of unawaited_futures, matching flutter/flutter's disabling due
# to interactions with animation.
- animations
# Deliberately uses flutter_lints, as that's what it is demonstrating.
- flutter_lints/example
# Adopts some flutter_tools rules regarding public api docs due to being an
# extension of the tool and using tools base code.
- flutter_migrate
# Has some test files that are intentionally broken to conduct dart fix tests.
# Also opts out of unawaited_futures, matching flutter/flutter.
- go_router
# Has some constructions that are currently handled poorly by dart format.
- rfw/example
# Disables docs requirements, as it is test code.
- web_benchmarks/testing/test_app

@chunhtai
Copy link
Contributor

I don't think custom analysis has thing to do with this. my suspicion is that something in go_router bump the lower limit on the leak_tracker.

@polina-c do you know what may have cause this?

@polina-c
Copy link

I don't think custom analysis has thing to do with this. my suspicion is that something in go_router bump the lower limit on the leak_tracker.

@polina-c do you know what may have cause this?

Version of leak leak_tracker_flutter_testing is defined by version of current Flutter.
Versions of leak_tracker_testing and leak_tracker are defined by version of leak_tracker_flutter_testing.

So, if version of Flutter is not consistent across bots in router_builder, we may get collisions.

And yes, it analyze_downgraded uses downgraded flutter intentionally.

Good news is that leak_tracker is in dev dependencies, not in prod dependencies, so it should be ok to exempt it from the bot.

Maybe the bot that downgrades Flutter, also should clean up dev dependencies?

@polina-c
Copy link

@polina-c I was copying what we did for #7546.

I don't mind adding a new version (I guess a patch increase?). Let me just explain why I thought it wouldn't need one first: This change won't impact any user of the package. I see it as an update of the infra tools used by the maintainers. There won't be any changes in the API or the behavior of the package.

Having said that. Let me know if you still prefer me to update the version number and changelog. If yes, I'll do it :)

Yes, your explanation makes sense for me. Here is my explanation: for repositories I am not familiar with, it is much easier for me to satisfy the lints, than to explain why i need exception.

You are welcome to go for exception, but I cannot help you with this for this repo, because i am not very familiar with it.

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.

3 participants