Skip to content

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

Closed

Description

@DanTup

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.

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    in commandsRelates to commands (usually invoked from the command Palette)
    on Mar 30, 2023
  2. added this to the v3.62.0 milestone on Mar 30, 2023
  3. 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[/+] on Mar 30, 2023
  4. DanTup commented on Mar 30, 2023

    @DanTup
    MemberAuthor

    @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).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    in commandsRelates to commands (usually invoked from the command Palette)is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions