Skip to content
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

shareable workspaces pt. 2 #1233

Merged
merged 34 commits into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3f0c914
endpoint to get full workspace config + free
alex-mcgovern Mar 5, 2025
889a8f5
Merge branch 'main' of github.com:stacklok/codegate into endpoint-to-…
alex-mcgovern Mar 6, 2025
f2e2a2c
add `provider_endpoint_type` to muxes table
alex-mcgovern Mar 6, 2025
1bce00b
add `provider_endpoint_name` to muxes table
alex-mcgovern Mar 6, 2025
a96dbb3
allow mux CRUD without knowledge of provider IDs
alex-mcgovern Mar 6, 2025
5719cac
tests & tidy ups
alex-mcgovern Mar 6, 2025
844421a
fix type nit
alex-mcgovern Mar 6, 2025
80a9471
bug fixes and tests
alex-mcgovern Mar 7, 2025
fc40772
update any remaining endpoints referring to providers by name
alex-mcgovern Mar 7, 2025
92a8fa6
Merge branch 'main' of github.com:stacklok/codegate into endpoint-to-…
alex-mcgovern Mar 7, 2025
2184910
fix alembic head conflict
alex-mcgovern Mar 7, 2025
c46ddcb
bug fixes & testing
alex-mcgovern Mar 7, 2025
3919db8
lint fix
alex-mcgovern Mar 7, 2025
6843153
fix integration tests
alex-mcgovern Mar 7, 2025
b5f193a
fix bug where provider name not updated in muxes table after rename
alex-mcgovern Mar 7, 2025
5f405f0
address logger feedback
alex-mcgovern Mar 7, 2025
d533e7f
move `raise ProviderNotFoundError` into crud method
alex-mcgovern Mar 7, 2025
5f894bd
clean up converting API MuxRule to internal representation
alex-mcgovern Mar 7, 2025
ba0a2f6
flatten migrations
alex-mcgovern Mar 7, 2025
c39b8ae
Merge branch 'main' into endpoint-to-get-full-workspace-config
alex-mcgovern Mar 7, 2025
5234e53
fix 500 error when deleting workspace w. no mux rules
alex-mcgovern Mar 10, 2025
4762d04
Merge branch 'main' of github.com:stacklok/codegate into endpoint-to-…
alex-mcgovern Mar 11, 2025
e5e4e77
fix possible inconsistent db state when muxes are deleted
alex-mcgovern Mar 11, 2025
7ff7a57
linter
alex-mcgovern Mar 11, 2025
7a152bc
Merge branches 'endpoint-to-get-full-workspace-config' and 'main' of …
alex-mcgovern Mar 12, 2025
c01216c
address feedback on DB schema changes
alex-mcgovern Mar 12, 2025
0568d67
Merge branch 'main' into endpoint-to-get-full-workspace-config
alex-mcgovern Mar 12, 2025
f215dd2
address unnecessary manual deletions feedback
alex-mcgovern Mar 13, 2025
49440e6
Merge branch 'endpoint-to-get-full-workspace-config' of github.com:st…
alex-mcgovern Mar 13, 2025
6e217c7
Merge branch 'main' into endpoint-to-get-full-workspace-config
alex-mcgovern Mar 13, 2025
5e716fc
tidy ups
alex-mcgovern Mar 14, 2025
122f001
Merge branch 'endpoint-to-get-full-workspace-config' of github.com:st…
alex-mcgovern Mar 14, 2025
614afe5
Merge branch 'main' into endpoint-to-get-full-workspace-config
alex-mcgovern Mar 14, 2025
fa91486
Merge branch 'main' into endpoint-to-get-full-workspace-config
alex-mcgovern Mar 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 98 additions & 115 deletions api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
}
}
},
"/api/v1/provider-endpoints/{provider_id}/models": {
"/api/v1/provider-endpoints/{provider_name}/models": {
"get": {
"tags": [
"CodeGate API",
Expand All @@ -159,13 +159,12 @@
"operationId": "v1_list_models_by_provider",
"parameters": [
{
"name": "provider_id",
"name": "provider_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Provider Id"
"title": "Provider Name"
}
}
],
Expand Down Expand Up @@ -197,24 +196,23 @@
}
}
},
"/api/v1/provider-endpoints/{provider_id}": {
"/api/v1/provider-endpoints/{provider_name}": {
"get": {
"tags": [
"CodeGate API",
"Providers"
],
"summary": "Get Provider Endpoint",
"description": "Get a provider endpoint by ID.",
"description": "Get a provider endpoint by name.",
"operationId": "v1_get_provider_endpoint",
"parameters": [
{
"name": "provider_id",
"name": "provider_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Provider Id"
"title": "Provider Name"
}
}
],
Expand Down Expand Up @@ -247,17 +245,16 @@
"Providers"
],
"summary": "Update Provider Endpoint",
"description": "Update a provider endpoint by ID.",
"description": "Update a provider endpoint by name.",
"operationId": "v1_update_provider_endpoint",
"parameters": [
{
"name": "provider_id",
"name": "provider_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Provider Id"
"title": "Provider Name"
}
}
],
Expand Down Expand Up @@ -300,17 +297,16 @@
"Providers"
],
"summary": "Delete Provider Endpoint",
"description": "Delete a provider endpoint by id.",
"description": "Delete a provider endpoint by name.",
"operationId": "v1_delete_provider_endpoint",
"parameters": [
{
"name": "provider_id",
"name": "provider_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Provider Id"
"title": "Provider Name"
}
}
],
Expand All @@ -336,7 +332,7 @@
}
}
},
"/api/v1/provider-endpoints/{provider_id}/auth-material": {
"/api/v1/provider-endpoints/{provider_name}/auth-material": {
"put": {
"tags": [
"CodeGate API",
Expand All @@ -347,13 +343,12 @@
"operationId": "v1_configure_auth_material",
"parameters": [
{
"name": "provider_id",
"name": "provider_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Provider Id"
"title": "Provider Name"
}
}
],
Expand Down Expand Up @@ -391,8 +386,26 @@
"Workspaces"
],
"summary": "List Workspaces",
"description": "List all workspaces.",
"description": "List all workspaces.\n\nArgs:\n provider_name (Optional[str]): Filter workspaces by provider name. If provided,\n will return workspaces where models from the specified provider (e.g., OpenAI,\n Anthropic) have been used in workspace muxing rules.\n\nReturns:\n ListWorkspacesResponse: A response object containing the list of workspaces.",
"operationId": "v1_list_workspaces",
"parameters": [
{
"name": "provider_name",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Provider Name"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
Expand All @@ -403,6 +416,16 @@
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
},
Expand All @@ -415,14 +438,14 @@
"description": "Create a new workspace.",
"operationId": "v1_create_workspace",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FullWorkspace-Input"
}
}
},
"required": true
}
},
"responses": {
"201": {
Expand Down Expand Up @@ -552,7 +575,7 @@
}
},
"responses": {
"201": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
Expand Down Expand Up @@ -613,6 +636,48 @@
}
}
}
},
"get": {
"tags": [
"CodeGate API",
"Workspaces"
],
"summary": "Get Workspace By Name",
"description": "List workspaces by provider ID.",
"operationId": "v1_get_workspace_by_name",
"parameters": [
{
"name": "workspace_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Workspace Name"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FullWorkspace-Output"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/workspaces/archive": {
Expand Down Expand Up @@ -1195,55 +1260,6 @@
}
}
},
"/api/v1/workspaces/{provider_id}": {
"get": {
"tags": [
"CodeGate API",
"Workspaces"
],
"summary": "List Workspaces By Provider",
"description": "List workspaces by provider ID.",
"operationId": "v1_list_workspaces_by_provider",
"parameters": [
{
"name": "provider_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"title": "Provider Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WorkspaceWithModel"
},
"title": "Response V1 List Workspaces By Provider"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/api/v1/alerts_notification": {
"get": {
"tags": [
Expand Down Expand Up @@ -2136,9 +2152,8 @@
"type": "string",
"title": "Name"
},
"provider_id": {
"type": "string",
"title": "Provider Id"
"provider_type": {
"$ref": "#/components/schemas/ProviderType"
},
"provider_name": {
"type": "string",
Expand All @@ -2148,7 +2163,7 @@
"type": "object",
"required": [
"name",
"provider_id",
"provider_type",
"provider_name"
],
"title": "ModelByProvider",
Expand All @@ -2168,19 +2183,11 @@
"MuxRule": {
"properties": {
"provider_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"type": "string",
"title": "Provider Name"
},
"provider_id": {
"type": "string",
"title": "Provider Id"
"provider_type": {
"$ref": "#/components/schemas/ProviderType"
},
"model": {
"type": "string",
Expand All @@ -2203,7 +2210,8 @@
},
"type": "object",
"required": [
"provider_id",
"provider_name",
"provider_type",
"model",
"matcher_type"
],
Expand Down Expand Up @@ -2565,31 +2573,6 @@
"muxing_rules"
],
"title": "WorkspaceConfig"
},
"WorkspaceWithModel": {
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"name": {
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$",
"title": "Name"
},
"provider_model_name": {
"type": "string",
"title": "Provider Model Name"
}
},
"type": "object",
"required": [
"id",
"name",
"provider_model_name"
],
"title": "WorkspaceWithModel",
"description": "Returns a workspace ID with model name"
}
}
}
Expand Down
Loading