Altinn / altinn-studio

Next generation open source Altinn platform and applications.
https://docs.altinn.studio
BSD 3-Clause "New" or "Revised" License
115 stars 70 forks source link

Deleting a repository should delete all its data #12904

Open mlqn opened 6 months ago

mlqn commented 6 months ago

Description

Deleting a repository in Gitea should result in the deletion of all associated data.

Here is a non-exhaustive list of data that are not deleted :

A possible solution could be to add a new endpoint to our API that decommissions apps and cleans up all data, and then call this endpoint via webhooks when deleting the repository in Gitea

Additional Information

No response

### Tasks
- [ ] Create a new endpoint that cleans up repo/app data
- [ ] Create a new webhook for when a repository is deleted
- [ ] https://github.com/Altinn/altinn-studio/issues/3717
- [ ] https://github.com/Altinn/altinn-studio/issues/11776
- [ ] https://github.com/Altinn/altinn-studio/issues/11428
nkylstad commented 5 months ago

This is a bit of a dangerous path, as the interface in Gitea gives no indication/status as to whether an app is deployed. It would be very easy to accidentally delete a repo, and with that also remove a critical app from production.

Should we look into some other alternatives here? Is there any way to f.ex. disable repo delete in Gitea? Or at the very least limit that options only to a very limited number of people. And instead offer the option to delete repos in the designer interface. That way we can have much more control over when it is OK to delete an app. F.ex.: