[PR #4201] [MERGED] Fix not removed watches on unallowed repositories #17280

Closed
opened 2025-11-02 12:31:34 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/4201
Author: @daviian
Created: 6/9/2018
Status: Merged
Merged: 6/19/2018
Merged by: @techknowlogick

Base: masterHead: bugfix/watches


📝 Commits (10+)

  • 4baa117 remove watches if user gets removed from team, and team is deleted as a whole
  • 4774973 let new team member automatically watch all repositories
  • a7a0b85 remove watch if user gets removed from collaborators
  • ffc60ff undo unneeded change
  • fd3cf7e remove stale watches
  • 7d54006 remove issue_watches when team member is removed, team repository is removed, a collaborator is removed
  • fa758ae remove stale issue watches; fix missing userID in issue_watch delete statement
  • dcd1cba add missing beginning and closing of session in migration
  • edb0169 change to correct user id
  • 39f51c5 remove debug log output from migration

📊 Changes

6 files changed (+233 additions, -0 deletions)

View changed files

📝 models/issue_watch.go (+12 -0)
📝 models/migrations/migrations.go (+2 -0)
models/migrations/v67.go (+158 -0)
📝 models/org_team.go (+49 -0)
📝 models/repo.go (+3 -0)
📝 models/repo_collaboration.go (+9 -0)

📄 Description

Targets: https://github.com/go-gitea/gitea/issues/3343, https://github.com/go-gitea/gitea/issues/3782, https://github.com/go-gitea/gitea/issues/4149

What does it do:

  • removes watches if users gets removed from a team or a team is deleted as a whole.
  • also sets new team users to watch all team repositories.
  • remove watch if user gets removed from the collaborators of a repo

TODO:

  • create migration to remove watches that are hanging in the air
  • also remove issue_watches
  • also remove issue_watches in migration

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/4201 **Author:** [@daviian](https://github.com/daviian) **Created:** 6/9/2018 **Status:** ✅ Merged **Merged:** 6/19/2018 **Merged by:** [@techknowlogick](https://github.com/techknowlogick) **Base:** `master` ← **Head:** `bugfix/watches` --- ### 📝 Commits (10+) - [`4baa117`](https://github.com/go-gitea/gitea/commit/4baa117d89d98a36b228288fb0a241379670c9c0) remove watches if user gets removed from team, and team is deleted as a whole - [`4774973`](https://github.com/go-gitea/gitea/commit/4774973589762621b8984d40304849db89814b73) let new team member automatically watch all repositories - [`a7a0b85`](https://github.com/go-gitea/gitea/commit/a7a0b85d2007566a5c25f34491faa7e91dd57c2b) remove watch if user gets removed from collaborators - [`ffc60ff`](https://github.com/go-gitea/gitea/commit/ffc60ff635a641a7d0267009429b16a4e04b09ee) undo unneeded change - [`fd3cf7e`](https://github.com/go-gitea/gitea/commit/fd3cf7e09062d5e8871fda6017180a6b39c6f0ff) remove stale watches - [`7d54006`](https://github.com/go-gitea/gitea/commit/7d5400680262ec3f2f8dce28034a52726ccae6ad) remove issue_watches when team member is removed, team repository is removed, a collaborator is removed - [`fa758ae`](https://github.com/go-gitea/gitea/commit/fa758ae603c0f58ee4f40beb9fd13e7fc25caab8) remove stale issue watches; fix missing userID in issue_watch delete statement - [`dcd1cba`](https://github.com/go-gitea/gitea/commit/dcd1cba32f652e8f2753ca80cdda382a5f18e52f) add missing beginning and closing of session in migration - [`edb0169`](https://github.com/go-gitea/gitea/commit/edb0169c613bbd59f3ee083fdcf2bb309c4974e0) change to correct user id - [`39f51c5`](https://github.com/go-gitea/gitea/commit/39f51c5c89464ca755b1e646735662b58f160eb3) remove debug log output from migration ### 📊 Changes **6 files changed** (+233 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `models/issue_watch.go` (+12 -0) 📝 `models/migrations/migrations.go` (+2 -0) ➕ `models/migrations/v67.go` (+158 -0) 📝 `models/org_team.go` (+49 -0) 📝 `models/repo.go` (+3 -0) 📝 `models/repo_collaboration.go` (+9 -0) </details> ### 📄 Description Targets: https://github.com/go-gitea/gitea/issues/3343, https://github.com/go-gitea/gitea/issues/3782, https://github.com/go-gitea/gitea/issues/4149 What does it do: * removes watches if users gets removed from a team or a team is deleted as a whole. * also sets new team users to watch all team repositories. * remove watch if user gets removed from the collaborators of a repo TODO: - [x] create migration to remove watches that are hanging in the air - [x] also remove issue_watches - [x] also remove issue_watches in migration --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:31:34 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17280