Skip to content

Fix project issues list and counting#33594

Merged
wxiaoguang merged 21 commits into
go-gitea:mainfrom
lunny:lunny/fix_project_issues_list
Feb 17, 2025
Merged

Fix project issues list and counting#33594
wxiaoguang merged 21 commits into
go-gitea:mainfrom
lunny:lunny/fix_project_issues_list

Conversation

@lunny
Copy link
Copy Markdown
Member

@lunny lunny commented Feb 14, 2025

No description provided.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 14, 2025
@lunny lunny force-pushed the lunny/fix_project_issues_list branch from 1bc5c2c to 5878ceb Compare February 15, 2025 20:13
@lunny lunny marked this pull request as ready for review February 16, 2025 05:19
@lunny lunny requested review from 6543, lafriks and wxiaoguang February 16, 2025 05:31
Comment thread models/issues/issue_project.go Outdated
Comment thread models/issues/issue_search.go Outdated
Comment thread models/issues/issue_search.go Outdated
Comment thread models/project/column.go Outdated
Comment thread models/project/column.go

// MustDefaultColumn returns the default column for a project, get the first one if exist one and creating one if it does not exist
func (p *Project) MustDefaultColumn(ctx context.Context) (*Column, error) {
c, err := p.getDefaultColumn(ctx)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The Desc(id) in the called method seems incorrect.
Shouldn't it be Asc(sorting, id) instead?
(even if it might be potentially minimally breaking if someone misconfigured their projects)

Copy link
Copy Markdown
Member Author

@lunny lunny Feb 17, 2025

Choose a reason for hiding this comment

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

I think it's already OrderBy("sorting, id")?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

@wxiaoguang wxiaoguang Feb 17, 2025

Choose a reason for hiding this comment

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

I do not think it should change the existing logic in getDefaultColumn

The old logic means this: use the latest default one. It doesn't care about "sorting" or not. There should be only one "default" column, the "order by" is just a fallback.

Comment thread services/projects/issue.go Outdated
Comment thread models/project/column_test.go Outdated
wxiaoguang
wxiaoguang previously approved these changes Feb 17, 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 Feb 17, 2025
@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 Feb 17, 2025
Comment thread models/project/column.go Outdated
Comment thread models/project/column_test.go Outdated
@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 Feb 17, 2025
@wxiaoguang wxiaoguang enabled auto-merge (squash) February 17, 2025 04:49
@wxiaoguang wxiaoguang merged commit 69de5a6 into go-gitea:main Feb 17, 2025
@GiteaBot GiteaBot added this to the 1.24.0 milestone Feb 17, 2025
@lunny lunny deleted the lunny/fix_project_issues_list branch February 17, 2025 05:20
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Feb 17, 2025
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Feb 17, 2025
wxiaoguang added a commit that referenced this pull request Feb 17, 2025
Backport #33594 by lunny

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Feb 18, 2025
* giteaofficial/main:
  Make actions URL in commit status webhooks absolute (go-gitea#33620)
  Refactor error system (go-gitea#33626)
  Move issue pin to an standalone table for querying performance (go-gitea#33452)
  Run spellcheck on tools directory (go-gitea#33627)
  Refactor error system (go-gitea#33610)
  Fix project issues list and counting (go-gitea#33594)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators May 18, 2025
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. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants