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

Return empty when searching issues with no repos #26545

Merged
merged 4 commits into from Aug 17, 2023

Conversation

wolfogre
Copy link
Member

@wolfogre wolfogre commented Aug 16, 2023

Fix #26512.

Replace and close #26515.

Regression of #26012.

After this:

image image image

@wolfogre wolfogre added this to the 1.21.0 milestone Aug 16, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 16, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 16, 2023
@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 Aug 16, 2023
@wolfogre wolfogre marked this pull request as ready for review August 16, 2023 11:04
routers/web/user/home.go Outdated Show resolved Hide resolved
@wolfogre wolfogre changed the title Return empty when searching issues with empty repos Return empty when searching issues with no repos Aug 16, 2023
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 17, 2023
@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 Aug 17, 2023
wolfogre added a commit that referenced this pull request Aug 17, 2023
Fix
`#26545 (comment)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
GiteaBot added a commit to GiteaBot/gitea that referenced this pull request Aug 17, 2023
Fix
`go-gitea#26545 (comment)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
silverwind pushed a commit that referenced this pull request Aug 17, 2023
Backport #26556 by @wolfogre

Fix
`#26545 (comment)

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@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 Aug 17, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Aug 17, 2023
// no repos found, don't let the indexer return all repos
opts.RepoIDs = []int64{0}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Curious, what's this {} syntax? Is this a on-demand closure like in JS?

Copy link
Member

@jolheiser jolheiser Aug 17, 2023

Choose a reason for hiding this comment

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

It's an int64 slice literal with a single value 0 in it.

Copy link
Member

Choose a reason for hiding this comment

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

Not that one, I meant the enclosing {} between lines 460 and 471.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Ah, my bad! Yep, a block.

Copy link
Member Author

Choose a reason for hiding this comment

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

Never mind, it is just a trick. I usually do this in a relatively separate piece of code, to avoid polluting a broader scope with local variables, especially when the function body is large.

buildIssueOverview is so big, it has almost 400 lines and at least 20 local variables.

Explicit blocks also make it clear how to refactor them to multiple functions, but I'm too lazy to refactor it right now 😁

@jolheiser jolheiser merged commit b658f2c into go-gitea:main Aug 17, 2023
24 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Aug 17, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Aug 18, 2023
* upstream/main:
  [skip ci] Updated translations via Crowdin
  Fix various line-height styles (go-gitea#26553)
  Return empty when searching issues with no repos (go-gitea#26545)
  Support rebuilding issue indexer manually (go-gitea#26546)
  Fix label filter between `all` and `no` (go-gitea#26557)
  Fix "issueReposQueryPattern does not match query" (go-gitea#26556)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Nov 16, 2023
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Teams filter has no effect in org level dashboard
7 participants