Skip to content

undo limit to fetch the first 100 user repos for New Workspace – EXP-554 #18644

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

Merged
merged 3 commits into from
Sep 4, 2023

Conversation

AlexTugarev
Copy link
Member

@AlexTugarev AlexTugarev commented Sep 1, 2023

This reverts 2f2b1ab effectively.

We've also discovered, that rending of many items in the drop down becomes a bottleneck. To make it still work nicely, this PR introduces a limit of items to be rendered on New Workspace list. This limit is applied after filtering, so that you'd be able to start typing and find even repositories not visible by scrolling down.

Summary generated by Copilot

🤖 Generated by Copilot at f490b01

Increase the number of repos fetched from Bitbucket Server in the dashboard. Modify getUserRepos in bitbucket-server-repository-provider.ts to use pagination.

Related Issue(s)

Fixes EXP-554

How to test

See all repositories are loaded on New Workspace page if you've a connection to testing BBS with ~10K repos.

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@AlexTugarev AlexTugarev changed the title undo limit to fetch the first 100 user repos for New Workspace undo limit to fetch the first 100 user repos for New Workspace – EXP-554 Sep 1, 2023
@akosyakov
Copy link
Member

We synced with @AlexTugarev when one tries to type in the search or collapse context url and then tries to reopen UI freezes. There are memory consumptions jumps between 20-150 Mbs. Alex is going to investigate it 🙏

@roboquat roboquat added size/L and removed size/XS labels Sep 1, 2023
@AlexTugarev AlexTugarev marked this pull request as ready for review September 1, 2023 15:45
@@ -41,14 +40,18 @@ export const useUserLoader = () => {
retryDelay: (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 10000),
cacheTime: 1000 * 60 * 60 * 1, // 1 hour
staleTime: 1000 * 60 * 60 * 1, // 1 hour
onSuccess: (loadedUser) => {
setUser(loadedUser);
refreshSearchData();
Copy link
Member Author

Choose a reason for hiding this comment

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

@svenefftinge, maybe you recall why this was introduced?
We've noticed getSuggestedContextURLs was called 3x on load of /new. Explicitly updating on setUser seems to be less obvious, but maybe there was some reason to introduce this? git history shows that there were many changes related to the transition from contexts holding/updating data to usage of query, and I wonder if this is a left-over.

Copy link
Member

Choose a reason for hiding this comment

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

Does RepositoryFinder depend on any user properties that it should be retriggered? if not it should not be here? It looks rather strange way of doing, we would provide user state as a dependency to RepositoryFinder if we want to do it properly? cc @selfcontained

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question! 🤷🏻‍♂️
Maybe if you're pasting in a repository URL of a SCM provider you did not authorized with, and the context resolution fails, which will render the Authorize with provider action? But even if that's the case, and we'd call setUser on a success event, we should try to refresh search data from there, and not do it on every update, including the initial one.
I'll try to reproduce, and see how that's behaving.

} catch {}
}
} else {
result = suggestedContextURLs.slice(0, 200);
Copy link
Member Author

Choose a reason for hiding this comment

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

While testing this, I was wondering if we could add a trailing element which indicates that this list is truncated.

@akosyakov
Copy link
Member

akosyakov commented Sep 4, 2023

/gh run recreate-vm=true

Comment triggered a workflow run

Started workflow run: 6069966446

  • recreate_vm: true

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

It works the way better now! It stays under 10Mb for the page.

@AlexTugarev
Copy link
Member Author

/unhold

@roboquat roboquat merged commit d6e1866 into main Sep 4, 2023
@roboquat roboquat deleted the at/bbs-undo-limit branch September 4, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants