Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

test(e2e): cover the organization's issues, and record phase 3's routes in the coverage gate

Petr Baucha11855f9dea2
diff --git a/console/tooling-e2e/src/clients/switch-client.ts b/console/tooling-e2e/src/clients/switch-client.ts
index ebf530fa9..97d515e66 100644
--- a/console/tooling-e2e/src/clients/switch-client.ts
+++ b/console/tooling-e2e/src/clients/switch-client.ts
@@ -511,6 +511,13 @@ export class SwitchClient {
return this.gateway("GET", "/organizations/current/audit-events");
}
+ /** `GET /gateway/organizations/current/issues` — what the organization's admins have left to fix; organization admin only. */
+ async organizationIssues(): Promise<
+ { kind: string; workspace_id: string | null; workspace_name: string | null; agents: string[] }[]
+ > {
+ return this.gateway("GET", "/organizations/current/issues");
+ }
+
/** `GET /gateway/organizations/current` — the current workspace's organization and the caller's role there. */
async currentOrganization(): Promise<{
id: string;
diff --git a/console/tooling-e2e/src/fast/organizations.ts b/console/tooling-e2e/src/fast/organizations.ts
index 0ca481826..23821165d 100644
--- a/console/tooling-e2e/src/fast/organizations.ts
+++ b/console/tooling-e2e/src/fast/organizations.ts
@@ -6,7 +6,8 @@ import type { FastScenario } from './scenario.ts';
* Anyone signed in creates an organization, and its admin adds workspaces to
* it: a new user, in the default workspace, creates an organization and lands
* in its first workspace, adds a second, and sees both, in an organization
- * listed beside those they were already in. A plain member of the default
+ * listed beside those they were already in, with nothing left for its admin
+ * to fix. A plain member of the default
* workspace may not add one there.
*
* Users and workspaces cannot be deleted, so this runs only on a stack thrown
@@ -19,6 +20,7 @@ export const organizations: FastScenario = {
'GET /gateway/organizations',
'POST /gateway/organizations',
'GET /gateway/organizations/current',
+ 'GET /gateway/organizations/current/issues',
'GET /gateway/organizations/current/workspaces',
'POST /gateway/organizations/current/workspaces',
],
@@ -80,6 +82,8 @@ export const organizations: FastScenario = {
expect(workspaces.map((row) => row.id).sort()).toEqual([workspace.id, second.id].sort());
expect(workspaces.map((row) => row.id)).not.toContain(defaultWorkspace);
+ expect(await founder.organizationIssues(), 'nothing to fix in a new organization').toEqual([]);
+
const listed = await founder.organizations();
expect(listed.find((row) => row.id === organization.id)?.role).toBe('org_admin');
expect(listed.map((row) => row.id).sort(), 'the new one beside the rest').toEqual(
diff --git a/console/tooling-e2e/surface/exemptions.json b/console/tooling-e2e/surface/exemptions.json
index d8d7dcea1..96b4254aa 100644
--- a/console/tooling-e2e/surface/exemptions.json
+++ b/console/tooling-e2e/surface/exemptions.json
@@ -7,6 +7,8 @@
"DELETE /gateway/workspace/services/{service}": "A workspace admin dropping their own service switch to take their organization's setting; it matters only with organization_connector_apps on, which no stack the harness builds turns on (the rest of /gateway/workspace/services is still in the backlog). Covered by core's test_workspace_services.py against real Postgres.",
"GET /gateway/auth/oidc/callback": "Needs a live OIDC identity provider; the harness signs in with a password.",
"GET /gateway/auth/oidc/login": "Needs a live OIDC identity provider; the harness signs in with a password.",
+ "GET /gateway/auth/workos/callback": "Signs an organization admin in to their linked organization's WorkOS account, which needs a WorkOS environment, an AuthKit application and a browser round trip; no stack the harness builds has one. Covered by core's test_workos_sign_in_routes.py against real Postgres with WorkOS answered in process.",
+ "GET /gateway/auth/workos/organization": "Signs an organization admin in to their linked organization's WorkOS account, which needs a WorkOS environment, an AuthKit application and a browser round trip; no stack the harness builds has one. Covered by core's test_workos_sign_in_routes.py against real Postgres with WorkOS answered in process.",
"GET /gateway/chats/archived": "Switch Console archived chats. Covered by core's test_chats_routes.py against real Postgres; no scenario drives Console chats yet (every other /gateway/chats route is still in the backlog).",
"GET /gateway/chats/agent-candidates": "Switch Console group chats. Covered by core's test_chats_groups.py against real Postgres; no scenario drives Console chats yet (every other /gateway/chats route is still in the backlog), and the stacks the harness builds do not turn on the group_chats flag these routes need.",
"GET /gateway/chats/{room_id}/commands": "The commands the chat composer offers on `!`. Covered by core's test_chats_controls.py against real Postgres; no scenario drives Console chats yet, and the stacks the harness builds do not turn on the group_chats flag.",
diff --git a/console/tooling-e2e/surface/server-surface.json b/console/tooling-e2e/surface/server-surface.json
index 16522d0fc..d479907f5 100644
--- a/console/tooling-e2e/surface/server-surface.json
+++ b/console/tooling-e2e/surface/server-surface.json
@@ -390,6 +390,16 @@
"auth": "session",
"flags": []
},
+ {
+ "route": "GET /gateway/auth/workos/callback",
+ "auth": "session",
+ "flags": []
+ },
+ {
+ "route": "GET /gateway/auth/workos/organization",
+ "auth": "session",
+ "flags": []
+ },
{
"route": "GET /gateway/chats",
"auth": "session",
@@ -660,6 +670,11 @@
"service_connections"
]
},
+ {
+ "route": "GET /gateway/organizations/current/issues",
+ "auth": "session",
+ "flags": []
+ },
{
"route": "GET /gateway/organizations/current/members",
"auth": "session",