Skip to content

Commit ce91674

Browse files
committed
Fix
1 parent a718613 commit ce91674

File tree

10 files changed

+4
-115
lines changed

10 files changed

+4
-115
lines changed

components/dashboard/BUILD.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ packages:
1717
- scripts/run-integration-tests.sh
1818
deps:
1919
- components/gitpod-protocol:lib
20-
- components/public-api/typescript:lib
2120
config:
2221
commands:
2322
build: ["yarn", "build"]

components/dashboard/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"version": "0.0.0",
55
"private": true,
66
"dependencies": {
7-
"@bufbuild/connect-web": "^0.2.1",
87
"@gitpod/gitpod-protocol": "0.1.5",
9-
"@gitpod/public-api": "0.1.5",
108
"@stripe/react-stripe-js": "^1.7.2",
119
"@stripe/stripe-js": "^1.29.0",
1210
"configcat-js": "^6.0.0",

components/dashboard/src/App.tsx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import gitpodIcon from "./icons/gitpod.svg";
1818
import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error";
1919
import { useHistory } from "react-router-dom";
2020
import { trackButtonOrAnchor, trackPathChange, trackLocation } from "./Analytics";
21-
import { ContextURL, User, Team } from "@gitpod/gitpod-protocol";
21+
import { ContextURL, User } from "@gitpod/gitpod-protocol";
2222
import * as GitpodCookie from "@gitpod/gitpod-protocol/lib/util/gitpod-cookie";
2323
import { Experiment } from "./experiments";
2424
import { workspacesPathMain } from "./workspaces/workspaces.routes";
@@ -52,9 +52,6 @@ import { isGitpodIo, isLocalPreview } from "./utils";
5252
import Alert from "./components/Alert";
5353
import { BlockedRepositories } from "./admin/BlockedRepositories";
5454
import { AppNotifications } from "./AppNotifications";
55-
import { Team as PublicApiTeam } from "@gitpod/public-api/lib/gitpod/experimental/v1/teams_pb";
56-
import { getExperimentsClient } from "./experiments/client";
57-
import { teamsService } from "./service/public-api";
5855

5956
const Setup = React.lazy(() => import(/* webpackPrefetch: true */ "./Setup"));
6057
const Workspaces = React.lazy(() => import(/* webpackPrefetch: true */ "./workspaces/Workspaces"));
@@ -168,29 +165,7 @@ function App() {
168165
(async () => {
169166
var user: User | undefined;
170167
try {
171-
let teamsPromise: Promise<Team[]>;
172-
const isExperimentalTeamsServiceEnabled = await getExperimentsClient().getValueAsync(
173-
"publicApiExperimentalTeamsService",
174-
false,
175-
{
176-
user,
177-
},
178-
);
179-
if (isExperimentalTeamsServiceEnabled) {
180-
teamsPromise = teamsService.listTeams({}).then((response) => {
181-
return response.teams.map((team) => {
182-
const t: Team = {
183-
id: team.id,
184-
name: team.name,
185-
slug: team.slug,
186-
creationTime: "",
187-
};
188-
return t;
189-
});
190-
});
191-
} else {
192-
teamsPromise = getGitpodService().server.getTeams();
193-
}
168+
const teamsPromise = getGitpodService().server.getTeams();
194169

195170
user = await getGitpodService().server.getLoggedInUser();
196171
setUser(user);

components/dashboard/src/projects/NewProject.tsx

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import { trackEvent } from "../Analytics";
2121
import exclamation from "../images/exclamation.svg";
2222
import ErrorMessage from "../components/ErrorMessage";
2323
import Spinner from "../icons/Spinner.svg";
24-
import { teamsService } from "../service/public-api";
25-
import { getExperimentsClient } from "../experiments/client";
2624

2725
export default function NewProject() {
2826
const location = useLocation();
@@ -723,7 +721,6 @@ function GitProviders(props: {
723721

724722
function NewTeam(props: { onSuccess: (team: Team) => void }) {
725723
const { setTeams } = useContext(TeamsContext);
726-
const { user } = useContext(UserContext);
727724

728725
const [teamName, setTeamName] = useState<string | undefined>();
729726
const [error, setError] = useState<string | undefined>();
@@ -732,37 +729,6 @@ function NewTeam(props: { onSuccess: (team: Team) => void }) {
732729
if (!teamName) {
733730
return;
734731
}
735-
736-
const isExperimentalTeamsServiceEnabled = await getExperimentsClient().getValueAsync(
737-
"publicApiExperimentalTeamsService",
738-
false,
739-
{
740-
user,
741-
},
742-
);
743-
if (isExperimentalTeamsServiceEnabled) {
744-
try {
745-
const response = await teamsService.createTeam({
746-
name: teamName,
747-
});
748-
const team = response.team;
749-
setTeams(await getGitpodService().server.getTeams());
750-
751-
const mappedTeam: Team = {
752-
id: team?.id || "",
753-
name: team?.name || "",
754-
slug: team?.slug || "",
755-
creationTime: "",
756-
};
757-
props.onSuccess(mappedTeam);
758-
return;
759-
} catch (error) {
760-
console.error(error);
761-
setError(error?.message || "Failed to create new team!");
762-
return;
763-
}
764-
}
765-
766732
try {
767733
const team = await getGitpodService().server.createTeam(teamName);
768734
setTeams(await getGitpodService().server.getTeams());

components/dashboard/src/teams/Members.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import { getGitpodService } from "../service/service";
1818
import { UserContext } from "../user-context";
1919
import { TeamsContext, getCurrentTeam } from "./teams-context";
2020
import { trackEvent } from "../Analytics";
21-
import { teamsService } from "../service/public-api";
22-
import { getExperimentsClient } from "../experiments/client";
2321

2422
export default function () {
2523
const { user } = useContext(UserContext);

components/dashboard/src/teams/NewTeam.tsx

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,15 @@ import { FormEvent, useContext, useEffect, useState } from "react";
88
import { useHistory } from "react-router-dom";
99
import { getGitpodService } from "../service/service";
1010
import { TeamsContext } from "./teams-context";
11-
import { teamsService } from "../service/public-api";
12-
import { getExperimentsClient } from "../experiments/client";
13-
import { UserContext } from "../user-context";
1411

1512
export default function () {
1613
const { setTeams } = useContext(TeamsContext);
17-
const { user } = useContext(UserContext);
1814
const history = useHistory();
1915

2016
const [creationError, setCreationError] = useState<Error>();
2117
let name = "";
2218
const createTeam = async (event: FormEvent) => {
2319
event.preventDefault();
24-
const isExperimentalTeamsServiceEnabled = await getExperimentsClient().getValueAsync(
25-
"publicApiExperimentalTeamsService",
26-
false,
27-
{
28-
user,
29-
},
30-
);
31-
if (isExperimentalTeamsServiceEnabled) {
32-
try {
33-
const response = await teamsService.createTeam({ name });
34-
const team = response.team;
35-
setTeams(await getGitpodService().server.getTeams());
36-
37-
history.push(`/t/${team!.slug}`);
38-
return;
39-
} catch (error) {
40-
console.error(error);
41-
setCreationError(error);
42-
return;
43-
}
44-
}
45-
4620
try {
4721
const team = await getGitpodService().server.createTeam(name);
4822
const teams = await getGitpodService().server.getTeams();

components/public-api-server/go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ require (
1111
github.com/gitpod-io/gitpod/usage-api v0.0.0-00010101000000-000000000000
1212
github.com/golang/mock v1.6.0
1313
github.com/google/go-cmp v0.5.9
14-
github.com/google/uuid v1.1.2
1514
github.com/gorilla/handlers v1.5.1
1615
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
17-
github.com/hashicorp/golang-lru v0.5.4
1816
github.com/prometheus/client_golang v1.13.0
1917
github.com/relvacode/iso8601 v1.1.0
2018
github.com/sirupsen/logrus v1.8.1
@@ -35,6 +33,7 @@ require (
3533
github.com/golang/protobuf v1.5.2 // indirect
3634
github.com/gorilla/websocket v1.5.0 // indirect
3735
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
36+
github.com/hashicorp/golang-lru v0.5.4 // indirect
3837
github.com/heptiolabs/healthcheck v0.0.0-20211123025425-613501dd5deb // indirect
3938
github.com/inconshreveable/mousetrap v1.0.0 // indirect
4039
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect

components/public-api-server/go.sum

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/public-api-server/pkg/proxy/errors.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ func ConvertError(err error) error {
1717

1818
s := err.Error()
1919

20-
// components/gitpod-protocol/src/messaging/error.ts
21-
if strings.Contains(s, "code 400") {
22-
return connect.NewError(connect.CodeInvalidArgument, err)
23-
}
24-
25-
// components/gitpod-protocol/src/messaging/error.ts
2620
if strings.Contains(s, "code 401") {
2721
return connect.NewError(connect.CodePermissionDenied, err)
2822
}
@@ -37,11 +31,6 @@ func ConvertError(err error) error {
3731
return connect.NewError(connect.CodeNotFound, err)
3832
}
3933

40-
// components/gitpod-protocol/src/messaging/error.ts
41-
if strings.Contains(s, "code 409") {
42-
return connect.NewError(connect.CodeAlreadyExists, err)
43-
}
44-
4534
// components/gitpod-messagebus/src/jsonrpc-server.ts#47
4635
if strings.Contains(s, "code -32603") {
4736
return connect.NewError(connect.CodeInternal, err)

components/public-api-server/pkg/proxy/errors_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ func TestConvertError(t *testing.T) {
2626
WebsocketError: errors.New("jsonrpc2: code -32603 message: Request getWorkspace failed with message: No workspace with id 'some-id' found."),
2727
ExpectedStatus: connect.CodeInternal,
2828
},
29-
{
30-
WebsocketError: errors.New("code 400"),
31-
ExpectedStatus: connect.CodeInvalidArgument,
32-
},
33-
{
34-
WebsocketError: errors.New("code 409"),
35-
ExpectedStatus: connect.CodeAlreadyExists,
36-
},
3729
}
3830

3931
for _, s := range scenarios {

0 commit comments

Comments
 (0)