-
-
Notifications
You must be signed in to change notification settings - Fork 508
Improve slow user authorization if many orgs/repos #5665
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
base: main
Are you sure you want to change the base?
Improve slow user authorization if many orgs/repos #5665
Conversation
This reverts commit 63ac98c.
|
What do you think about letting the UI call the /refresh automatically. Basically:
|
|
Hi @anbraten That is indeed an alternate approach to this issue, though I think it might get concerning at scale. Because
It could perhaps be an automated action in the login flow, which it is already with this change. Having it configurable is maybe unnecessary, but I didn't want to alter the behavior for organisations that have no problems currently. |
- Context propagation to updateRepoPermissions - Missing error handler in go func - Reduce async handler complexity
|
Surge PR preview deployment succeeded. View it at https://woodpecker-ci-woodpecker-pr-5665.surge.sh |
Isn't login sync used also for repo/org rights checks? |
|
Is the root cause of the issue I raised (#5889 ) the same as this ? |
No, all repos are needed here to sync permissions |
|
I wanted to follow up on this PR, as it’s been dormant for a while now. The issue it addresses still exists: login time scales poorly with the number of orgs/repos due to synchronous forge synchronization during authentication, which has a noticeable UX impact for larger accounts. If there’s any guidance on a preferred way to move forward, I’m happy to adapt or rework the PR accordingly. And to anyone reading this: I wish you a happy new year, hopefully we can get this one fixed in 2026 🥳 |
|
Personally I would like to see some warning shown in UI that user right sync while it is still in progress after login |
|
@lafriks That would indeed be better UX for the default (synchronous) login, but that doesn't resolve the original issue of large accounts/organisations taking a long time to log in. In my personal case it takes up to 2 minutes. |
|
I mean it would still be async, would login user instantly but would show permanent warning somewhere near top menu that user right synchronization is in progress and not all repositories could be accessible yet and would hide it when it's done |
This PR is a solution for #2502.
To resolve the issue a configuration option
WOODPECKER_ASYNC_REPOSITORY_UPDATEhas been added to allow administrators to decide how Woodpecker should deal with the repository update call that is part of the login flow. It can be either sync/async.Sync is do-able for smaller organisations with few repositories, but larger organisations might opt for async to improve login speed at the cost of consistency. The repository list will be eventually consistent depending on the forge & store performance. The configuration flag was added to avoid altering default behavior for existing setups, unless changed by the administrator.
To improve UX for new users I made it mandatory for them to await the repository update, to avoid having new users log in to a blank homepage as this might be confusing. After this initial slow login they will also get async updates, and thus faster logins.
Closes #2502