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

[API] Add notification endpoint #9488

Merged
merged 6 commits into from Jan 9, 2020
Merged

Conversation

6543
Copy link
Member

@6543 6543 commented Dec 25, 2019

close #4811

This is the main PR adding Notification Endpoint ...

[Spec Link]

Changes

future imprufements:

@6543 6543 changed the title [API] Add notification endpoint [WIP] [API] Add notification endpoint Dec 25, 2019
@codecov-io
Copy link

codecov-io commented Dec 25, 2019

Codecov Report

Merging #9488 into master will increase coverage by <.01%.
The diff coverage is 5.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9488      +/-   ##
==========================================
+ Coverage   42.22%   42.22%   +<.01%     
==========================================
  Files         587      587              
  Lines       77947    77947              
==========================================
+ Hits        32915    32917       +2     
  Misses      40994    40994              
+ Partials     4038     4036       -2
Impacted Files Coverage Δ
modules/auth/repo_form.go 43.47% <ø> (ø) ⬆️
models/migrations/migrations.go 1.3% <ø> (ø) ⬆️
services/pull/review.go 0% <0%> (ø) ⬆️
modules/webhook/slack.go 26.74% <0%> (ø) ⬆️
routers/repo/pull_review.go 0% <0%> (ø) ⬆️
models/branches.go 45.5% <0%> (ø) ⬆️
routers/repo/pull.go 30.75% <0%> (ø) ⬆️
modules/git/repo_compare.go 69.56% <0%> (ø) ⬆️
modules/webhook/discord.go 1.92% <0%> (ø) ⬆️
models/repo_generate.go 3.8% <0%> (ø) ⬆️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec8db80...b5336d9. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 25, 2019
@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 Dec 25, 2019
@6543
Copy link
Member Author

6543 commented Dec 25, 2019

@zeripath thanks for the lgtm but i think this is to early! maby you mixed up with #9494 ?

@zeripath
Copy link
Contributor

I didn't notice that you hadn't finished! that's what I get for reviewing whilst drinking!

What you've written so far looks reasonable!

🎄 ☃️ Merry Christmas ☃️ 🎄

@techknowlogick techknowlogick added modifies/api This PR adds API routes or modifies them type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Dec 28, 2019
@techknowlogick techknowlogick added this to the 1.12.0 milestone Dec 28, 2019
@6543 6543 force-pushed the add-api-notify branch 5 times, most recently from 6693aae to 5e58bdf Compare January 3, 2020 09:59
@6543 6543 changed the title [WIP] [API] Add notification endpoint [API] Add notification endpoint Jan 3, 2020
routers/api/v1/notify/repo.go Outdated Show resolved Hide resolved
routers/api/v1/notify/threads.go Outdated Show resolved Hide resolved
routers/api/v1/notify/user.go Outdated Show resolved Hide resolved
 * add func GetNotifications(opts FindNotificationOptions)
 * add func (n *Notification) APIFormat()
 * add func (nl NotificationList) APIFormat()
 * add func (n *Notification) APIURL()
 * add func (nl NotificationList) APIFormat()
 * add LoadAttributes functions (loadRepo, loadIssue, loadComment, loadUser)
 * add func (c *Comment) APIURL()
 * add func (issue *Issue) GetLastComment()
 * add endpoint GET /notifications
 * add endpoint PUT /notifications
 * add endpoint GET /repos/{owner}/{repo}/notifications
 * add endpoint PUT /repos/{owner}/{repo}/notifications
 * add endpoint GET /notifications/threads/{id}
 * add endpoint PATCH /notifications/threads/{id}
@6543
Copy link
Member Author

6543 commented Jan 8, 2020

@adelowo done

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
@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 Jan 9, 2020
@zeripath zeripath merged commit 6baa5d7 into go-gitea:master Jan 9, 2020
@6543 6543 deleted the add-api-notify branch January 9, 2020 12:02
@6543 6543 mentioned this pull request Jan 9, 2020
7 tasks
sapk pushed a commit that referenced this pull request Jan 14, 2020
* introduce GET /notifications/new

* add TEST

* use Sprintf instead of path.Join

* Error more verbose

* return number of notifications if unreaded exist

* 200 http status for available notifications
@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
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/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export notifications through the API
8 participants