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

Track and list stopped/removed projects, fixes #642 #1600

Merged
merged 29 commits into from
May 29, 2019

Conversation

rfay
Copy link
Member

@rfay rfay commented May 16, 2019

The Problem/Issue/Bug:

Not all projects have been visible to ddev list and related commands. This is a longstanding issue and affects ddev-ui, but is more relevant now that ddev stop actually removes containers, effectively removing ddev's knowledge of the existence of the project.

How this PR Solves The Problem:

  • Add stopped projects (which have no containers) to global config, and query from there.

TODO:

  • Sort projects by active and then by name
  • TestMain must not remove all projects, it needs to just remove projects like "Test*"
  • ddev list should probably show only active and paused projects. Add ddev list --all for the rest.
  • Need a new ddev stop flag that just stops and removes from global config, doesn't do everything else (nondestructive). Use that in cmd's root_test.go setup so it's not so dangerous.
  • Docs:
    • Projects don't get added until they're started once
    • How to delete a project from global config

Manual Testing Instructions:

  • Test functionality with ddev-ui if it's still working
  • ddev stop -a and ddev list and ddev list --all (which will show stopped/removed projects)
  • Start a few projects and ddev list

There are so very many things that can be broken with this (starting/stopping/pausing by name, whether running or not, conflicting stuff in docker from what's in global config). Please spend some serious time poking at it, and trying to make sure you can recreate bugs.

Automated Testing Overview:

  • Test for consistency between docker containers and global config project list
  • Test for behavior when global projectlist is not fully populated (as will be the case for lots of people)
  • Test for situation where there are broken or empty projects in global config

Related Issue Link(s):

OP #642
This should also make ddev-ui work consistently assuming it gets revived.

Release/Deployment notes:

@rfay rfay force-pushed the 20190516_list_stopped_projects branch 5 times, most recently from 475b1dd to 3066817 Compare May 22, 2019 16:11
@rfay rfay force-pushed the 20190516_list_stopped_projects branch from 3066817 to 0348c8c Compare May 22, 2019 23:37
@rfay rfay force-pushed the 20190516_list_stopped_projects branch from 0348c8c to 405e5b5 Compare May 23, 2019 00:15
@rfay rfay added this to the v1.9.0 milestone May 23, 2019
@rfay rfay marked this pull request as ready for review May 23, 2019 16:55
@rfay rfay requested a review from andrewfrench May 23, 2019 16:55
@rfay
Copy link
Member Author

rfay commented May 23, 2019

@andrewfrench this is a biggie, requesting some serious look at this from both code and manual testing perspective. Since it changes the whole model from docker-label-query to global-yaml-projectlist, there's just so very much that can go wrong. Thanks for scheduling this in.

@rfay rfay force-pushed the 20190516_list_stopped_projects branch from 2c5bb41 to 6ec8220 Compare May 24, 2019 01:45
Copy link
Contributor

@andrewfrench andrewfrench left a comment

Choose a reason for hiding this comment

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

Lots of code changes here, which look good to me. I've been testing this manually on and off and have failed to trip it up yet, but I'd imagine we'll be extra vigilant for smaller, hidden regressions between now and release.

@rfay rfay merged commit d3201a6 into ddev:master May 29, 2019
@ultimike
Copy link
Contributor

ultimike commented Jun 2, 2019

I've been looking forward to this for awhile - I'm sure I've deleted a project's directory or two and forgetting to ddev remove --remove-data along the way.

I've been playing with the alpha 1 version and so far, so good. I haven't run into any issues.

My only comment/request would be that the ddev list --all result be the default. With most folks using a standard ddev start/ddev stop workflow, using ddev list doesn't show anything different. I think it would be super-helpful to show stopped projects by default. Maybe include a ddev list --no-stopped switch or something like that...

-mike

@rfay
Copy link
Member Author

rfay commented Jun 2, 2019

Thanks @ultimike. I think that's a valid request, I thought it would be too big a list for people who work on a lot of projects. Maybe it should go the other way with a --active-only.

@rfay rfay deleted the 20190516_list_stopped_projects branch June 3, 2019 00:56
@rfay
Copy link
Member Author

rfay commented Jun 3, 2019

#1636 will change the behavior to ddev list shows all projects, ddev list --active-only shows just active. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants