Skip to content

Commit cc6e7a0

Browse files
Clean up repositoryFinderSearch feature flag (#20399)
* Clean up `repositoryFinderSearch`feature flag * Fix `test_getUserRepos_ok` test
1 parent a5d6488 commit cc6e7a0

File tree

4 files changed

+5
-25
lines changed

4 files changed

+5
-25
lines changed

components/dashboard/src/data/featureflag-query.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const featureFlags = {
1919
// Local SSH feature of VS Code Desktop Extension
2020
gitpod_desktop_use_local_ssh_proxy: false,
2121
enabledOrbitalDiscoveries: "",
22-
repositoryFinderSearch: false,
2322
// dummy specified dataops feature, default false
2423
dataops: false,
2524
showBrowserExtensionPromotion: false,

components/dashboard/src/data/git-providers/search-repositories-query.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
import { useQuery } from "@tanstack/react-query";
88
import { useCurrentOrg } from "../organizations/orgs-query";
99
import { useDebounce } from "../../hooks/use-debounce";
10-
import { useFeatureFlag } from "../featureflag-query";
1110
import { scmClient } from "../../service/public-api";
1211

1312
export const useSearchRepositories = ({ searchString, limit }: { searchString: string; limit: number }) => {
1413
// This disables the search behavior when flag is disabled
15-
const repositoryFinderSearchEnabled = useFeatureFlag("repositoryFinderSearch");
1614
const { data: org } = useCurrentOrg();
1715
const debouncedSearchString = useDebounce(searchString);
1816

@@ -26,7 +24,7 @@ export const useSearchRepositories = ({ searchString, limit }: { searchString: s
2624
return repositories;
2725
},
2826
{
29-
enabled: repositoryFinderSearchEnabled && !!org && debouncedSearchString.length >= 3,
27+
enabled: !!org && debouncedSearchString.length >= 3,
3028
// Need this to keep previous results while we wait for a new search to complete since debouncedSearchString changes and updates the key
3129
keepPreviousData: true,
3230
// We intentionally don't want to trigger refetches here to avoid a loading state side effect of focusing

components/server/src/bitbucket-server/bitbucket-server-repository-provider.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ class TestBitbucketServerRepositoryProvider {
147147

148148
@test async test_getUserRepos_ok() {
149149
const result = await this.service.getUserRepos(this.user);
150+
// todo(ft): possibly change to not directly rely on a single returned repository, since the recent repo list for BBS is prone to change
150151
expect(result).to.deep.include({
151-
url: "https://bitbucket.gitpod-dev.com/scm/tes/2k-repos-1076.git",
152-
name: "2k-repos-1076",
152+
url: "https://bitbucket.gitpod-dev.com/scm/~svenefftinge/browser-extension-test.git",
153+
name: "browser-extension-test",
153154
});
154155
}
155156
}

components/server/src/bitbucket-server/bitbucket-server-repository-provider.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import { RepoURL } from "../repohost";
1010
import { RepositoryProvider } from "../repohost/repository-provider";
1111
import { BitbucketServer, BitbucketServerApi } from "./bitbucket-server-api";
1212
import { log } from "@gitpod/gitpod-protocol/lib/util/logging";
13-
import { getExperimentsClientForBackend } from "@gitpod/gitpod-protocol/lib/experiments/configcat-server";
14-
import { getPrimaryEmail } from "@gitpod/public-api-common/lib/user-utils";
1513

1614
@injectable()
1715
export class BitbucketServerRepositoryProvider implements RepositoryProvider {
@@ -132,24 +130,8 @@ export class BitbucketServerRepositoryProvider implements RepositoryProvider {
132130
}
133131

134132
async getUserRepos(user: User): Promise<RepositoryInfo[]> {
135-
const repoSearchEnabled = await getExperimentsClientForBackend().getValueAsync(
136-
"repositoryFinderSearch",
137-
false,
138-
{
139-
user: {
140-
id: user.id,
141-
email: getPrimaryEmail(user),
142-
},
143-
},
144-
);
145-
146133
try {
147-
const repos = repoSearchEnabled
148-
? // Get up to 100 of the most recent repos if repo searching is enabled
149-
await this.api.getRecentRepos(user, { limit: 100 })
150-
: // Otherwise continue to get up to 10k repos
151-
await this.api.getRepos(user, { maxPages: 10, permission: "REPO_READ" });
152-
134+
const repos = await this.api.getRecentRepos(user, { limit: 100 });
153135
const result: RepositoryInfo[] = [];
154136
repos.forEach((r) => {
155137
const cloneUrl = r.links.clone.find((u) => u.name === "http")?.href;

0 commit comments

Comments
 (0)