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

Conversation

alex-mcgovern
Copy link
Contributor

@alex-mcgovern alex-mcgovern commented Mar 5, 2025

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

@alex-mcgovern alex-mcgovern changed the title endpoint to get full workspace config + free endpoint to get full workspace config Mar 5, 2025
@alex-mcgovern alex-mcgovern changed the title endpoint to get full workspace config shareable workspaces pt. 2 Mar 7, 2025
@alex-mcgovern alex-mcgovern marked this pull request as ready for review March 7, 2025 10:38
Copy link
Contributor

@JAORMX JAORMX left a comment

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

Copy link
Contributor

@lukehinds lukehinds left a comment

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?

@alex-mcgovern
Copy link
Contributor Author

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"™️

@alex-mcgovern alex-mcgovern merged commit 278ba4e into main Mar 17, 2025
11 checks passed
@alex-mcgovern alex-mcgovern deleted the endpoint-to-get-full-workspace-config branch March 17, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants