ddev / vscode-ddev-manager

DDEV Manager offers a centralized and user-friendly interface to control every aspect of your DDEV projects.
https://marketplace.visualstudio.com/items?itemName=biati.ddev-manager
Apache License 2.0
13 stars 3 forks source link

[BUG] potential issue with mutagen on project start #14

Closed rpkoller closed 12 months ago

rpkoller commented 12 months ago

Please make sure that the bug only applies to this extension, if you have a problem with ddev itself you should open an issue in the ddev repo and not here.

Describe the bug I've never clicked the small info button that brings up the output tab when starting a project in ddev manager in vscode. I did so today and noticed a lot of repeated output in the context of mutagen:

https://gist.github.com/rpkoller/e650953866db01bb9e02d4ec9911e028

the project names that are currently running are blocklayoutfilter and drupaleleven. the output seems to imply something is going wrong with mutagen but i've checked:

$> ddev mutagen status
Mutagen: ok: watching 
$> ddev mutagen monitor
Name: blocklayoutfilter
Identifier: sync_BQSpPOXAFD7Ky1bzoNt3VCm0HHOufRTVefgONBKWOHF
Alpha:
    URL: /Users/rkoller/Sites/blocklayoutfilter
Beta:
    URL: docker://ddev-blocklayoutfilter-web/var/www/html
        DOCKER_HOST=unix:///Users/rkoller/.colima/default/docker.sock
$> ddev mutagen status -l

Mutagen: ok: 
--------------------------------------------------------------------------------
Name: blocklayoutfilter
Identifier: sync_BQSpPOXAFD7Ky1bzoNt3VCm0HHOufRTVefgONBKWOHF
Labels:
    com.ddev.config-hash: c212281329fb24762a96e1b7a37a19ed84868866
    com.ddev.volume-signature: Users-rkoller-colima-default-1696323856
Configuration:
    Synchronization mode: Two Way Resolved
    Hashing algorithm: Default (SHA-1)
    Maximum allowed entry count: Default (2⁶⁴−1)
    Maximum staging file size: Default (18 EB)
    Symbolic link mode: POSIX Raw
    Ignore VCS mode: Default (Propagate)
    Ignores:
        /.git
        /.tarballs
        /.ddev/db_snapshots
        /.ddev/.importdb*
        .DS_Store
        .idea
        /web/sites/default/files
    Permissions mode: Default (Portable)
Alpha:
    URL: /Users/rkoller/Sites/blocklayoutfilter
    Configuration:
        Watch mode: Default (Portable)
        Watch polling interval: Default (10 seconds)
        Probe mode: Default (Probe)
        Scan mode: Default (Accelerated)
        Stage mode: Neighboring
        File mode: Default (0600)
        Directory mode: Default (0700)
        Default file/directory owner: Default
        Default file/directory group: Default
    Connected: Yes
    Synchronizable contents:
        6925 directories
        26306 files (130 MB)
        4 symbolic links
Beta:
    URL: docker://ddev-blocklayoutfilter-web/var/www/html
        DOCKER_HOST=unix:///Users/rkoller/.colima/default/docker.sock
    Configuration:
        Watch mode: Default (Portable)
        Watch polling interval: Default (10 seconds)
        Probe mode: Default (Probe)
        Scan mode: Default (Accelerated)
        Stage mode: Neighboring
        File mode: Default (0600)
        Directory mode: Default (0700)
        Default file/directory owner: Default
        Default file/directory group: Default
        Compression: Default (DEFLATE)
    Connected: Yes
    Synchronizable contents:
        6925 directories
        26306 files (130 MB)
        4 symbolic links
Status: Watching for changes
--------------------------------------------------------------------------------

and all looks ok therefore it is odd to get such an output.

To Reproduce Steps to reproduce the behavior:

  1. Start one of your projecs
  2. click the info button for the starting up project in the sidebar
  3. check the output tab

System (please complete the following information):

rpkoller commented 12 months ago

looks like when i start a project via the terminal there is still the same overly verbose output in regards of mutagen for the project in the vscode output tab.

biati-digital commented 12 months ago

The output panel simply displays everything that DDEV returns when running a command. I’ve never seen an output like that in my own projects but it's not something this extension controls.

I think there’s nothing the extension can do to handle this cases, it’s important to display the output exactly as DDEV returns it to be able to get more information about the executed command.

rpkoller commented 12 months ago

but the problem is i don't see that output (for example line 61 to 92 in the gist) when i start and run the project in the terminal. it is only shown in the vscode extension's output.

rfay commented 12 months ago

@biati-digital is it just using ddev describe -j <project> and ddev list -j ? That output doesn't exactly look like that.

rfay commented 12 months ago

@rpkoller it looks like 61-92 are every 10 seconds polling ddev with ddev describe -j or maybe ddev list -j

rpkoller commented 12 months ago

yes you are right with the 10 seconds @rfay. i wanted to record the output in a small video. stopped the project and it looks like that polling happens also for a stopped project.

https://github.com/ddev/vscode-ddev-manager/assets/1665422/2d265428-e815-4254-aa7c-d265b86355f5

biati-digital commented 12 months ago

The extension uses ddev list --json-output to get the entire list of projects, the polling happens only when you are in the DDEV Manager view (when you see the DDEV projects list in the sidebar) if you change to the files view (or any other view) the polling stops.

If you are away from the DDEV view for more than 10 seconds (usually you just start a project and go to the files view to work for hours) the next time you return to the DDEV projects view it will call immediately ddev list --json-output just make sure that the list still displays the correct information in case something changed outside.

it looks like that polling happens also for a stopped project.

Not exactly, the polling calls only ddev list --json-output as it needs to know the state of all projects in case a project is started or stopped outside of the active editor and update the projects list.

When a project in the sidebar is expanded the extension calls ddev describe projectID --json-output to get the required information to populate services.

For the start command it also uses --skip-confirmation

If the polling causes confusion I could modify it so when it calls ddev list --json-output it does not add the response to the output panel?

rpkoller commented 12 months ago

ahhhhhhh now i understand. thanks for the explanation! from a users point of view i am not sure having the output of ddev list --json-output provides any extra benefit. as you said that output provides only the data the view in the sidebar is based on. so that way the user is already seeing the product of it there, so having the output in the output panel as well is rather counterproductive and redundant (plus also hard to read). i would rather hide it and keep the output exclusive to the relevant output like the startup or actual errors? but that is only my point of view. what do others think about it?

biati-digital commented 12 months ago

@rpkoller I agree. Depending on the amount of projects, the output can be quite large and saturate the output panel so I'm totally ok with skipping the output from that command and just display it in case of errors.

I'll add it in the next update.

biati-digital commented 12 months ago

I've released a new update that should skip the output of list please try it and let me know if it's working.

rpkoller commented 12 months ago

looks good and working. way less distraction that way. thank you!

Screenshot 2023-10-09 at 13 31 09

(*just started a project in the sidebar and opened the output tab. i then left that tab open for a while after the startup before i took the screenshot.)

biati-digital commented 12 months ago

No problem, glad it's working. I'll close this issue now.