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

Refactor Find Sources and fix bug when view a user who belongs to an unactive auth source #27798

Merged
merged 8 commits into from Nov 3, 2023

Conversation

lunny
Copy link
Member

@lunny lunny commented Oct 26, 2023

The steps to reproduce it.

First, create a new oauth2 source.
Then, a user login with this oauth2 source.
Disable the oauth2 source.
Visit users -> settings -> security, 500 will be displayed.
This is because this page only load active Oauth2 sources but not all Oauth2 sources.

@lunny lunny added type/bug type/refactoring Existing code has been cleaned up. There should be no new functionality. backport/v1.20 This PR should be backported to Gitea 1.20 backport/v1.21 This PR should be backported to Gitea 1.21 labels Oct 26, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 26, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 26, 2023
@github-actions github-actions bot added the modifies/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin label Oct 26, 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 Oct 27, 2023
@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 Nov 2, 2023
Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

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

There are some changes to these functions in #25165 to make them more generic. Could you utilize some of these update function names/args to make conflict merging easier?

@lunny
Copy link
Member Author

lunny commented Nov 3, 2023

There are some changes to these functions in #25165 to make them more generic. Could you utilize some of these update function names/args to make conflict merging easier?

I think the changes are the correct direction. I will help to resolve your PR's conflict after this merge.

@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Nov 3, 2023
@lunny lunny enabled auto-merge (squash) November 3, 2023 01:11
@lunny lunny added this to the 1.22.0 milestone Nov 3, 2023
@lunny lunny merged commit 1bf5527 into go-gitea:main Nov 3, 2023
25 checks passed
@GiteaBot
Copy link
Contributor

GiteaBot commented Nov 3, 2023

I was unable to create a backport for 1.20. @lunny, please send one manually. 🍵

go run ./contrib/backport 27798
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added backport/manual No power to the bots! Create your backport yourself! and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels Nov 3, 2023
@GiteaBot
Copy link
Contributor

GiteaBot commented Nov 3, 2023

I was unable to create a backport for 1.21. @lunny, please send one manually. 🍵

go run ./contrib/backport 27798
...  // fix git conflicts if any
go run ./contrib/backport --continue

@lunny lunny deleted the lunny/fix_unactive_auth_source branch November 3, 2023 01:44
@lunny lunny removed backport/manual No power to the bots! Create your backport yourself! backport/v1.20 This PR should be backported to Gitea 1.20 backport/v1.21 This PR should be backported to Gitea 1.21 labels Nov 3, 2023
@lunny
Copy link
Member Author

lunny commented Nov 3, 2023

There are too many conflicts, so I think maybe it's not necessary to backport to v1.21 and v1.20.

zjjhot added a commit to zjjhot/gitea that referenced this pull request Nov 3, 2023
* upstream/main:
  Refactor Find Sources and fix bug when view a user who belongs to an unactive auth source (go-gitea#27798)
  [skip ci] Updated translations via Crowdin
  Add `Hide/Show all checks` button to commit status check (go-gitea#26284)
  Fix http protocol auth (go-gitea#27875)
  Display issue task list on project cards (go-gitea#27865)
  Reduce margin/padding on flex-list items and divider (go-gitea#27872)
@KN4CK3R KN4CK3R mentioned this pull request Nov 5, 2023
lunny pushed a commit that referenced this pull request Nov 6, 2023
Now that we have #27798 we don't need the check from #27870 anymore.
With the check it's not possible to remove an inactive auth source from
the user.
KN4CK3R pushed a commit that referenced this pull request Nov 11, 2023
lunny added a commit that referenced this pull request Dec 11, 2023
Continue of #27798 and move more functions to `db.Find` and `db.Count`.
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
…unactive auth source (go-gitea#27798)

The steps to reproduce it.

First, create a new oauth2 source.
Then, a user login with this oauth2 source.
Disable the oauth2 source.
Visit users -> settings -> security, 500 will be displayed.
This is because this page only load active Oauth2 sources but not all
Oauth2 sources.
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
Now that we have go-gitea#27798 we don't need the check from go-gitea#27870 anymore.
With the check it's not possible to remove an inactive auth source from
the user.
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
Continue of go-gitea#27798 and move more functions to `db.Find` and `db.Count`.
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Feb 1, 2024
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/cli PR changes something on the CLI, i.e. gitea doctor or gitea admin size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/bug type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants