Skip to content

Commit

Permalink
feat: unwatch all repos
Browse files Browse the repository at this point in the history
  • Loading branch information
BoYanZh committed Oct 2, 2024
1 parent f9b6409 commit cae195a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ pytest -svv

archive all repos in gitea organization

### `unwatch-all-repos`

unwatch all repos in gitea organization

### `check-issues`

check the existence of issue by title on gitea
Expand Down Expand Up @@ -124,7 +128,3 @@ upload assignment grades to canvas from grade file (GRADE.txt by default), read
## License

MIT

## Compile

- case 0: 0
5 changes: 5 additions & 0 deletions joint_teapot/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ def archive_all_repos() -> None:
tea.pot.gitea.archive_all_repos()


@app.command("unwatch-all-repos", help="unwatch all repos in gitea organization")
def unwatch_all_repos() -> None:
tea.pot.gitea.unwatch_all_repos()


@app.command("get-no-collaborator-repos", help="list all repos with no collaborators")
def get_no_collaborator_repos() -> None:
tea.pot.gitea.get_no_collaborator_repos()
Expand Down
6 changes: 6 additions & 0 deletions joint_teapot/workers/gitea.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,12 @@ def archive_all_repos(self) -> None:
self.org_name, repo.name, body={"archived": True}
)

def unwatch_all_repos(self) -> None:
for repo in list_all(self.organization_api.org_list_repos, self.org_name):
self.repository_api.user_current_delete_subscription(
self.org_name, repo.name
)

def get_all_teams(self) -> Dict[str, List[str]]:
res: Dict[str, List[str]] = {}
for team in list_all(self.organization_api.org_list_teams, self.org_name):
Expand Down

0 comments on commit cae195a

Please sign in to comment.