-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Extend admin workspace search #4111
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
f1fb044 to
f35e5d1
Compare
|
/werft run 👍 started the job as gitpod-build-mads-admin-workspace-search-3992.3 |
|
/werft run 👍 started the job as gitpod-build-mads-admin-workspace-search-3992.5 |
|
Currently blocked by #4120 |
Extend search conditions to include instance UUID and workspace ID Fixes #3992
94150c8 to
855d700
Compare
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.
Hey @gtsiolis, can you give me some pointers on how best to fix this UI issue I've introduced?
@mads-hartmann Whoa, somehow I've missed the ping in https://github.com/gitpod-io/gitpod/pull/4111#issuecomment-829999007!🏓
Pasting below how this could look like.
| A | B |
|---|---|
![]() |
![]() |
| @test(timeout(10000)) | ||
| public async testFindAllWorkspaceAndInstances_workspaceId() { | ||
| await this.db.transaction(async db => { | ||
| await Promise.all([ | ||
| db.store(this.ws), | ||
| db.storeInstance(this.wsi1), | ||
| db.store(this.ws2), | ||
| db.storeInstance(this.ws2i1), | ||
| ]); | ||
| const dbResult = await db.findAllWorkspaceAndInstances(0, 10, "workspaceId", "DESC", undefined, this.ws2.id); | ||
| // It should only find one workspace instance | ||
| expect(dbResult.total).to.eq(1); | ||
|
|
||
| // It should find the workspace with the queried id | ||
| const workspaceAndInstance = dbResult.rows[0] | ||
| expect(workspaceAndInstance.workspaceId).to.eq(this.ws2.id) | ||
| }); | ||
| } | ||
|
|
||
| @test(timeout(10000)) | ||
| public async testFindAllWorkspaceAndInstances_instanceId() { | ||
| await this.db.transaction(async db => { | ||
| await Promise.all([ | ||
| db.store(this.ws), | ||
| db.storeInstance(this.wsi1), | ||
| db.storeInstance(this.wsi2), | ||
| db.store(this.ws2), | ||
| db.storeInstance(this.ws2i1), | ||
| ]); | ||
| const dbResult = await db.findAllWorkspaceAndInstances(0, 10, "instanceId", "DESC", undefined, this.wsi1.id); | ||
|
|
||
| // It should only find one workspace instance | ||
| expect(dbResult.total).to.eq(1); | ||
|
|
||
| // It should find the workspace with the queried id | ||
| const workspaceAndInstance = dbResult.rows[0] | ||
| expect(workspaceAndInstance.workspaceId).to.eq(this.ws.id) | ||
|
|
||
| // It should select the workspace instance that was queried, not the most recent one | ||
| expect(workspaceAndInstance.instanceId).to.eq(this.wsi1.id) | ||
| }); | ||
| } |
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.
praise: Haven't tried running these but thanks for adding these tests! 🌟
Co-authored-by: George Tsiolis <[email protected]>
|
@geropl or @corneliusludmann could one of you have a look please :) |
|
/werft run 👍 started the job as gitpod-build-mads-admin-workspace-search-3992.10 |
corneliusludmann
left a comment
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.
Looks good! (one tiny comment inline / not a blocker)
Thanks! 👍
Co-authored-by: Cornelius A. Ludmann <[email protected]>
* Extend workspace admin search Extend search conditions to include instance UUID and workspace ID Fixes gitpod-io#3992 * Update placeholder Co-authored-by: George Tsiolis <[email protected]> * Use title capitalisation for placeholder test Co-authored-by: Cornelius A. Ludmann <[email protected]> Co-authored-by: George Tsiolis <[email protected]> Co-authored-by: Cornelius A. Ludmann <[email protected]>



This extends the admin workspace search so that besides searching for the context url you can for the Workspace ID or Workspace Instance ID.
See issue #3992