Skip to content

Add some logging to indicate why "pub get"/"pub upgrade" may be required #4474

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

Closed
DanTup opened this issue Mar 30, 2023 · 1 comment
Closed
Labels
in commands Relates to commands (usually invoked from the command Palette) is enhancement
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Mar 30, 2023

Both @jacob314 and @kenzieschmoll have reported seeing "Run pub get?" prompts appearing more often than they would expect (perhaps after changing Git branches).

I can only reproduce this when changing a branch that modifies the pubspec (which I think is to be expected), but we should log in the extension log why we think "pub get" is required so it'll be easier to track down if there are cases we can handle better.

@DanTup DanTup added is enhancement in commands Relates to commands (usually invoked from the command Palette) labels Mar 30, 2023
@DanTup DanTup added this to the v3.62.0 milestone Mar 30, 2023
@DanTup DanTup changed the title Add some logging to indicate why "pub get" may be required Add some logging to indicate why "pub get"/"pub upgrade" may be required Mar 30, 2023
@DanTup
Copy link
Member Author

DanTup commented Mar 30, 2023

@jacob314 @kenzieschmoll I've added some logging so when you see this prompt, if you open the extension log (Dart: Open Extension Log from the command palette (F1)), it'll include messages like this:

[16:20:44] [General] [Info] Found 1 folders requiring "pub get" or "pub upgrade":
    /Users/danny/Desktop/dart_sample (get: true, upgrade: false, reason: package_config.json is missing)
[16:21:36] [General] [Info] Found 1 folders requiring "pub get" or "pub upgrade":
    /Users/danny/Desktop/dart_sample (get: true, upgrade: false, reason: pubspec.yaml was modified (Thu Mar 30 2023 16:21:35 GMT+0100 (British Summer Time))
        more recently than pubspec.lock (Thu Mar 30 2023 16:21:10 GMT+0100 (British Summer Time)))

I'm interested to know what happens in the cases where you see this and don't think you should. Our check is fairly basic, so changing git branch will prompt to run if the checkout have modified the pubspec, but it shouldn't if it didn't.

(I'm planning to push a new pre-release version of the extension shortly, so if you're on the pre-release version you may already have the change by the time you read this.. it'll be version v3.61.20230330 - you may need to "reload" for it to activate).

@DanTup DanTup closed this as completed in 385681b Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in commands Relates to commands (usually invoked from the command Palette) is enhancement
Projects
None yet
Development

No branches or pull requests

1 participant