Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion components/public-api-server/pkg/apiv1/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func convertWorkspaceInfo(input *protocol.WorkspaceInfo) (*v1.Workspace, error)
Context: &v1.WorkspaceContext{
ContextUrl: input.Workspace.ContextURL,
Details: &v1.WorkspaceContext_Git_{Git: &v1.WorkspaceContext_Git{
NormalizedContextUrl: input.Workspace.ContextURL,
NormalizedContextUrl: input.Workspace.Context.NormalizedContextURL,
Comment on lines 325 to +327
Copy link
Member

@jeanp413 jeanp413 Jul 17, 2023

Choose a reason for hiding this comment

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

Does it make sense to expose the raw url in public api in the first place? I thought it's more an internal thing on server side.
I think ContextUrl should be the actual normalized context and if there's more additional metadata it should be part of Details

Copy link
Member

Choose a reason for hiding this comment

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

We discussed this during teaming and I agree: ContextURL seems to be more of a burden than a benefit to have. The normalized one should be the default

Copy link
Member

Choose a reason for hiding this comment

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

The question is why it was modelled like that in first place and with whom we need to discuss it then?

Commit: "",
}},
},
Expand Down
8 changes: 4 additions & 4 deletions components/public-api-server/pkg/apiv1/workspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,9 @@ var workspaceTestData = []workspaceTestDataEntry{
BaseImageNameResolved: "foo:bar",
ID: "gitpodio-gitpod-isq6xj458lj",
OwnerID: "fake-owner-id",
ContextURL: "https://github.com/gitpod-io/gitpod",
ContextURL: "open-prebuild/126ac54a-5922-4a45-9a18-670b057bf540/https://github.com/gitpod-io/gitpod/pull/18291",
Context: &protocol.WorkspaceContext{
NormalizedContextURL: "https://github.com/gitpod-io/protocol.git",
NormalizedContextURL: "https://github.com/gitpod-io/gitpod/pull/18291",
Title: "tes ttitle",
Repository: &protocol.Repository{
Host: "github.com",
Expand Down Expand Up @@ -659,10 +659,10 @@ var workspaceTestData = []workspaceTestDataEntry{
WorkspaceId: "gitpodio-gitpod-isq6xj458lj",
OwnerId: "fake-owner-id",
Context: &v1.WorkspaceContext{
ContextUrl: "https://github.com/gitpod-io/gitpod",
ContextUrl: "open-prebuild/126ac54a-5922-4a45-9a18-670b057bf540/https://github.com/gitpod-io/gitpod/pull/18291",
Details: &v1.WorkspaceContext_Git_{
Git: &v1.WorkspaceContext_Git{
NormalizedContextUrl: "https://github.com/gitpod-io/gitpod",
NormalizedContextUrl: "https://github.com/gitpod-io/gitpod/pull/18291",
},
},
},
Expand Down