chrome-devtools-frontend 1.0.1669021 → 1.0.1672388
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/fixing-skipped-tests/SKILL.md +6 -6
- package/.agents/skills/gerrit-cli/SKILL.md +4 -10
- package/.agents/skills/gerrit-cli/references/commands.md +45 -2
- package/.agents/skills/gerrit-cli/references/workflows.md +7 -0
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +34 -152
- package/config/typescript/tsconfig.eslint.json +1 -1
- package/docs/contributing/settings-experiments-features.md +2 -8
- package/docs/ecosystem/automatic_workspace_folders.md +0 -19
- package/eslint.config.mjs +2 -2
- package/front_end/core/common/Lazy.ts +3 -3
- package/front_end/core/common/SettingRegistration.ts +0 -7
- package/front_end/core/common/Settings.ts +0 -38
- package/front_end/core/host/UserMetrics.ts +187 -953
- package/front_end/core/host/UserMetricsEnums.d.ts +949 -0
- package/front_end/core/root/Runtime.ts +21 -133
- package/front_end/core/sdk/CSSMetadata.ts +70 -65
- package/front_end/core/sdk/CategorizedBreakpoint.ts +0 -1
- package/front_end/core/sdk/ChildTargetManager.ts +0 -2
- package/front_end/core/sdk/EmulationModel.ts +0 -2
- package/front_end/core/sdk/EventBreakpointsModel.ts +0 -4
- package/front_end/core/sdk/NetworkManager.ts +0 -3
- package/front_end/core/sdk/PageResourceLoader.ts +9 -9
- package/front_end/core/sdk/RehydratingConnection.ts +52 -4
- package/front_end/core/sdk/Target.ts +0 -4
- package/front_end/devtools_compatibility.js +886 -0
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +7 -6
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +0 -1
- package/front_end/entrypoints/main/MainImpl.ts +18 -22
- package/front_end/foundation/Universe.ts +7 -2
- package/front_end/generated/InspectorBackendCommands.ts +3 -10
- package/front_end/generated/protocol-mapping.d.ts +0 -42
- package/front_end/generated/protocol-proxy-api.d.ts +0 -38
- package/front_end/generated/protocol.ts +9 -169
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -3
- package/front_end/models/ai_assistance/AiConversation.ts +1 -0
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +8 -5
- package/front_end/models/ai_assistance/AiSetting.ts +108 -0
- package/front_end/models/ai_assistance/AiUtils.ts +47 -0
- package/front_end/models/ai_assistance/ChangeManager.ts +1 -0
- package/front_end/models/ai_assistance/ExtensionScope.ts +3 -12
- package/front_end/models/ai_assistance/agents/AiAgent.ts +11 -18
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -0
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +42 -17
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -2
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +253 -155
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +12 -6
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +3 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -0
- package/front_end/models/ai_assistance/injected.ts +1 -0
- package/front_end/models/ai_assistance/performance/AICallTree.ts +1 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
- package/front_end/models/ai_assistance/skills/performance.md +10 -0
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +52 -5
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +4 -4
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +4 -4
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +5 -4
- package/front_end/models/ai_assistance/tools/GetStyles.ts +5 -4
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +5 -4
- package/front_end/models/ai_assistance/tools/README.md +1 -1
- package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +63 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +5 -5
- package/front_end/models/ai_assistance/tools/Tool.ts +118 -24
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +2 -0
- package/front_end/models/badges/UserBadges.ts +2 -0
- package/front_end/models/bindings/NetworkProject.ts +5 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -0
- package/front_end/models/bindings/ResourceUtils.ts +3 -0
- package/front_end/models/crux-manager/CrUXManager.ts +1 -0
- package/front_end/models/emulation/DeviceModeModel.ts +140 -7
- package/front_end/models/emulation/EmulatedDevices.ts +246 -793
- package/front_end/models/issues_manager/IssuesManager.ts +10 -2
- package/front_end/models/live-metrics/LiveMetrics.ts +41 -9
- package/front_end/models/logs/LogManager.ts +8 -5
- package/front_end/models/logs/NetworkLog.ts +1 -0
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +21 -3
- package/front_end/models/persistence/NetworkPersistenceManager.ts +6 -0
- package/front_end/models/project_settings/ProjectSettingsModel.ts +8 -12
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +3 -1
- package/front_end/models/workspace/IgnoreListManager.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +2 -0
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +4 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +22 -22
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -7
- package/front_end/panels/ai_assistance/components/ChatInput.ts +4 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +79 -34
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +1 -2
- package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -106
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +1 -1
- package/front_end/panels/application/application.ts +0 -10
- package/front_end/panels/application/components/components.ts +0 -4
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +0 -5
- package/front_end/panels/browser_debugger/EventListenerBreakpointsSidebarPane.ts +6 -12
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +5 -3
- package/front_end/panels/console/ConsoleFormat.ts +2 -62
- package/front_end/panels/console/ConsoleViewMessage.ts +14 -7
- package/front_end/panels/emulation/AdvancedApp.ts +1 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +83 -69
- package/front_end/panels/emulation/DeviceModeView.ts +4 -134
- package/front_end/panels/emulation/DeviceModeWrapper.ts +52 -69
- package/front_end/panels/emulation/MediaQueryInspector.ts +2 -2
- package/front_end/panels/emulation/emulation-meta.ts +12 -12
- package/front_end/panels/issues/IssuesPane.ts +3 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +17 -21
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +206 -126
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
- package/front_end/panels/mobile_throttling/CalibrationController.ts +1 -1
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +3 -3
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +6 -6
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +11 -11
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +13 -13
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +10 -10
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +28 -28
- package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +6 -6
- package/front_end/panels/network/RequestHeadersView.ts +1 -1
- package/front_end/panels/network/ResourceChunkView.ts +243 -144
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +52 -29
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +21 -35
- package/front_end/panels/network/resourceChunkView.css +41 -36
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +21 -12
- package/front_end/panels/profiler/profiler.ts +4 -0
- package/front_end/panels/recorder/RecorderPanel.ts +6 -14
- package/front_end/panels/sensors/LocationsSettingsTab.ts +7 -7
- package/front_end/panels/settings/AISettingsTab.ts +75 -31
- package/front_end/panels/settings/SettingsScreen.ts +8 -13
- package/front_end/panels/settings/components/SyncSection.ts +3 -4
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +200 -18
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +18 -0
- package/front_end/panels/settings/settings-meta.ts +0 -1
- package/front_end/panels/sources/CategorizedBreakpointL10n.ts +0 -2
- package/front_end/panels/sources/DebuggerPausedMessage.ts +11 -5
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +12 -9
- package/front_end/panels/sources/SourcesPanel.ts +19 -17
- package/front_end/panels/sources/SourcesView.ts +191 -96
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -5
- package/front_end/panels/timeline/TimelineUIUtils.ts +15 -0
- package/front_end/panels/timeline/timeline-meta.ts +3 -5
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1332 -193
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/tsconfig.compatibility.json +2 -1
- package/front_end/tsconfig.json +1 -1
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +4 -7
- package/front_end/ui/components/settings/settings.ts +1 -2
- package/front_end/ui/legacy/Treeoutline.ts +52 -30
- package/front_end/ui/legacy/components/object_ui/CSSStyleSanitizer.ts +74 -0
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +6 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +47 -54
- package/front_end/ui/legacy/components/object_ui/object_ui.ts +2 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -27
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +10 -12
- package/front_end/ui/settings/SettingUIRegistration.ts +0 -8
- package/front_end/ui/visual_logging/KnownContextValues.ts +21 -0
- package/inspector_overlay/tsconfig.json +8 -2
- package/package.json +3 -2
- package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +0 -47
- package/front_end/core/sdk/CSSModel.test.api.ts +0 -102
- package/front_end/core/sdk/DOMModel.test.api.ts +0 -104
- package/front_end/foundation/Universe.test.api.ts +0 -73
- package/front_end/panels/application/SharedStorageEventsView.ts +0 -128
- package/front_end/panels/application/SharedStorageItemsView.ts +0 -179
- package/front_end/panels/application/SharedStorageListTreeElement.ts +0 -65
- package/front_end/panels/application/SharedStorageModel.ts +0 -249
- package/front_end/panels/application/SharedStorageTreeElement.ts +0 -40
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +0 -191
- package/front_end/panels/application/components/SharedStorageMetadataView.ts +0 -133
- package/front_end/panels/application/components/sharedStorageAccessGrid.css +0 -29
- package/front_end/panels/application/components/sharedStorageMetadataView.css +0 -29
- package/front_end/panels/application/sharedStorageEventsView.css +0 -9
- package/front_end/panels/network/OriginalResourceChunkView.ts +0 -340
- package/front_end/panels/network/originalResourceChunkView.css +0 -49
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +0 -47
- package/front_end/ui/components/settings/settingDeprecationWarning.css +0 -14
|
@@ -16,17 +16,17 @@ This skill outlines the workflow for fixing skipped tests in the DevTools codeba
|
|
|
16
16
|
- Ensure you use the instructions from the `devtools-version-control` skill to create and switch branches appropriately.
|
|
17
17
|
|
|
18
18
|
3. **Search for the Skipped Tests**
|
|
19
|
-
- Search the
|
|
20
|
-
-
|
|
19
|
+
- Search the `test/TestExpectations` file for the `<bugid>` to find skipped tests.
|
|
20
|
+
- Tests are no longer skipped using `.skip` in the code, but rather by having a `[ Skip ]` expectation in `test/TestExpectations`.
|
|
21
21
|
|
|
22
22
|
4. **Iterative Fix Process**
|
|
23
|
-
- **Step 1:** Remove `
|
|
23
|
+
- **Step 1:** Remove the `[ Skip ]` expectation for *one* of the tests associated with the bug in `test/TestExpectations` (or change it to `[ Pass Failure ]` if you are investigating flakiness).
|
|
24
24
|
- **Step 2:** Re-run the specific test using its exact test ID (e.g., `npm run test path/to/foo.test.ts:test_name`) using the guidelines from the `devtools-verification` skill. If you are dealing with flaky tests, you can use the `--repeat=x` flag (e.g. `npm run test -- --repeat=20 path/to/foo.test.ts:test_name`) to run the test multiple times to reproduce the flakiness. This flag works for both E2E and unit tests.
|
|
25
25
|
- **Step 3:** Analyze the test failure and make the necessary fixes to the code or the test itself.
|
|
26
26
|
- **Step 4:** Re-run the test to ensure the fix is correct.
|
|
27
|
-
- **Step 5:** Remove the `[crbug.com/<bugid>]` prefix from the test name string if it is present.
|
|
28
|
-
- **Step 6:** Remove any comments directly above the test that explain the reason why the test was skipped (e.g., `// TODO(crbug...): Flaky`).
|
|
29
|
-
- **Step 7:** Apply the fix to the remaining tests, un-skipping them one by one or in batches
|
|
27
|
+
- **Step 5:** Remove the `[crbug.com/<bugid>]` prefix from the test name string in the code if it is present.
|
|
28
|
+
- **Step 6:** Remove any comments directly above the test in the code that explain the reason why the test was skipped (e.g., `// TODO(crbug...): Flaky`).
|
|
29
|
+
- **Step 7:** Apply the fix to the remaining tests, un-skipping them one by one or in batches by modifying `test/TestExpectations`, and verifying until all are passing.
|
|
30
30
|
|
|
31
31
|
5. **Verify Full Build**
|
|
32
32
|
- Before finishing, run the full verification process (TypeScript checks, linters, full test run) as required by the repository best practices.
|
|
@@ -16,8 +16,6 @@ depot_tools.
|
|
|
16
16
|
|
|
17
17
|
## Prerequisites
|
|
18
18
|
|
|
19
|
-
- **Environment**: Always execute the wrapper script using **`vpython3`** instead of `python3` to ensure all internal dependencies are satisfied.
|
|
20
|
-
|
|
21
19
|
- Ensure `gerrit_client.py` is available in the system `PATH` (typically part of
|
|
22
20
|
`depot_tools`). If `gerrit_client.py` is not available in your environment,
|
|
23
21
|
stop execution immediately.
|
|
@@ -33,15 +31,11 @@ depot_tools.
|
|
|
33
31
|
- Before querying public CLs, adding comments, voting, or submitting changes,
|
|
34
32
|
read `references/workflows.md` for step-by-step procedures.
|
|
35
33
|
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
The wrapper script includes DevTools-specific defaults for `--host` and
|
|
39
|
-
`--project`. You do not need to provide them unless you are targeting a
|
|
40
|
-
different host or project.
|
|
34
|
+
## Gotchas & Environment Constraints
|
|
41
35
|
|
|
42
|
-
- **
|
|
43
|
-
|
|
44
|
-
- **JSON Output**: Always use the `--json_file=<path>` flag when querying
|
|
36
|
+
- **Specify Host**: Always supply the `--host` flag explicitly (e.g.
|
|
37
|
+
`--host https://chromium-review.googlesource.com`).
|
|
38
|
+
- **Use JSON Output**: Always use the `--json_file=<path>` flag when querying
|
|
45
39
|
changes or fetching metadata to obtain structured, machine-readable output.
|
|
46
40
|
|
|
47
41
|
> [!CAUTION]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Gerrit CLI Common Commands & Usage (Public)
|
|
2
2
|
|
|
3
3
|
Run the tool directly using the wrapper script path with the `--help` flag:
|
|
4
|
+
|
|
4
5
|
- `vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py --help`
|
|
5
6
|
- `vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py changes --help`
|
|
6
7
|
|
|
@@ -19,22 +20,36 @@ ______________________________________________________________________
|
|
|
19
20
|
### 1. Inspecting and Searching Changes
|
|
20
21
|
|
|
21
22
|
- **Query active changes:**
|
|
23
|
+
|
|
22
24
|
```bash
|
|
23
25
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
24
26
|
changes \
|
|
27
|
+
--host https://chromium-review.googlesource.com \
|
|
25
28
|
--query "owner:self status:open"
|
|
26
29
|
```
|
|
30
|
+
|
|
27
31
|
- **View the content of a specific file in a change:**
|
|
32
|
+
|
|
33
|
+
**Note:** This command does not work with the `--json_file` flag, instead use
|
|
34
|
+
stdout redirection (`>`).
|
|
35
|
+
|
|
28
36
|
```bash
|
|
29
37
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
30
38
|
content \
|
|
31
|
-
--
|
|
32
|
-
--
|
|
39
|
+
--host https://chromium-review.googlesource.com \
|
|
40
|
+
--project <project> \
|
|
41
|
+
--change <change_id> \
|
|
42
|
+
--revision <revision> \
|
|
43
|
+
--path <file_path> \
|
|
44
|
+
> output_file
|
|
33
45
|
```
|
|
46
|
+
|
|
34
47
|
- **Get related changes:**
|
|
48
|
+
|
|
35
49
|
```bash
|
|
36
50
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
37
51
|
relatedchanges \
|
|
52
|
+
--host https://chromium-review.googlesource.com \
|
|
38
53
|
--change <change_id> --revision <revision>
|
|
39
54
|
```
|
|
40
55
|
|
|
@@ -44,6 +59,7 @@ ______________________________________________________________________
|
|
|
44
59
|
```bash
|
|
45
60
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
46
61
|
addpatchsetcomment \
|
|
62
|
+
--host https://chromium-review.googlesource.com \
|
|
47
63
|
--change <change_id> --revision <revision> \
|
|
48
64
|
--message "Review findings: <message>"
|
|
49
65
|
```
|
|
@@ -51,6 +67,7 @@ ______________________________________________________________________
|
|
|
51
67
|
```bash
|
|
52
68
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
53
69
|
setlabel \
|
|
70
|
+
--host https://chromium-review.googlesource.com \
|
|
54
71
|
--change <change_id> \
|
|
55
72
|
--label Code-Review 1
|
|
56
73
|
```
|
|
@@ -61,12 +78,14 @@ ______________________________________________________________________
|
|
|
61
78
|
```bash
|
|
62
79
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
63
80
|
submitchange \
|
|
81
|
+
--host https://chromium-review.googlesource.com \
|
|
64
82
|
--change <change_id>
|
|
65
83
|
```
|
|
66
84
|
- **Abandon a change:**
|
|
67
85
|
```bash
|
|
68
86
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
69
87
|
abandon \
|
|
88
|
+
--host https://chromium-review.googlesource.com \
|
|
70
89
|
--change <change_id> \
|
|
71
90
|
--message "<reason>"
|
|
72
91
|
```
|
|
@@ -74,6 +93,7 @@ ______________________________________________________________________
|
|
|
74
93
|
```bash
|
|
75
94
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
76
95
|
restore \
|
|
96
|
+
--host https://chromium-review.googlesource.com \
|
|
77
97
|
--change <change_id> \
|
|
78
98
|
--message "<reason>"
|
|
79
99
|
```
|
|
@@ -91,3 +111,26 @@ Explore the built-in CLI help for additional subcommands or advanced syntax:
|
|
|
91
111
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
92
112
|
help <command>
|
|
93
113
|
```
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## Advanced / Escape Hatch: Arbitrary REST API Calls (`rawapi`)
|
|
117
|
+
|
|
118
|
+
If the built-in subcommands do not cover a specific action or metadata query, you can use the `rawapi` subcommand to execute arbitrary HTTP requests against the Gerrit REST API.
|
|
119
|
+
|
|
120
|
+
- **Endpoint Reference**: [Gerrit REST API - Changes](https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html)
|
|
121
|
+
|
|
122
|
+
### Usage
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
126
|
+
rawapi \
|
|
127
|
+
--host https://chromium-review.googlesource.com \
|
|
128
|
+
--path "/changes/<change_id>/detail?o=SUBMITTABLE" \
|
|
129
|
+
--json_file output.json
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
- **Options**:
|
|
133
|
+
- `--path`: HTTP path of the API endpoint (e.g. `/changes/<change_id>/revisions/current/mergeable`).
|
|
134
|
+
- `--method`: HTTP method (GET, POST, PUT, DELETE). Defaults to GET.
|
|
135
|
+
- `--body`: JSON string body for write requests (e.g., POST/PUT).
|
|
136
|
+
- `--accept_status`: Comma-separated list of successful HTTP status codes.
|
|
@@ -9,6 +9,7 @@ provided with a link or ID:
|
|
|
9
9
|
```bash
|
|
10
10
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
11
11
|
changes \
|
|
12
|
+
--host https://chromium-review.googlesource.com \
|
|
12
13
|
--query "change:<id>"
|
|
13
14
|
```
|
|
14
15
|
2. **Fetch File Contents**: Retrieve the content of specific files modified in
|
|
@@ -16,6 +17,8 @@ provided with a link or ID:
|
|
|
16
17
|
```bash
|
|
17
18
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
18
19
|
content \
|
|
20
|
+
--host https://chromium-review.googlesource.com \
|
|
21
|
+
--project <project> \
|
|
19
22
|
--change <change_id> --revision current --path <file_path>
|
|
20
23
|
```
|
|
21
24
|
3. **Analyze Local Modifications**: Inspect the fetched contents and local diffs
|
|
@@ -25,6 +28,7 @@ provided with a link or ID:
|
|
|
25
28
|
```bash
|
|
26
29
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
27
30
|
addpatchsetcomment \
|
|
31
|
+
--host https://chromium-review.googlesource.com \
|
|
28
32
|
--change <change_id> --revision current \
|
|
29
33
|
--message "Review findings: ..."
|
|
30
34
|
```
|
|
@@ -38,12 +42,14 @@ Execute these steps in chronological order to approve and merge a Change List:
|
|
|
38
42
|
```bash
|
|
39
43
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
40
44
|
relatedchanges \
|
|
45
|
+
--host https://chromium-review.googlesource.com \
|
|
41
46
|
--change <change_id> --revision current
|
|
42
47
|
```
|
|
43
48
|
2. **Vote on Review Labels**: Apply the required Code-Review approval vote:
|
|
44
49
|
```bash
|
|
45
50
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
46
51
|
setlabel \
|
|
52
|
+
--host https://chromium-review.googlesource.com \
|
|
47
53
|
--change <change_id> \
|
|
48
54
|
--label Code-Review 1
|
|
49
55
|
```
|
|
@@ -52,5 +58,6 @@ Execute these steps in chronological order to approve and merge a Change List:
|
|
|
52
58
|
```bash
|
|
53
59
|
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
54
60
|
submitchange \
|
|
61
|
+
--host https://chromium-review.googlesource.com \
|
|
55
62
|
--change <change_id>
|
|
56
63
|
```
|
|
@@ -17,40 +17,6 @@ from pathlib import Path
|
|
|
17
17
|
|
|
18
18
|
UPSTREAM_URL = "https://chromium.googlesource.com/chromium/agents/+archive/refs/heads/main/skills/gerrit-cli.tar.gz"
|
|
19
19
|
|
|
20
|
-
DEVTOOLS_WRAPPER_LOGIC = """ # DevTools specific defaults
|
|
21
|
-
default_args = [
|
|
22
|
-
'--host', 'https://chromium-review.googlesource.com',
|
|
23
|
-
'--project', 'devtools/devtools-frontend',
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
# gerrit_client.py expects: <command> [options] [args]
|
|
27
|
-
# We need to extract the command from sys.argv and put it first.
|
|
28
|
-
user_args = sys.argv[1:]
|
|
29
|
-
command = []
|
|
30
|
-
other_args = []
|
|
31
|
-
for i, arg in enumerate(user_args):
|
|
32
|
-
if not arg.startswith('-'):
|
|
33
|
-
command = [arg]
|
|
34
|
-
other_args = user_args[:i] + user_args[i + 1:]
|
|
35
|
-
break
|
|
36
|
-
else:
|
|
37
|
-
other_args = user_args
|
|
38
|
-
|
|
39
|
-
full_args = command + default_args + other_args
|
|
40
|
-
|
|
41
|
-
rc = subprocess.call(['vpython3', client] + full_args)"""
|
|
42
|
-
|
|
43
|
-
CAUTION_TEXT = """> [!CAUTION]
|
|
44
|
-
> **NEVER** use this to add patchset comments to an existing comment thread that
|
|
45
|
-
> contains human reviewers in it. Using an agent to reply to a human is a
|
|
46
|
-
> violation of Chromium's code of conduct.
|
|
47
|
-
>
|
|
48
|
-
> If the user requests this or you encounter this scenario as part of your work,
|
|
49
|
-
> inform the user about which comment threads cannot be updated but otherwise
|
|
50
|
-
> continue work.
|
|
51
|
-
"""
|
|
52
|
-
|
|
53
|
-
|
|
54
20
|
def fetch_upstream_skill(target_dir: Path):
|
|
55
21
|
print(f"Downloading upstream skill from {UPSTREAM_URL}...")
|
|
56
22
|
try:
|
|
@@ -71,53 +37,16 @@ def fetch_upstream_skill(target_dir: Path):
|
|
|
71
37
|
def apply_devtools_revisions(target_dir: Path):
|
|
72
38
|
print("Applying DevTools-specific adaptations...")
|
|
73
39
|
|
|
74
|
-
# 1. Update gerrit_client_wrapper.py
|
|
75
|
-
wrapper_path = target_dir / "scripts" / "gerrit_client_wrapper.py"
|
|
76
|
-
if wrapper_path.exists():
|
|
77
|
-
code = wrapper_path.read_text()
|
|
78
|
-
# Remove ". All rights reserved." from license header to satisfy DevTools presubmit
|
|
79
|
-
code = code.replace(". All rights reserved.", "")
|
|
80
|
-
target_line = " rc = subprocess.call(['vpython3', client] + sys.argv[1:])"
|
|
81
|
-
if target_line in code:
|
|
82
|
-
code = code.replace(target_line, DEVTOOLS_WRAPPER_LOGIC)
|
|
83
|
-
else:
|
|
84
|
-
# Fallback if upstream changed to python3
|
|
85
|
-
fallback_line = " rc = subprocess.call(['python3', client] + sys.argv[1:])"
|
|
86
|
-
code = code.replace(fallback_line, DEVTOOLS_WRAPPER_LOGIC)
|
|
87
|
-
wrapper_path.write_text(code)
|
|
88
|
-
print(" - Adapted gerrit_client_wrapper.py")
|
|
89
|
-
|
|
90
40
|
# 2. Update SKILL.md
|
|
91
41
|
skill_md_path = target_dir / "SKILL.md"
|
|
92
42
|
if skill_md_path.exists():
|
|
93
43
|
content = skill_md_path.read_text()
|
|
94
44
|
|
|
95
|
-
# Re-route wrapper script path
|
|
96
|
-
content =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
# Add vpython3 environment warning under Prerequisites
|
|
102
|
-
if "- **Environment**:" not in content:
|
|
103
|
-
prereq_note = "- **Environment**: Always execute the wrapper script using **`vpython3`** instead of `python3` to ensure all internal dependencies are satisfied.\n"
|
|
104
|
-
content = content.replace("## Prerequisites\n",
|
|
105
|
-
f"## Prerequisites\n\n{prereq_note}")
|
|
106
|
-
|
|
107
|
-
# Replace Gotchas section with DevTools defaults info
|
|
108
|
-
global_flags_section = """## Global Flags
|
|
109
|
-
|
|
110
|
-
The wrapper script includes DevTools-specific defaults for `--host` and
|
|
111
|
-
`--project`. You do not need to provide them unless you are targeting a
|
|
112
|
-
different host or project.
|
|
113
|
-
|
|
114
|
-
- **Default Host**: `https://chromium-review.googlesource.com`
|
|
115
|
-
- **Default Project**: `devtools/devtools-frontend`
|
|
116
|
-
- **JSON Output**: Always use the `--json_file=<path>` flag when querying
|
|
117
|
-
changes or fetching metadata to obtain structured, machine-readable output.
|
|
118
|
-
"""
|
|
119
|
-
gotchas_pattern = r"## Gotchas & Environment Constraints\n\n(?:[^\n]+\n)+"
|
|
120
|
-
content = re.sub(gotchas_pattern, global_flags_section, content)
|
|
45
|
+
# Re-route wrapper script path
|
|
46
|
+
content = re.sub(
|
|
47
|
+
r'(?:v)?python3\s+agents/shared/skills/gerrit-cli/scripts/gerrit_client_wrapper.py',
|
|
48
|
+
'vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py',
|
|
49
|
+
content)
|
|
121
50
|
|
|
122
51
|
# Add attribution note at the bottom
|
|
123
52
|
attribution = """
|
|
@@ -138,91 +67,44 @@ different host or project.
|
|
|
138
67
|
c = ref_path.read_text()
|
|
139
68
|
|
|
140
69
|
# Path & executable transformations
|
|
141
|
-
c =
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
# Remove redundant host/project flags since our wrapper defaults them
|
|
145
|
-
# This matches the flag and any trailing backslash & newline to keep shell syntax valid
|
|
146
|
-
c = re.sub(r'^[ \t]+--(host|project)[ \t]+\S+[ \t]*(?:\\)?\n',
|
|
147
|
-
'',
|
|
148
|
-
c,
|
|
149
|
-
flags=re.M)
|
|
150
|
-
|
|
151
|
-
# Re-route positional arguments to flags for various commands.
|
|
152
|
-
# TODO(b/40292850): Simplify/remove these once CL lands upstream:
|
|
153
|
-
# https://chromium-review.googlesource.com/c/chromium/agents/+/8146436
|
|
154
|
-
|
|
155
|
-
# content
|
|
156
|
-
c = c.replace(
|
|
157
|
-
"<change_id> <revision> <file_path>",
|
|
158
|
-
"--change <change_id> --revision <revision> --path <file_path>"
|
|
159
|
-
)
|
|
160
|
-
c = c.replace(
|
|
161
|
-
"<change_id> current <file_path>",
|
|
162
|
-
"--change <change_id> --revision current --path <file_path>")
|
|
163
|
-
|
|
164
|
-
# changes (query flag is required)
|
|
165
|
-
c = c.replace('changes \\\n "owner:self status:open"',
|
|
166
|
-
'changes \\\n --query "owner:self status:open"')
|
|
167
|
-
c = c.replace('changes \\\n "change:<id>"',
|
|
168
|
-
'changes \\\n --query "change:<id>"')
|
|
169
|
-
|
|
170
|
-
# relatedchanges
|
|
171
|
-
c = c.replace(
|
|
172
|
-
"relatedchanges \\\n <change_id> <revision>",
|
|
173
|
-
"relatedchanges \\\n --change <change_id> --revision <revision>"
|
|
174
|
-
)
|
|
175
|
-
c = c.replace(
|
|
176
|
-
"relatedchanges \\\n <change_id> current",
|
|
177
|
-
"relatedchanges \\\n --change <change_id> --revision current"
|
|
178
|
-
)
|
|
179
|
-
|
|
180
|
-
# addpatchsetcomment
|
|
181
|
-
c = c.replace(
|
|
182
|
-
'addpatchsetcomment \\\n --message "Review findings: <message>" \\\n <change_id> <revision>',
|
|
183
|
-
'addpatchsetcomment \\\n --change <change_id> --revision <revision> \\\n --message "Review findings: <message>"'
|
|
184
|
-
)
|
|
185
|
-
c = c.replace(
|
|
186
|
-
'addpatchsetcomment \\\n --message "Review findings: ..." \\\n <change_id> current',
|
|
187
|
-
'addpatchsetcomment \\\n --change <change_id> --revision current \\\n --message "Review findings: ..."'
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
# setlabel
|
|
191
|
-
c = c.replace(
|
|
192
|
-
'setlabel \\\n --label "Code-Review" \\\n --value 1 \\\n <change_id>',
|
|
193
|
-
'setlabel \\\n --change <change_id> \\\n --label Code-Review 1'
|
|
194
|
-
)
|
|
195
|
-
c = c.replace(
|
|
196
|
-
'setlabel \\\n --label "Code-Review" \\\n --value 1 \\\n <change_id>',
|
|
197
|
-
'setlabel \\\n --change <change_id> \\\n --label Code-Review 1'
|
|
198
|
-
)
|
|
199
|
-
|
|
200
|
-
# submitchange
|
|
201
|
-
c = c.replace("submitchange \\\n <change_id>",
|
|
202
|
-
"submitchange \\\n --change <change_id>")
|
|
203
|
-
c = c.replace("submitchange \\\n <change_id>",
|
|
204
|
-
"submitchange \\\n --change <change_id>")
|
|
205
|
-
|
|
206
|
-
# abandon
|
|
207
|
-
c = c.replace(
|
|
208
|
-
'abandon \\\n --message "<reason>" \\\n <change_id>',
|
|
209
|
-
'abandon \\\n --change <change_id> \\\n --message "<reason>"'
|
|
210
|
-
)
|
|
211
|
-
|
|
212
|
-
# restore
|
|
213
|
-
c = c.replace(
|
|
214
|
-
'restore \\\n --message "<reason>" \\\n <change_id>',
|
|
215
|
-
'restore \\\n --change <change_id> \\\n --message "<reason>"'
|
|
216
|
-
)
|
|
70
|
+
c = re.sub(r'(?:v)?python3\s+agents/shared/skills/gerrit-cli/',
|
|
71
|
+
'vpython3 .agents/skills/gerrit-cli/', c)
|
|
217
72
|
|
|
218
73
|
ref_path.write_text(c)
|
|
219
74
|
print(f" - Adapted references/{filename}")
|
|
220
75
|
|
|
221
76
|
|
|
77
|
+
def validate_gerrit_client_wrapper(skill_dir: Path):
|
|
78
|
+
print("Validating gerrit_client_wrapper.py...")
|
|
79
|
+
import json, subprocess, tempfile
|
|
80
|
+
wrapper = skill_dir / "scripts" / "gerrit_client_wrapper.py"
|
|
81
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
82
|
+
json_file = Path(tmp) / "out.json"
|
|
83
|
+
try:
|
|
84
|
+
subprocess.run([
|
|
85
|
+
"vpython3",
|
|
86
|
+
str(wrapper), "changes", "--query", "change:8147179", "--host",
|
|
87
|
+
"https://chromium-review.googlesource.com", "--json_file",
|
|
88
|
+
str(json_file)
|
|
89
|
+
],
|
|
90
|
+
check=True,
|
|
91
|
+
capture_output=True)
|
|
92
|
+
data = json.loads(json_file.read_text())
|
|
93
|
+
if not data or data[0].get("_number") != 8147179:
|
|
94
|
+
raise ValueError(f"Invalid response: {data}")
|
|
95
|
+
print(" - Validation passed successfully!")
|
|
96
|
+
except Exception as e:
|
|
97
|
+
stderr = getattr(e, "stderr", b"").decode(errors="replace")
|
|
98
|
+
print(f"Validation FAILED: {e}\n{stderr}")
|
|
99
|
+
sys.exit(1)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
222
103
|
def main():
|
|
223
104
|
skill_dir = Path(__file__).parent.parent.resolve()
|
|
224
105
|
fetch_upstream_skill(skill_dir)
|
|
225
106
|
apply_devtools_revisions(skill_dir)
|
|
107
|
+
validate_gerrit_client_wrapper(skill_dir)
|
|
226
108
|
print("Upstream sync completed successfully!")
|
|
227
109
|
|
|
228
110
|
|
|
@@ -78,12 +78,12 @@ This step is optional. If you want the `base::Feature` to be controllable via th
|
|
|
78
78
|
|
|
79
79
|
Prerequisite: The `base::Feature` needs to be have been added to `chrome://flags`.
|
|
80
80
|
|
|
81
|
-
#### Step 1: Create
|
|
81
|
+
#### Step 1: Create an Experiment in the DevTools repository
|
|
82
82
|
|
|
83
83
|
Register the experiment in [`MainImpl.ts`](https://crsrc.org/c/third_party/devtools-frontend/src/front_end/entrypoints/main/MainImpl.ts;l=343)
|
|
84
84
|
|
|
85
85
|
```ts
|
|
86
|
-
Root.Runtime.experiments.
|
|
86
|
+
Root.Runtime.experiments.register({
|
|
87
87
|
name: Root.ExperimentNames.ExperimentName.DURABLE_MESSAGES,
|
|
88
88
|
// Short description of the experiment, shown to users
|
|
89
89
|
title: 'Durable Messages',
|
|
@@ -147,12 +147,6 @@ in the DevTools repository. The label can be anything you like but make sure it
|
|
|
147
147
|
|
|
148
148
|
[Example CL](https://crrev.com/c/4915777)
|
|
149
149
|
|
|
150
|
-
## Deprecated: DevTools experiments
|
|
151
|
-
|
|
152
|
-
Previously, DevTools experiments that lacked a Chrome component were managed separately. This
|
|
153
|
-
system is now deprecated. All legacy experiments are being migrated to the `base::Feature`
|
|
154
|
-
framework to streamline development.
|
|
155
|
-
|
|
156
150
|
## A/B Testing with Finch and base::Feature
|
|
157
151
|
|
|
158
152
|
`base::Feature` flags can be used with Finch to conduct A/B testing by toggling feature flags for a defined percentage of users. A/B testing can be a good way of testing the waters. However, since the time to get meaningful metrics may take a long time, it shouldn't be used to get feedback on options quickly.
|
|
@@ -66,25 +66,6 @@ An example `com.chrome.devtools.json` would look like this:
|
|
|
66
66
|
Chromium DevTools will only attempt to load the `com.chrome.devtools.json` when
|
|
67
67
|
the origin of the inspected page is `localhost`.
|
|
68
68
|
|
|
69
|
-
## Setup
|
|
70
|
-
|
|
71
|
-
In M-136, which is in Canary channel at the time of this writing, the relevant
|
|
72
|
-
flags have been enabled by default (as of 2025-03-16). In earlier versions of
|
|
73
|
-
M-136 and in M-135, this feature is disabled by default. To use it, you need to
|
|
74
|
-
turn on two feature flags in `about:flags`:
|
|
75
|
-
|
|
76
|
-
- [chrome://flags#devtools-project-settings](chrome://flags#devtools-project-settings)
|
|
77
|
-
- [chrome://flags#devtools-automatic-workspace-folders](chrome://flags#devtools-automatic-workspace-folders)
|
|
78
|
-
|
|
79
|
-

|
|
80
|
-
|
|
81
|
-
Instead of enabling the feature via `about:flags`, you can instead also enable
|
|
82
|
-
them from the command line:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
google-chrome-canary --enable-features=DevToolsWellKnown,DevToolsAutomaticFileSystems
|
|
86
|
-
```
|
|
87
|
-
|
|
88
69
|
## Usage
|
|
89
70
|
|
|
90
71
|
To check if your setup is correct, you can try out Benedikt’s
|
package/eslint.config.mjs
CHANGED
|
@@ -693,8 +693,8 @@ export default defineConfig([
|
|
|
693
693
|
},
|
|
694
694
|
},
|
|
695
695
|
{
|
|
696
|
-
name: 'Front-end core files',
|
|
697
|
-
files: ['front_end/core/**/*.ts'],
|
|
696
|
+
name: 'Front-end core and models files',
|
|
697
|
+
files: ['front_end/core/**/*.ts', 'front_end/models/**/*.ts'],
|
|
698
698
|
rules: {
|
|
699
699
|
'@devtools/no-instance-of-migrated-singletons': 'error',
|
|
700
700
|
},
|
|
@@ -8,11 +8,11 @@ const ERROR_STATE = Symbol('error');
|
|
|
8
8
|
/**
|
|
9
9
|
* Very basic memoizer. Will only invoke its callback the first time, returning the cached value all subsequent calls.
|
|
10
10
|
*/
|
|
11
|
-
export function lazy<T>(producer: () => T): () =>
|
|
11
|
+
export function lazy<T, A extends unknown[] = []>(producer: (...args: A) => T): (...args: A) => T {
|
|
12
12
|
let value: T|typeof ERROR_STATE|typeof UNINITIALIZED = UNINITIALIZED;
|
|
13
13
|
let error: Error = new Error('Initial');
|
|
14
14
|
|
|
15
|
-
return ():
|
|
15
|
+
return (...args: A): T => {
|
|
16
16
|
if (value === ERROR_STATE) {
|
|
17
17
|
throw error;
|
|
18
18
|
} else if (value !== UNINITIALIZED) {
|
|
@@ -20,7 +20,7 @@ export function lazy<T>(producer: () => T): () => symbol | T {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
try {
|
|
23
|
-
value = producer();
|
|
23
|
+
value = producer(...args);
|
|
24
24
|
return value;
|
|
25
25
|
} catch (err) {
|
|
26
26
|
error = err instanceof Error ? err : new Error(err);
|
|
@@ -282,13 +282,6 @@ export interface SettingRegistration {
|
|
|
282
282
|
*/
|
|
283
283
|
disabledCondition?: (config?: Root.Runtime.HostConfig) => DisabledConditionResult;
|
|
284
284
|
|
|
285
|
-
/**
|
|
286
|
-
* If a setting is deprecated, define this notice to show an appropriate warning according to the `warning` property.
|
|
287
|
-
* If `disabled` is set, the setting will be disabled in the settings UI. In that case, `experiment` optionally can be
|
|
288
|
-
* set to link to an experiment (by experiment name). The information icon in the settings UI can then be clicked to
|
|
289
|
-
* jump to the experiment. If a setting is not disabled, the experiment entry will be ignored.
|
|
290
|
-
*/
|
|
291
|
-
deprecationNotice?: {disabled: boolean, warning: () => Platform.UIString.LocalizedString, experiment?: string};
|
|
292
285
|
/**
|
|
293
286
|
* See {@link LearnMore} for more info.
|
|
294
287
|
*/
|
|
@@ -494,23 +494,6 @@ export class SettingsStorage {
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
export class Deprecation {
|
|
498
|
-
readonly disabled: boolean;
|
|
499
|
-
readonly warning: Platform.UIString.LocalizedString;
|
|
500
|
-
readonly experiment?: Root.Runtime.Experiment|Root.Runtime.HostExperiment;
|
|
501
|
-
|
|
502
|
-
constructor({deprecationNotice}: SettingRegistration) {
|
|
503
|
-
if (!deprecationNotice) {
|
|
504
|
-
throw new Error('Cannot create deprecation info for a non-deprecated setting');
|
|
505
|
-
}
|
|
506
|
-
this.disabled = deprecationNotice.disabled;
|
|
507
|
-
this.warning = deprecationNotice.warning();
|
|
508
|
-
this.experiment = deprecationNotice.experiment ?
|
|
509
|
-
Root.Runtime.experiments.allConfigurableExperiments().find(e => e.name === deprecationNotice.experiment) :
|
|
510
|
-
undefined;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
|
|
514
497
|
export class Setting<V> {
|
|
515
498
|
#registration: SettingRegistration|null = null;
|
|
516
499
|
#type: SettingType|null = null;
|
|
@@ -520,7 +503,6 @@ export class Setting<V> {
|
|
|
520
503
|
#serializer: Serializer<unknown, V> = JSON;
|
|
521
504
|
#hadUserAction?: boolean;
|
|
522
505
|
#disabled?: boolean;
|
|
523
|
-
#deprecation: Deprecation|null = null;
|
|
524
506
|
#loggedInitialAccess = false;
|
|
525
507
|
#logSettingAccess?: (name: string, value: number|string|boolean) => Promise<void>;
|
|
526
508
|
readonly #console: Console;
|
|
@@ -691,16 +673,6 @@ export class Setting<V> {
|
|
|
691
673
|
if (registration.settingType) {
|
|
692
674
|
this.#type = registration.settingType;
|
|
693
675
|
}
|
|
694
|
-
const {deprecationNotice} = registration;
|
|
695
|
-
if (deprecationNotice?.disabled) {
|
|
696
|
-
const experiment = deprecationNotice.experiment ?
|
|
697
|
-
Root.Runtime.experiments.allConfigurableExperiments().find(e => e.name === deprecationNotice.experiment) :
|
|
698
|
-
undefined;
|
|
699
|
-
if ((!experiment || experiment.isEnabled())) {
|
|
700
|
-
this.set(this.defaultValue);
|
|
701
|
-
this.setDisabled(true);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
676
|
}
|
|
705
677
|
|
|
706
678
|
type(): SettingType|null {
|
|
@@ -758,16 +730,6 @@ export class Setting<V> {
|
|
|
758
730
|
return this.#registration?.learnMore ?? null;
|
|
759
731
|
}
|
|
760
732
|
|
|
761
|
-
get deprecation(): Deprecation|null {
|
|
762
|
-
if (!this.#registration || !this.#registration.deprecationNotice) {
|
|
763
|
-
return null;
|
|
764
|
-
}
|
|
765
|
-
if (!this.#deprecation) {
|
|
766
|
-
this.#deprecation = new Deprecation(this.#registration);
|
|
767
|
-
}
|
|
768
|
-
return this.#deprecation;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
733
|
private printSettingsSavingError(message: string, value: string): void {
|
|
772
734
|
const errorMessage =
|
|
773
735
|
'Error saving setting with name: ' + this.name + ', value length: ' + value.length + '. Error: ' + message;
|