-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Auto-subscribe user to repository when they commit/tag to it #7657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
c0226f2
Add support for AUTO_WATCH_ON_CHANGES and AUTO_WATCH_ON_CLONE
6c1a039
Update models/repo_watch.go
guillep2k 5d52dda
Round up changes suggested by lafriks
6e4a28d
Added changes suggested from automated tests
ce99d45
Updated deleteUser to take RepoWatchModeDont into account, corrected …
7781419
Merge branch 'master' into watchonchanges
70790fa
Merge branch 'master' into watchonchanges
6d039b8
Merge branch 'master' into watchonchanges
guillep2k 3dad90f
Merge branch 'master' into watchonchanges
guillep2k 34643f1
Merge branch 'master' into watchonchanges
guillep2k 4a9fad0
Merge branch 'master' into watchonchanges
guillep2k 2abd413
Reinsert import "github.com/Unknwon/com" on http.go
guillep2k dd2fa5a
Merge branch 'master' of github.com:go-gitea/gitea into watchonchanges
guillep2k 3034d5e
Add migration for new column `watch`.`mode`
guillep2k 623cfe5
Merge branch 'master' into watchonchanges
guillep2k d1cc6fb
Merge branch master into watchonchanges
guillep2k 6715664
Remove serv code
guillep2k 00782cf
Remove WATCH_ON_CLONE; use hooks, add integrations
guillep2k f0377e1
Merge branch 'master' of github.com:go-gitea/gitea into watchonchanges
guillep2k ff09de9
Renamed watch_test.go to repo_watch_test.go
guillep2k fde42fa
Correct fmt
guillep2k 0969aa8
Add missing EOL
guillep2k 4a0d89e
Correct name of test function
guillep2k 28a4af3
Merge branch 'master' of github.com:go-gitea/gitea into watchonchanges
guillep2k 3ef2ff1
Merge from master, resolve conflicts
guillep2k de0852f
Reword cheat and ini descriptions
guillep2k f0e6aeb
Add update to migration to ensure column value
guillep2k ad68861
Merge branch 'master' into watchonchanges
guillep2k df24eb0
Merge branch 'master' into watchonchanges
lunny 4e76559
Merge branch 'master' into watchonchanges
lafriks edc9f52
Merge master and resolve conflicts
guillep2k 59e6f88
Merge branch 'watchonchanges' of github.com:guillep2k/gitea into watc…
guillep2k 4341a4b
Clarify comment
guillep2k c59a238
Simplify if condition
guillep2k 8301471
Merge branch 'master' into watchonchanges
lunny 7eec08b
Merge branch 'master' into watchonchanges
zeripath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2019 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package integrations | ||
|
||
import ( | ||
"net/url" | ||
"testing" | ||
|
||
"code.gitea.io/gitea/models" | ||
"code.gitea.io/gitea/modules/setting" | ||
) | ||
|
||
func TestRepoWatch(t *testing.T) { | ||
onGiteaRun(t, func(t *testing.T, giteaURL *url.URL) { | ||
// Test round-trip auto-watch | ||
setting.Service.AutoWatchOnChanges = true | ||
session := loginUser(t, "user2") | ||
models.AssertNotExistsBean(t, &models.Watch{UserID: 2, RepoID: 3}) | ||
testEditFile(t, session, "user3", "repo3", "master", "README.md", "Hello, World (Edited for watch)\n") | ||
models.AssertExistsAndLoadBean(t, &models.Watch{UserID: 2, RepoID: 3, Mode: models.RepoWatchModeAuto}) | ||
}) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2019 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package migrations | ||
|
||
import ( | ||
"xorm.io/xorm" | ||
) | ||
|
||
// RepoWatchMode specifies what kind of watch the user has on a repository | ||
type RepoWatchMode int8 | ||
|
||
// Watch is connection request for receiving repository notification. | ||
type Watch struct { | ||
ID int64 `xorm:"pk autoincr"` | ||
Mode RepoWatchMode `xorm:"SMALLINT NOT NULL DEFAULT 1"` | ||
} | ||
|
||
func addModeColumnToWatch(x *xorm.Engine) (err error) { | ||
if err = x.Sync2(new(Watch)); err != nil { | ||
return | ||
} | ||
_, err = x.Exec("UPDATE `watch` SET `mode` = 1") | ||
return err | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.