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

Allow filtering issues by any assignee #33343

Merged
merged 15 commits into from
Mar 21, 2025
Merged

Conversation

asvanberg
Copy link
Contributor

This is the opposite of the "No assignee" filter, it will match all issues that have at least one assignee.

Before
Before change

After
After change with any filter

This is the opposite of the "No assignee" filter.

It will match all issues that have at least one assignee.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 21, 2025
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 21, 2025
@github-actions github-actions bot added modifies/translation modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files labels Jan 21, 2025
@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 Jan 21, 2025
Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, this PR only changes the db search logic.

But there are other search engines, would they go wrong? Correct me if I was wrong.

image

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 21, 2025
@silverwind silverwind self-requested a review January 21, 2025 16:50
@asvanberg
Copy link
Contributor Author

If I understand correctly, this PR only changes the db search logic.

But there are other search engines, would they go wrong? Correct me if I was wrong.

I searched the code base to find where there was special logic for the db.NoConditionID relating to issue assignees and only found that place and changing it appeared to have solved it.

Looking at modules/indexer/issues/dboptions.go I can see that it converts the -1 (db.NoConditionID) to 0 before passing the search options to the indexers. I could attempt to propagate a magic value down to the indexers search options and handle it in bleve (and the other indexers too I assume) but if you don't want to keep using magic numbers that seems like it would just make a future migration to another datatype require more work?

@wxiaoguang
Copy link
Contributor

Without a complete refactoring, I could accept a non-conflicting magic number other than -2 at the moment (see the NonExistingID below), and I think it needs some tests to cover the behavior.

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 23, 2025
@asvanberg asvanberg requested a review from wxiaoguang February 27, 2025 11:55
@wxiaoguang wxiaoguang self-assigned this Feb 27, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 1, 2025

Will take a look in a few days.


Update: maybe need some more time, I will try to refactor the "assignee" to a meaningful string, to avoid using these strange magic numbers.

@wxiaoguang wxiaoguang force-pushed the any-assignee branch 2 times, most recently from 91a45ab to eaacdf3 Compare March 20, 2025 09:03
@wxiaoguang wxiaoguang changed the title WIP: Allow filtering issues by any assignee Allow filtering issues by any assignee Mar 20, 2025
@wxiaoguang wxiaoguang marked this pull request as ready for review March 20, 2025 09:16
@wxiaoguang wxiaoguang removed their assignment Mar 20, 2025
@wxiaoguang wxiaoguang added this to the 1.24.0 milestone Mar 20, 2025
@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 Mar 20, 2025
@wxiaoguang wxiaoguang added the type/enhancement An improvement of existing functionality label Mar 20, 2025
@wxiaoguang
Copy link
Contributor

CI passes and ready for review

@asvanberg
Copy link
Contributor Author

I think we could do this: 330c7e2

I like it. Thanks for picking up the torch and doing the work to get rid of the magic numbers 👍

@wxiaoguang wxiaoguang requested review from lunny and removed request for silverwind March 21, 2025 03:31
@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 Mar 21, 2025
@wxiaoguang wxiaoguang requested a review from silverwind March 21, 2025 03:31
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels Mar 21, 2025
@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 Mar 21, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 21, 2025
@lunny lunny enabled auto-merge (squash) March 21, 2025 04:00
@lunny lunny merged commit 0da7318 into go-gitea:main Mar 21, 2025
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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 modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants