dwyl / dwyl/gogs

Delete all Repos in an Org During Testing

Open
#19 4 comments 0 reactions 0 assignees View on GitHub
chore discuss help wanted priority-1 T1h technical
Dominant language
Elixir
Stars
10
Forks
0
PR merge metrics
No merged PRs in 30d

Description

During testing we are creating a _lot_ of "test-123" repos: https://gogs-server.fly.dev/myorg
![image](https://user-images.githubusercontent.com/194400/167140084-937d680f-524a-41ec-b3a8-9d3bf0926887.png)

The _reason_ I'm opening this issue _now_ is that there are enough repos in the org that my tests are failing:

image

If we attempt to drop the whole org (so we can re-create it empty) it doesn't work:
https://gogs-server.fly.dev/org/myorg/settings/delete
![image](https://user-images.githubusercontent.com/194400/167139866-39517ba4-0f30-498d-b6a3-fca8bdaf9926.png)

I don't want to include a function in the library that would allow someone to _accidentally/carelessly_ "nuke" an entire Org ...
It would be irresponsible of us to _build_ such a weapon never mind include it in the lib.

![image](https://user-images.githubusercontent.com/194400/167140999-f18badfe-d331-4988-bd0b-7692ef76b5da.png)

So instead I propose that we create a **bash script** that calls the List organization repositories REST API endpoint
https://github.com/gogs/docs-api/tree/master/Repositories#list-organization-repositories
```sh
GET /orgs/:orgname/repos
```
Then runs the delete a repo command in a loop for each repo.
https://stackoverflow.com/questions/32791663/how-to-run-curl-command-with-parameter-in-a-loop-from-bash-script
i.e. we can still use it for development purposes but it wouldn't be exported in the library on Hex.pm

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.