-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Improve frontend handling of many projects #20151
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
Conversation
organizationId: org.id, | ||
excludeConfigurations, | ||
pagination: { | ||
pageSize: 100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now query at most 100 projects (SCM repos not included) for the initial load in repo selectors. Pagination is not implemented, but also not necessary yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unified repo search has been changed to:
- in addition to the SCM repo search, searching for any imported repository with the search term
- also in addition to the above, we search for the currently selected imported repo either by ID or URL to resolve anything you might already have in there
return repo.configurationId === selectedConfigurationId; | ||
} | ||
|
||
if (repo.url.endsWith(".git")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🫧 We have similar code in the backend as well...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this piece is duplicated in so many places. We should try to have this somewhere more centralized.
components/dashboard/src/data/git-providers/unified-repositories-search-query.ts
Show resolved
Hide resolved
"tailwind-underline-utils": "^1.1.2", | ||
"tailwindcss-filters": "^3.0.0", | ||
"typescript": "^5.4.5", | ||
"typescript": "^5.5.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doing this because I was using a feature introduced in 5.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, which feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the Inferred Type Predicates, which lets us do filter
with !== undefined
without having to use something like repo is SuggestedRepository
, basically typescript being smart about the fact that when you check something isn't undefined, its type correctly changes.
Workspaces worked well
|
.orderBy("project.creationTime", "DESC") | ||
.andWhere("project.markedDeleted = false"); | ||
|
||
if (limit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit (not-blocking: Do you think we need a default value and max value (where we use it)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to impose a limit here. Added that in 1c5a88d
(#20151)
const suggestedQuery = useSuggestedRepositories({ excludeConfigurations }); | ||
// 1st data source: suggested SCM repos + up to 100 imported repos. | ||
// todo(ft): look into deduplicating and merging these on the server | ||
const suggestedQuery = useSuggestedRepositories({ excludeConfigurations: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weired to do this change, I image that suggestedRespositories
has some logic inside like base on users' activity recommend them with different priority of items.
In current implement, we will filter out configurations and fetch + append again only via name searching.
Just feel it's weired, not blocking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It leads a condition: I use bitbucket.gitpod-dev.com/scm/tes/ten-k-1304
to start a workspace, and back to dashboard, the first listed context url in new workspace page is not 1304
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair, we should not make this reorder all projects all of a sudden. Reverting this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@filiptronicek do you expect the third one
update: |
repositories: repos.map((r) => this.apiConverter.toSuggestedRepository(r)), | ||
pagination: new PaginationResponse({ | ||
nextToken: "", | ||
total: repos.length, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we no longer know
Description
Make the experience of using a large amount of projects / repository configurations more delightful.
/project
pathsuseListAllProjectsQuery
, which was used in ways it shouldn't have (like getting the current project)Related Issue(s)
Fixes ENT-717
How to test
First, join my org so you have some repos imported
Try starting a workspace: