Skip to content

Delete all Repos in an Org During Testing  #19

Description

@nelsonic

During testing we are creating a lot of "test-123" repos: https://gogs-server.fly.dev/myorg
image

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

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

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions