From 5cbad2afe4939e9200b2ff7c3c3610b80ce232f7 Mon Sep 17 00:00:00 2001 From: Mikhail Atuchin Date: Wed, 23 Oct 2024 15:33:38 +0400 Subject: [PATCH 1/3] Drop STAGING support --- src/core/base_types.ts | 1 - src/core/url_utils.ts | 4 +--- src/web/app/app.tsx | 4 ---- src/web/app/seed_loader.ts | 3 --- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/core/base_types.ts b/src/core/base_types.ts index 8a1b74ee..0c2586e7 100644 --- a/src/core/base_types.ts +++ b/src/core/base_types.ts @@ -5,7 +5,6 @@ export enum SeedType { MAIN, // main Brave seed (brave-variations@main) - STAGING, // staging Brave seed (brave-variations@staging) UPSTREAM, // Chrome seed (Finch) } diff --git a/src/core/url_utils.ts b/src/core/url_utils.ts index 727bd9c8..69b5ab25 100644 --- a/src/core/url_utils.ts +++ b/src/core/url_utils.ts @@ -6,7 +6,6 @@ import { SeedType } from './base_types'; export const variationsMainUrl = 'https://variations.brave.com/seed'; -export const variationsStagingUrl = 'https://variations.bravesoftware.com/seed'; export const variationsUpstreamUrl = 'https://griffin.brave.com/finch-data-private/seed.bin'; @@ -50,10 +49,9 @@ export function getStudyRawConfigUrl( const BRAVE_VARIATIONS_REPO_PATTERN = '^github\\.com/brave/brave-variations$'; if (seedType === SeedType.UPSTREAM) return `${getGitHubStorageUrl()}/blob/main/study/all-by-name/${study}`; - const branch = seedType === SeedType.MAIN ? 'main' : 'staging'; return makeSourceGraphUrl( `"name": "${study}"`, - `${BRAVE_VARIATIONS_REPO_PATTERN}@${branch}`, + `${BRAVE_VARIATIONS_REPO_PATTERN}@$main`, 'seed/seed.json', ); } diff --git a/src/web/app/app.tsx b/src/web/app/app.tsx index 1ade38fb..b310b520 100644 --- a/src/web/app/app.tsx +++ b/src/web/app/app.tsx @@ -424,10 +424,6 @@ export function App() { type={SeedType.MAIN} searchParamManager={searchParamManager} /> - {hasUpstream && ( { From c9421ea1d6fb040698567784d3c343e8c273ee3d Mon Sep 17 00:00:00 2001 From: Mikhail Atuchin Date: Wed, 23 Oct 2024 16:11:23 +0400 Subject: [PATCH 2/3] update URL for brave studies --- src/core/url_utils.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core/url_utils.ts b/src/core/url_utils.ts index 69b5ab25..d66cbd8a 100644 --- a/src/core/url_utils.ts +++ b/src/core/url_utils.ts @@ -46,14 +46,12 @@ export function getStudyRawConfigUrl( study: string, seedType: SeedType, ): string { - const BRAVE_VARIATIONS_REPO_PATTERN = '^github\\.com/brave/brave-variations$'; if (seedType === SeedType.UPSTREAM) return `${getGitHubStorageUrl()}/blob/main/study/all-by-name/${study}`; - return makeSourceGraphUrl( - `"name": "${study}"`, - `${BRAVE_VARIATIONS_REPO_PATTERN}@$main`, - 'seed/seed.json', - ); + return 'https://github.com/search?type=code' + + '&q=repo%3Abrave%2Fbrave-variations' + + '+path%3A%2F%5Eseed%5C%2Fseed.json%7C%5Estudies%5C%2F*.json5%2F+' + + `"%5C"name%5C"%3A+%5C"${encodeURIComponent(study)}%5C""`; } // Returns a link to see the study config at griffin.brave.com. From 441d8e8370cd3de238a960458e9a56b69e96f683 Mon Sep 17 00:00:00 2001 From: Mikhail Atuchin Date: Wed, 23 Oct 2024 16:50:03 +0400 Subject: [PATCH 3/3] Fix format --- src/core/url_utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/url_utils.ts b/src/core/url_utils.ts index d66cbd8a..101c1775 100644 --- a/src/core/url_utils.ts +++ b/src/core/url_utils.ts @@ -48,10 +48,12 @@ export function getStudyRawConfigUrl( ): string { if (seedType === SeedType.UPSTREAM) return `${getGitHubStorageUrl()}/blob/main/study/all-by-name/${study}`; - return 'https://github.com/search?type=code' + + return ( + 'https://github.com/search?type=code' + '&q=repo%3Abrave%2Fbrave-variations' + '+path%3A%2F%5Eseed%5C%2Fseed.json%7C%5Estudies%5C%2F*.json5%2F+' + - `"%5C"name%5C"%3A+%5C"${encodeURIComponent(study)}%5C""`; + `"%5C"name%5C"%3A+%5C"${encodeURIComponent(study)}%5C""` + ); } // Returns a link to see the study config at griffin.brave.com.