Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

shareable workspaces pt. 2 - #1233

Merged
lxmcgvrn merged 34 commits into
mainfrom
endpoint-to-get-full-workspace-config
Mar 17, 2025
Merged

shareable workspaces pt. 2#1233
lxmcgvrn merged 34 commits into
mainfrom
endpoint-to-get-full-workspace-config

Conversation

@lxmcgvrn

@lxmcgvrnlxmcgvrn commented Mar 5, 2025

Copy link
Copy Markdown
Contributor

Second part of #1067 — this adds a new endpoint GET /api/v1/workspaces/:workspace_name that returns a full workspace config.

With this we have the prerequisites for a upload/download flow on a per-workspace basis.

These changes are integrated into the frontend in this PR: stacklok/codegate-ui#379

  • adds provider_endpoint_name and provider_endpoint_type to the muxes table
  • changes MuxRule model used by the API to include provider_type and
    provider_name and removes provider_id
  • creates a new MuxRuleWithProviderId model used internally for transporting
    mux rules
  • all endpoints that interact with provider endpoints have been updated so that
    they don't require knowledge of the provider ID
  • GET /api/v1/workspaces/:provider_id was already in use for listing providers in use by a workspace, but after speaking with @JAORMX we decided to move this elsewhere. You can achieve the same thing with GET /api/v1/workspaces?provider_name={ID} now instead
  • there are a number of other breaking changes impacting the UI, but these are
    dealt with in a separate PR

@lxmcgvrnlxmcgvrn changed the title endpoint to get full workspace config + freeendpoint to get full workspace configMar 5, 2025
@lxmcgvrnlxmcgvrn changed the title endpoint to get full workspace configshareable workspaces pt. 2Mar 7, 2025
@lxmcgvrn
lxmcgvrn marked this pull request as ready for review March 7, 2025 10:38
Comment threadmigrations/versions/2025_03_07_0902-1ee1be2156f7_.py Outdated
Comment threadsrc/codegate/api/v1.py Outdated
Comment threadsrc/codegate/api/v1.py Outdated
Comment threadsrc/codegate/api/v1.py Outdated
Comment threadsrc/codegate/api/v1.py Outdated
Comment threadsrc/codegate/db/connection.py Outdated

@JAORMXJAORMX left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main thing is the db schema changes

Comment threadsrc/codegate/workspaces/crud.py Outdated
Comment threadsrc/codegate/db/connection.py Outdated
Comment threadsrc/codegate/db/connection.py Outdated

@lukehindslukehinds left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall lgtm , do we need a db migration for the changes to db/models?

@lxmcgvrn

Copy link
Copy Markdown
ContributorAuthor

Overall lgtm , do we need a db migration for the changes to db/models?

There were DB schema changes in a previous iteration, but we decided they were unnecessary, the only change to a DB model is this one:

class ProviderModel(BaseModel):
provider_endpoint_id: str
+ provider_endpoint_type: str
provider_endpoint_name: Optional[str] = None
name: str

Which is populated via a JOIN — it's not the cleanest, but "it works"™️

@lxmcgvrn
lxmcgvrn merged commit 278ba4e into mainMar 17, 2025
@lxmcgvrn
lxmcgvrn deleted the endpoint-to-get-full-workspace-config branch March 17, 2025 13:20
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@lxmcgvrn@JAORMX@lukehinds@aponcedeleonch