Skip to content

Conversation

@codenoid
Copy link

@codenoid codenoid commented Jun 1, 2023

This pull request proposes to update the output message of flutter doctor when encountering issues related to the Dart cache. Currently, it suggests using the command dart pub cache clear which doesn't exist. Instead, it should recommend using dart pub cache clean as it is the correct command to clear Dart's cache.

Steps to reproduce the issue:

  1. Run flutter doctor.
  2. If an existing Pub cache issue is found, the output message includes a suggestion to run dart pub cache clear.

Expected Result:

The output message should suggest running dart pub cache clean to clear Dart's cache.

Actual Result:

The output message suggests running dart pub cache clear, which is not a valid Dart command.

image
image

flutter --version
Flutter 3.10.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9cd3d0d9ff (8 days ago) • 2023-05-23 20:57:28 -0700
Engine • revision 90fa3ae28f
Tools • Dart 3.0.2 • DevTools 2.23.1

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 [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • 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.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 1, 2023
@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 to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

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.

@github-actions github-actions bot removed the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 1, 2023
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 1, 2023
Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

Thanks for this fix. Can you add a test to this file that verifies the updated text is in the logger?

@christopherfujino
Copy link
Contributor

Your test is failing on CI:

01:24 +2359 ~2 -1: test/general.shard/dart/pub_get_test.dart: shouldSkipThirdPartyGenerator skips pub get if the package config "generator" is different than "pub" [E]                                
  Expected: contains 'It can be reset by running `dart pub cache clean`'
    Actual: 'Skipping pub get: generated by third-party.\n'
              ''
     Which: does not contain 'It can be reset by running `dart pub cache clean`'
  
  package:matcher                                  expect
  test/general.shard/dart/pub_get_test.dart 249:7  main.<fn>.<fn>

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8778805477762119169/+/u/run_test.dart_for_tool_tests_shard_and_subshard_general/test_stdout

@christopherfujino
Copy link
Contributor

Thanks for submitting this, however, it was since fixed in #128171.

@codenoid
Copy link
Author

Well that's break my heart

But I understand that because of lack of skills, I'm not able to contribute the correct code as it suppose to be.

Sincerely, codenoid

@christopherfujino
Copy link
Contributor

Well that's break my heart

But I understand that because of lack of skills, I'm not able to contribute the correct code as it suppose to be.

It's definitely not because of a lack of skills. As this was a high profile bug, we had many PRs submitted to fix it, however only one had tests that were all passing, so I merged that one.

Please don't be discouraged from contributing in the future. To maximize the odds your PR is merged, I would suggest:

  1. ensure the change you want to make is being tracked by an issue. ensure that tracking issue is not already assigned to someone.
  2. If it is a non-trivial change (this was a trivial change), outline your general approach first in the issue and try to get approval from a maintainer. This is not required, but it may save you from spending time working on a feature and having a reviewer say, "I actually don't agree with this approach, sorry I have to close this PR".
  3. Ensure you follow all the steps in the PR template checklist (I believe you checked that the PR had tests before you wrote one)
  4. Once you open the PR, ensure all the CI checks are passing. If they're not, investigate the failures and try to fix them.

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants