question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deleting a project should delete it's environments

See original GitHub issue

Describe the bug

At the moment, in order to delete an entire project, you are expected to delete its environments first. Failure to do so will result in orphaned environments in the api-db database that you cannot remove with GraphQL. It will also mean that the projects continue to run in OpenShift/Kubernetes with no hope of removing them, except manual intervention with oc/kubectl.

To Reproduce

Steps to reproduce the behaviour:

  1. Create project
  2. Create environment for above project
  3. Delete project
  4. Now you cannot delete the environment as the project is deleted

Expected behaviour

2 parts

  1. If you delete a project, it should loop through all of it’s environments and delete them. Potentially, this is just a matter of amending the stored procedure.
  2. Create a new stored procedure and API endpoint to allow deleting an environment by it’s ID (rather than project name and environment name).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
shreddedbaconcommented, Apr 27, 2020

We could do it in the CLI, but it would mean that people would have to update their CLI to get this feature.

I proposed the following solution for the API in the CLI issue related to this https://github.com/amazeeio/lagoon-cli/issues/117#issuecomment-611864789

It makes more sense for the API to handle these sorts of things than hacking it into the CLI

0reactions
tobybellwoodcommented, Nov 10, 2022

Enviroinments should be deleted before deleting a project. There are now checks for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deleting a Project - Oracle Help Center
For this option, the project to be deleted must not have any resources, such as environments, artifacts, build, and deployment pipelines.
Read more >
Deleting A Project - Atlassian Community
If you delete a project, you won't affect them. Except for field content, which will be deleted along with the issues holding it....
Read more >
Remove or Delete an Item or Project - Microsoft Learn
You can delete a project permanently, but you first need to remove any references to the project from SQL Server Management Studio solutions, ......
Read more >
When you are done with a virtual environment, can you just ...
As long as you have your requirements.txt included in the project code, you can delete completely remove the venv and just rebuild it...
Read more >
Creating, editing, or deleting a project - Skytap Help
If you have a large number of projects (your account can have up to 1,500 projects), you may want to delete unused projects....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found