Skip to content

Conversation

@mads-hartmann
Copy link
Contributor

@mads-hartmann mads-hartmann commented Apr 29, 2021

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

@mads-hartmann mads-hartmann force-pushed the mads/admin-workspace-search-3992 branch from f1fb044 to f35e5d1 Compare April 29, 2021 13:06
@mads-hartmann
Copy link
Contributor Author

mads-hartmann commented Apr 30, 2021

/werft run

👍 started the job as gitpod-build-mads-admin-workspace-search-3992.3

@mads-hartmann
Copy link
Contributor Author

mads-hartmann commented Apr 30, 2021

/werft run

👍 started the job as gitpod-build-mads-admin-workspace-search-3992.5

@mads-hartmann
Copy link
Contributor Author

mads-hartmann commented Apr 30, 2021

Hey @gtsiolis, can you give me some pointers on how best to fix this UI issue I've introduced? ☺️ Direct link to preview page here

Screenshot 2021-04-30 at 12 22 51

@mads-hartmann
Copy link
Contributor Author

Currently blocked by #4120

Extend search conditions to include instance UUID and workspace ID

Fixes #3992
@mads-hartmann mads-hartmann force-pushed the mads/admin-workspace-search-3992 branch from 94150c8 to 855d700 Compare May 28, 2021 12:25
Copy link
Contributor

@gtsiolis gtsiolis left a 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
placeholder-1 placeholder-2

Comment on lines +305 to +346
@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)
});
}
Copy link
Contributor

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]>
@mads-hartmann
Copy link
Contributor Author

@geropl or @corneliusludmann could one of you have a look please :)

@corneliusludmann
Copy link
Contributor

corneliusludmann commented Jun 8, 2021

/werft run

👍 started the job as gitpod-build-mads-admin-workspace-search-3992.10

Copy link
Contributor

@corneliusludmann corneliusludmann left a 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! 👍

@corneliusludmann corneliusludmann removed the request for review from geropl June 8, 2021 12:58
@mads-hartmann mads-hartmann merged commit 169fd4b into main Jun 9, 2021
@mads-hartmann mads-hartmann deleted the mads/admin-workspace-search-3992 branch June 9, 2021 07:48
MatthewFagan pushed a commit to trilogy-group/gitpod that referenced this pull request Nov 23, 2021
* 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]>
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.

5 participants