From 1acc09943904d636fa7caa54776033fc5315b2e1 Mon Sep 17 00:00:00 2001 From: Aleksei Khoroshilov <5928869+goodov@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:11:11 +0700 Subject: [PATCH] Migrate to per-study file structure. --- .github/CODEOWNERS | 12 +- .github/workflows/generate-test-seed.yml | 14 +-- .github/workflows/test-src.yml | 11 ++ README.md | 26 ++-- src/README.md | 10 +- src/scripts/lint.ts | 3 +- studies/AllowCertainClientHintsStudy.json5 | 34 +++++ studies/BraveAIChatEnabledStudy.json5 | 31 +++++ ...eAdblockExperimentalListDefaultStudy.json5 | 33 +++++ ...dblockMobileNotificationsListDefault.json5 | 33 +++++ ...iveAdModelBasedPredictorRecencyStudy.json5 | 43 +++++++ studies/BraveAdsAdEventStudy.json5 | 44 +++++++ studies/BraveAdsConversionsStudy.json5 | 40 ++++++ studies/BraveAdsExclusionRulesStudy.json5 | 40 ++++++ studies/BraveAdsNewTabPageAdsStudy.json5 | 40 ++++++ studies/BraveAdsSiteVisitStudy.json5 | 44 +++++++ ...ClassificationPageProbabilitiesStudy.json5 | 40 ++++++ ...veAggressiveModeRetirementExperiment.json5 | 34 +++++ studies/BraveAutoTranslateStudy.json5 | 34 +++++ ...leanupSessionCookiesOnSessionRestore.json5 | 27 ++++ studies/BraveDebounceStudy.json5 | 43 +++++++ studies/BraveFallbackDoHStudy.json5 | 37 ++++++ studies/BraveFeedUpdateStudy.json5 | 30 +++++ studies/BraveForgetFirstPartyStorage.json5 | 119 ++++++++++++++++++ .../BraveGoogleSignInPermissionStudy.json5 | 81 ++++++++++++ ...raveHorizontalTabsUpdateEnabledStudy.json5 | 55 ++++++++ .../BraveLocalhostAccessPermissionStudy.json5 | 32 +++++ studies/BraveP3AConstellationEnabled.json5 | 33 +++++ studies/BraveP3AJSONOtherDeprecation.json5 | 32 +++++ studies/BraveP3ANebulaNightlyBeta.json5 | 33 +++++ studies/BraveP3ANebulaRelease.json5 | 32 +++++ ...raveP3ATypicalJSONDeprecationEnabled.json5 | 33 +++++ studies/BraveRequestOTRTabRolloutStudy.json5 | 31 +++++ ...ewardsAllowSelfCustodyProvidersStudy.json5 | 29 +++++ studies/BraveRewardsWebUiPanelStudy.json5 | 33 +++++ studies/BraveRoundTimeStampsStudy.json5 | 35 ++++++ ...raveScreenFingerprintingBlockerStudy.json5 | 89 +++++++++++++ studies/BraveSearchAdStudy.json5 | 67 ++++++++++ studies/BraveSearchPromotionBannerStudy.json5 | 77 ++++++++++++ ...veSearchPromotionBannerStudyOnStable.json5 | 79 ++++++++++++ studies/BraveTranslateStudy.json5 | 36 ++++++ studies/BraveWalletAnkrBalancesEnabled.json5 | 33 +++++ studies/BraveWebViewRoundedCornersStudy.json5 | 27 ++++ ...bcompatExceptionsServiceReleaseStudy.json5 | 32 +++++ ...BraveWebcompatExceptionsServiceStudy.json5 | 33 +++++ studies/CanvasKillSwitches.json5 | 31 +++++ studies/ClampPlatformVersionClientHint.json5 | 30 +++++ studies/CloseWatcher.json5 | 31 +++++ ...ollectWebGPUSupportMetricsKillSwitch.json5 | 28 +++++ studies/CookieListDefaultStudy.json5 | 33 +++++ .../CosmeticFilteringChildFramesStudy.json5 | 33 +++++ studies/CrossPlatformVPNStudy.json5 | 34 +++++ studies/Default1pBlockingStudy.json5 | 81 ++++++++++++ studies/DefaultBraveCommandsStudy.json5 | 31 +++++ .../DefaultBraveOmniboxMoreHistoryStudy.json5 | 30 +++++ ...efaultPassthroughCommandDecoderStudy.json5 | 31 +++++ studies/DefaultPlaylistStudy.json5 | 30 +++++ .../DisableCnameUncloakingForAndroid.json5 | 30 +++++ studies/DisableReduceLanguage.json5 | 38 ++++++ studies/EphemeralStorageStudy.json5 | 81 ++++++++++++ studies/ExtensionsManifestV2Study.json5 | 32 +++++ .../ExtensionsManifestV2StudyRelease.json5 | 31 +++++ studies/HangWatcher.json5 | 57 +++++++++ studies/HeapProfilingMacKillSwitch.json5 | 28 +++++ studies/InnerHTMLParserFastpathStudy.json5 | 34 +++++ studies/MacCoreLocationBackendStudy.json5 | 40 ++++++ studies/MetricsAndCrashSampling.json5 | 30 +++++ studies/ModuleFileNamePatchStudy.json5 | 30 +++++ studies/ModuleFileNamePatchStudyRelease.json5 | 29 +++++ ...eadingOptimizationsCompatOldVersions.json5 | 31 +++++ studies/NewiOSPlaylistUIStudy.json5 | 29 +++++ studies/PartitionedCookies.json5 | 34 +++++ .../PostFREFixMetricsAndCrashSampling.json5 | 30 +++++ studies/PrettyPrintJSONDocument.json5 | 31 +++++ studies/PrivateNetworkAccessKillswitch.json5 | 32 +++++ .../RendererAllocatesImagesKillSwitch.json5 | 28 +++++ studies/SidebarEnabledStudy.json5 | 43 +++++++ studies/SmilAutoSuspendOnLagKillSwitch.json5 | 31 +++++ studies/Speedreader TTS.json5 | 37 ++++++ studies/UndecryptablePasswords.json5 | 33 +++++ studies/UseWritePixelsYUV.json5 | 31 +++++ studies/UserActivityStudy.json5 | 51 ++++++++ studies/WhatsNewStudy.json5 | 32 +++++ studies/WorkaroundNewWindowFlash.json5 | 75 +++++++++++ 84 files changed, 3152 insertions(+), 33 deletions(-) create mode 100644 studies/AllowCertainClientHintsStudy.json5 create mode 100644 studies/BraveAIChatEnabledStudy.json5 create mode 100644 studies/BraveAdblockExperimentalListDefaultStudy.json5 create mode 100644 studies/BraveAdblockMobileNotificationsListDefault.json5 create mode 100644 studies/BraveAds.CreativeAdModelBasedPredictorRecencyStudy.json5 create mode 100644 studies/BraveAdsAdEventStudy.json5 create mode 100644 studies/BraveAdsConversionsStudy.json5 create mode 100644 studies/BraveAdsExclusionRulesStudy.json5 create mode 100644 studies/BraveAdsNewTabPageAdsStudy.json5 create mode 100644 studies/BraveAdsSiteVisitStudy.json5 create mode 100644 studies/BraveAdsTextClassificationPageProbabilitiesStudy.json5 create mode 100644 studies/BraveAggressiveModeRetirementExperiment.json5 create mode 100644 studies/BraveAutoTranslateStudy.json5 create mode 100644 studies/BraveCleanupSessionCookiesOnSessionRestore.json5 create mode 100644 studies/BraveDebounceStudy.json5 create mode 100644 studies/BraveFallbackDoHStudy.json5 create mode 100644 studies/BraveFeedUpdateStudy.json5 create mode 100644 studies/BraveForgetFirstPartyStorage.json5 create mode 100644 studies/BraveGoogleSignInPermissionStudy.json5 create mode 100644 studies/BraveHorizontalTabsUpdateEnabledStudy.json5 create mode 100644 studies/BraveLocalhostAccessPermissionStudy.json5 create mode 100644 studies/BraveP3AConstellationEnabled.json5 create mode 100644 studies/BraveP3AJSONOtherDeprecation.json5 create mode 100644 studies/BraveP3ANebulaNightlyBeta.json5 create mode 100644 studies/BraveP3ANebulaRelease.json5 create mode 100644 studies/BraveP3ATypicalJSONDeprecationEnabled.json5 create mode 100644 studies/BraveRequestOTRTabRolloutStudy.json5 create mode 100644 studies/BraveRewardsAllowSelfCustodyProvidersStudy.json5 create mode 100644 studies/BraveRewardsWebUiPanelStudy.json5 create mode 100644 studies/BraveRoundTimeStampsStudy.json5 create mode 100644 studies/BraveScreenFingerprintingBlockerStudy.json5 create mode 100644 studies/BraveSearchAdStudy.json5 create mode 100644 studies/BraveSearchPromotionBannerStudy.json5 create mode 100644 studies/BraveSearchPromotionBannerStudyOnStable.json5 create mode 100644 studies/BraveTranslateStudy.json5 create mode 100644 studies/BraveWalletAnkrBalancesEnabled.json5 create mode 100644 studies/BraveWebViewRoundedCornersStudy.json5 create mode 100644 studies/BraveWebcompatExceptionsServiceReleaseStudy.json5 create mode 100644 studies/BraveWebcompatExceptionsServiceStudy.json5 create mode 100644 studies/CanvasKillSwitches.json5 create mode 100644 studies/ClampPlatformVersionClientHint.json5 create mode 100644 studies/CloseWatcher.json5 create mode 100644 studies/CollectWebGPUSupportMetricsKillSwitch.json5 create mode 100644 studies/CookieListDefaultStudy.json5 create mode 100644 studies/CosmeticFilteringChildFramesStudy.json5 create mode 100644 studies/CrossPlatformVPNStudy.json5 create mode 100644 studies/Default1pBlockingStudy.json5 create mode 100644 studies/DefaultBraveCommandsStudy.json5 create mode 100644 studies/DefaultBraveOmniboxMoreHistoryStudy.json5 create mode 100644 studies/DefaultPassthroughCommandDecoderStudy.json5 create mode 100644 studies/DefaultPlaylistStudy.json5 create mode 100644 studies/DisableCnameUncloakingForAndroid.json5 create mode 100644 studies/DisableReduceLanguage.json5 create mode 100644 studies/EphemeralStorageStudy.json5 create mode 100644 studies/ExtensionsManifestV2Study.json5 create mode 100644 studies/ExtensionsManifestV2StudyRelease.json5 create mode 100644 studies/HangWatcher.json5 create mode 100644 studies/HeapProfilingMacKillSwitch.json5 create mode 100644 studies/InnerHTMLParserFastpathStudy.json5 create mode 100644 studies/MacCoreLocationBackendStudy.json5 create mode 100644 studies/MetricsAndCrashSampling.json5 create mode 100644 studies/ModuleFileNamePatchStudy.json5 create mode 100644 studies/ModuleFileNamePatchStudyRelease.json5 create mode 100644 studies/NavigationThreadingOptimizationsCompatOldVersions.json5 create mode 100644 studies/NewiOSPlaylistUIStudy.json5 create mode 100644 studies/PartitionedCookies.json5 create mode 100644 studies/PostFREFixMetricsAndCrashSampling.json5 create mode 100644 studies/PrettyPrintJSONDocument.json5 create mode 100644 studies/PrivateNetworkAccessKillswitch.json5 create mode 100644 studies/RendererAllocatesImagesKillSwitch.json5 create mode 100644 studies/SidebarEnabledStudy.json5 create mode 100644 studies/SmilAutoSuspendOnLagKillSwitch.json5 create mode 100644 studies/Speedreader TTS.json5 create mode 100644 studies/UndecryptablePasswords.json5 create mode 100644 studies/UseWritePixelsYUV.json5 create mode 100644 studies/UserActivityStudy.json5 create mode 100644 studies/WhatsNewStudy.json5 create mode 100644 studies/WorkaroundNewWindowFlash.json5 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4420cad4..2bad1dde 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,6 +3,12 @@ # Griffin maintainers are responsible for all machinery in this repository. * @brave/griffin-maintainers -# The seed file is owned by the uplift team as any change to it directly affects -# public builds. It's important to update the seed in a controlled manner. -/seed/seed.json @brave/uplift-approvers +# The seed directory is deprecated and no longer used for the seed generation. +# However, it is used by the perf infrastructure to access the Griffin seed at +# some point in the past. Lock it to Griffin maintainers to prevent any +# unrelated changes. +/seed/** @brave/griffin-maintainers + +# The studies are owned by the uplift team as any change directly affects public +# builds. It's important to update studies in a controlled manner. +/studies/*.json5 @brave/uplift-approvers diff --git a/.github/workflows/generate-test-seed.yml b/.github/workflows/generate-test-seed.yml index c8a849ea..a79f8efa 100644 --- a/.github/workflows/generate-test-seed.yml +++ b/.github/workflows/generate-test-seed.yml @@ -4,7 +4,6 @@ on: pull_request: paths: - '.github/workflows/generate-test-seed.yml' - - 'seed/seed.json' - 'studies/**' jobs: @@ -23,14 +22,6 @@ jobs: - name: Fetch base commit run: git fetch --depth=1 origin "$BASE_SHA" - - name: Setup Python - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5 - with: - python-version: '3.11' - - - name: Install python requirements - run: pip install -r seed/requirements.txt - - name: Comment "Generation In Progress" uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: @@ -64,10 +55,7 @@ jobs: - name: Generate seed run: | - # Use only python implementation for now. - python seed/serialize.py seed/seed.json --version "$SEED_VERSION" - # TODO: enable this when per-file studies will be synced with seed.json. - # npm run seed_tools -- create_seed studies seed.bin --version "$SEED_VERSION" + npm run seed_tools create -- --version "$SEED_VERSION" - name: Upload seed env: diff --git a/.github/workflows/test-src.yml b/.github/workflows/test-src.yml index 5d0b05fd..d091ba01 100644 --- a/.github/workflows/test-src.yml +++ b/.github/workflows/test-src.yml @@ -24,3 +24,14 @@ jobs: - name: build run: npm run build + + - name: Setup Python + uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5 + with: + python-version: '3.11' + + - name: Install python seed generator requirements + run: pip install -r seed/requirements.txt + + - name: Compare python and typescript seed generator + run: npm run seed_tools compare_python_gen diff --git a/README.md b/README.md index 6a9dea36..dd71b46f 100644 --- a/README.md +++ b/README.md @@ -9,36 +9,40 @@ See the [Wiki](