-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[papi] migrate ListWorkspaces and WatchWorkspaceStatus #19022
Conversation
// organization_id | ||
string organization_id = 2; | ||
|
||
optional bool pinned = 3; |
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.
for the admin case we need other filters as well as sorting. maybe we can generalize somehow?
1d1b7ae
to
bacbad2
Compare
components/public-api/typescript/src/gitpod/experimental/v1/dummy_connect.ts
Outdated
Show resolved
Hide resolved
c7accf4
to
8d13c5c
Compare
components/dashboard/src/data/workspaces/update-workspace-description-mutation.ts
Outdated
Show resolved
Hide resolved
@mustard-mh Should not we invalidate react query caches? |
I see, I did but after rebase it turns into the same value |
// http[s]?:\/\/(?<project>.*?\/.*?\/.*?)[./] | ||
const regex = /http[s]?:\/\/(?<host>.*?)\/(?<owner>.*?)\/(?<name>.*?)[./]/gm; | ||
const result = regex.exec(ws.status.gitStatus.cloneUrl); | ||
if (!result) { | ||
return ws.contextUrl.replace("https://", ""); | ||
} | ||
const { host, owner, name } = result.groups!; | ||
return `${host}/${owner}/${name}`; |
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.
This looks a bit scary 😆. Could we instead fail or return an empty string if we cannot get it from the context URL? Not sure how this would support the deeply-nested GitLab repos, which are not just /owner/repo
.
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 Yes, it is, and for Gitlab it can be longer since it can define lots of subGroup.
But based on current shape of Workspace
we only can do it like this. I'm not sure if we should change workspace shape or do other things
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.
I'm still not sure that we shoudl parse like that or add something like Repository on Workspace? cc @svenefftinge
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 looks good to me, and also is only used as a string to visualize.
I believe we have somewhere a function that translates the cloneURL to a shorter version.
IS this not just cutting off https:// and .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.
Do you mean ContextURL.getNormalizedURL
? I can't find other function that may have this feature. But it will only cut some built-in prefix out and won't trim .git
.
context-parser is only working with server now. We can use it after (will we?) introduce ContextService
in papi
I'll change to use ContextURL.getNormalizedURL
here.
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.
@svenefftinge for comment above ☝️
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.
Ok
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 a RepoURL.parseRepoUrl
function in server that does approximation parsing of owner and name. If that's what's needed, we could thing of pulling this out to protocol.
Otherwise, see RepositoryURL
component in Dashboard if we just need a clean repo URL from a given clone URL.
// search_term is a search term to filter workspaces by name | ||
string search_term = 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.
What is this actually searching? Is this the ID, description, repo details or something different? I think the comment should make it clear.
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.
to filter workspaces by name
by name
qb.andWhere("ws.description LIKE :searchString", { searchString: `%${options.searchString}%` }); |
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.
@mustard-mh in that case, can we please change to the following?
// search_term is a search term to filter workspaces by name | |
string search_term = 4; | |
// search_term is a search term to filter workspaces by description | |
string search_term = 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.
We named it name
now 😄
You can check new Workspace shape in this proto file
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.
Please keep it search_term
and add a comment. The reason is that we want to stop creating a name from the context, but instead have no name and only when you pin a workspace you name it. So we should really search by git status information and name (and id as long as we expose it like we do).
Edit: ignore ☝️
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.
@svenefftinge I don't understand. Do you mean to change comment that it can filter with git status
, workspaceId
and name
?
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.
Oh, sorry. I missunderstood your comment that you named it name
now as if you had changed the property name. So looks good now and we can update the docs once we change the implementation. Thank you!
Feedbacks addressed, @AlexTugarev could you help test again? 🙏 I have tested that watch and list is working in preview env |
When trying to rename a workspace item. @mustard-mh, I broke it. The issue appears to be permanent. Cannot be resolved with a reload. |
🙏 @AlexTugarev Fixed 3fc7b78 |
3fc7b78
to
4003d1f
Compare
rebased to main |
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.
Workspace list was working fine in tests! Thanks!
Maybe test once more after rebase on main.
@mustard-mh just to double check we do test the loading screen? it is affected right? |
@akosyakov Yes, I tested it then found out that |
#19057 just landed. @mustard-mh, would it make sense to bump cache version in dashboard? |
4003d1f
to
b279dcb
Compare
✅ Rebased again, double check that /unhold |
Description
dashboard
to useListWorkspaces
andWatchWorkspaceStatus
Summary generated by Copilot
🤖 Generated by Copilot at d01aa12
Added a new feature to list workspaces by organization ID and other filters. This involved adding new methods and types to the public API, the connect protocol, the workspace service, and the workspace database layer. The files
workspace.proto
,workspace_pb.ts
,workspace.connect.go
,workspace_connect.ts
,workspace-service-api.ts
,workspace-service.ts
,workspace-db.ts
,workspace-db-impl.ts
, andworkspace-db.spec.db.ts
were modified or created to implement this feature. The filesjson-rpc-workspace-client.ts
andworkspace.proxy.connect.go
were updated to use the new methods.Related Issue(s)
Fixes #
How to test
creationTime
,context (git commit...)
)Documentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold