Skip to content
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

Extend Notifications API and return pinned notifications by default #12164

Merged
merged 14 commits into from
Jul 11, 2020

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Jul 6, 2020

This PR extends the notifications API to allow specific notification statuses to be searched for and to allow setting of notifications to statuses other than read.

By default unread and pinned statuses will be returned when querying for notifications - however pinned statuses will not be marked as read.

Close #12152

Signed-off-by: Andrew Thornton art27@cantab.net

…ions list

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the modifies/api This PR adds API routes or modifies them label Jul 6, 2020
@zeripath zeripath added this to the 1.13.0 milestone Jul 6, 2020
Signed-off-by: Andrew Thornton <art27@cantab.net>
@ghost
Copy link

ghost commented Jul 6, 2020

Will these changes be backported to 1.12?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 6, 2020
Signed-off-by: Andrew Thornton <art27@cantab.net>
@mmarif4u
Copy link

mmarif4u commented Jul 7, 2020

Thanks @zeripath for the fixes.

I hope these fixes makes it to 1.12.2.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 7, 2020
Signed-off-by: Andrew Thornton <art27@cantab.net>
routers/api/v1/notify/repo.go Outdated Show resolved Hide resolved
@lunny
Copy link
Member

lunny commented Jul 8, 2020

CI failed.

@zeripath
Copy link
Contributor Author

zeripath commented Jul 8, 2020

CI failure was not related to this change because this change does not affect those endpoints - certainly there were issues because of unchanged tests earlier.

models/notification.go Outdated Show resolved Hide resolved
models/notification.go Outdated Show resolved Hide resolved
models/notification.go Outdated Show resolved Hide resolved
models/notification.go Outdated Show resolved Hide resolved
models/notification.go Outdated Show resolved Hide resolved
models/notification.go Outdated Show resolved Hide resolved
Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath
Copy link
Contributor Author

I'm not certain that using IN for 1 argument is actually worth it - but then again it's arguably a premature optimisation to do the len() check - so in which case I will do it.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 11, 2020
@lafriks
Copy link
Member

lafriks commented Jul 11, 2020

🚀

@lafriks lafriks merged commit 6359101 into go-gitea:master Jul 11, 2020
@6543
Copy link
Member

6543 commented Jul 12, 2020

should we partialy backport it to 1.12? (so that pinned ones are with the unreaded) ?

@zeripath zeripath deleted the notifications-api-improvements branch July 13, 2020 08:28
@zeripath
Copy link
Contributor Author

I guess we can claim it is a bug.

zeripath added a commit to zeripath/gitea that referenced this pull request Jul 13, 2020
…o-gitea#12164)

Backport go-gitea#12164

This PR extends the notifications API to allow specific notification statuses to be searched for and to allow setting of notifications to statuses other than read.

By default unread and pinned statuses will be returned when querying for notifications - however pinned statuses will not be marked as read.

Close go-gitea#12152

Signed-off-by: Andrew Thornton art27@cantab.net
@zeripath zeripath added backport/done All backports for this PR have been created type/bug labels Jul 13, 2020
zeripath added a commit that referenced this pull request Jul 13, 2020
…12164) (#12232)

Backport #12164

This PR extends the notifications API to allow specific notification statuses to be searched for and to allow setting of notifications to statuses other than read.

By default unread and pinned statuses will be returned when querying for notifications - however pinned statuses will not be marked as read.

Close #12152

Signed-off-by: Andrew Thornton art27@cantab.net
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notification API bugs.
7 participants