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

Add filter option for subscribed issues #17053

Closed
wants to merge 22 commits into from
Closed

Add filter option for subscribed issues #17053

wants to merge 22 commits into from

Conversation

qwerty287
Copy link
Contributor

This pull request adds a filter option "subscribed" to the /issues overview and to the lists in in the repos (and to the API). Addresses #16111 (and closes the first part of it).

I know that the SQL command here is a very long and complex SQL command, but I didn't find another working way (I don't know enough about these xorm.Session conditions) and it works. The command just filters the issues if they are in the issue_watch table and is_watching is 1 or if they are in the comment table but not in the list of issues in issue_watch where is_watching is 0 or if they are in the issues table but not in the list of issues in issue_watch where is_watching is 0. If you know another way how to make this more readable, it would be nice if you could comment.

@axifive axifive added the type/enhancement An improvement of existing functionality label Sep 15, 2021
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 18, 2021
@qwerty287
Copy link
Contributor Author

Probably, this is a very bad question, but how do I fix this test-pgsql integration test? Unfortunately, I don't know how to fix them. The errors are (in two different files):

GetUserIssueStats: operator does not exist: boolean = integer
pull_review_test.go:16:
    Error Trace:	integration_test.go:449 	 				
        integration_test.go:282 	 				
        pull_review_test.go:16 	
    Error: 	
        Not equal: 	 	
            expected: 200 	 	
            actual : 500 	
Test: 	TestPullView_ReviewerMissed

I fixed it now. You can review this PR :)

@codecov-commenter
Copy link

codecov-commenter commented Sep 21, 2021

Codecov Report

Merging #17053 (92bcb21) into main (f2e7d54) will decrease coverage by 0.00%.
The diff coverage is 28.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17053      +/-   ##
==========================================
- Coverage   45.31%   45.30%   -0.01%     
==========================================
  Files         773      773              
  Lines       86873    86907      +34     
==========================================
+ Hits        39366    39376      +10     
- Misses      41151    41170      +19     
- Partials     6356     6361       +5     
Impacted Files Coverage Δ
routers/api/v1/repo/issue.go 47.40% <0.00%> (-0.25%) ⬇️
routers/web/user/home.go 58.33% <0.00%> (-0.42%) ⬇️
models/issue.go 57.99% <26.08%> (-0.59%) ⬇️
routers/web/repo/issue.go 38.57% <66.66%> (+0.06%) ⬆️
models/gpg_key_common.go 59.67% <0.00%> (-4.84%) ⬇️
modules/queue/queue_channel.go 95.00% <0.00%> (-1.67%) ⬇️
modules/log/file.go 73.60% <0.00%> (-1.61%) ⬇️
services/pull/pull.go 41.78% <0.00%> (-0.41%) ⬇️
modules/queue/workerpool.go 48.85% <0.00%> (-0.39%) ⬇️
models/issue_comment.go 51.90% <0.00%> (+0.29%) ⬆️
... and 3 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 f2e7d54...92bcb21. Read the comment docs.

@qwerty287
Copy link
Contributor Author

Closing this as it's better solved by #17156

@qwerty287 qwerty287 closed this Oct 2, 2021
@qwerty287 qwerty287 deleted the subscribed-issues branch November 29, 2021 18:40
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
lafriks added a commit that referenced this pull request Sep 29, 2022
Adds GitHub-like pages to view watched repos and subscribed issues/PRs
This is my second try to fix this, but it is better than the first since
it doesn't uses a filter option which could be slow when accessing
`/issues` or `/pulls` and it shows both pulls and issues (the first try
is #17053).

Closes #16111 
Replaces and closes #17053


![Screenshot](https://user-images.githubusercontent.com/80460567/134782937-3112f7da-425a-45b6-9511-5c9695aee896.png)

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants