chrome-devtools-frontend 1.0.1667564 → 1.0.1669021
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/devtools-ci/SKILL.md +65 -0
- package/.agents/skills/devtools-setting-migration/SKILL.md +290 -0
- package/.agents/skills/gerrit-cli/SKILL.md +59 -0
- package/.agents/skills/gerrit-cli/references/commands.md +93 -0
- package/.agents/skills/gerrit-cli/references/workflows.md +56 -0
- package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +47 -0
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +230 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +11 -4
- package/.agents/skills/ui-widgets/SKILL.md +25 -1
- package/docs/contributing/infrastructure.md +7 -1
- package/docs/ui_engineering.md +44 -1
- package/front_end/core/common/Settings.ts +11 -4
- package/front_end/core/host/AidaClient.ts +66 -47
- package/front_end/core/host/GcaClient.ts +4 -6
- package/front_end/core/host/ResourceLoader.ts +4 -2
- package/front_end/core/root/Runtime.ts +5 -5
- package/front_end/core/sdk/CSSModel.test.api.ts +102 -0
- package/front_end/core/sdk/CSSModel.ts +3 -2
- package/front_end/core/sdk/ConsoleModel.ts +3 -2
- package/front_end/core/sdk/DebuggerModel.ts +16 -7
- package/front_end/core/sdk/SDKSettings.ts +38 -0
- package/front_end/core/sdk/sdk-meta.ts +0 -120
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/main/MainImpl.ts +10 -3
- package/front_end/foundation/Universe.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -2
- package/front_end/generated/protocol.ts +11 -3
- package/front_end/models/ai_assistance/AiAgent2.ts +1 -1
- package/front_end/models/ai_assistance/AiUtils.ts +67 -4
- package/front_end/models/ai_assistance/BuiltInAi.ts +11 -6
- package/front_end/models/ai_assistance/ChangeManager.ts +17 -1
- package/front_end/models/ai_assistance/StorageItem.ts +26 -5
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -19
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -3
- package/front_end/models/javascript_metadata/NativeFunctions.js +22 -9
- package/front_end/models/source_map_scopes/NamesResolver.ts +23 -17
- package/front_end/models/trace/handlers/RendererHandler.ts +20 -4
- package/front_end/models/trace/types/File.ts +1 -0
- package/front_end/models/workspace/UISourceCode.ts +0 -10
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +61 -182
- package/front_end/panels/ai_assistance/components/ChatInput.ts +25 -8
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +13 -69
- package/front_end/panels/ai_assistance/components/ChatView.ts +14 -8
- package/front_end/panels/ai_assistance/components/chatMessage.css +2 -20
- package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -2
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +41 -3
- package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +131 -134
- package/front_end/panels/application/ServiceWorkersView.ts +8 -8
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/AdsView.ts +10 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +53 -45
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +111 -119
- package/front_end/panels/application/preloading/components/preloadingDetailsReportView.css +22 -24
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +105 -102
- package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +107 -96
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +17 -19
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +6 -6
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +28 -26
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +6 -8
- package/front_end/panels/console/ConsoleView.ts +6 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/console/console-meta.ts +28 -0
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +3 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -2
- package/front_end/panels/emulation/DeviceModeView.ts +63 -104
- package/front_end/panels/emulation/DeviceModeWrapper.ts +18 -4
- package/front_end/panels/explain/components/ConsoleInsight.ts +4 -6
- package/front_end/panels/explain/explain-meta.ts +7 -49
- package/front_end/panels/network/NetworkDataGridNode.ts +1 -1
- package/front_end/panels/network/NetworkLogView.ts +1 -0
- package/front_end/panels/network/OriginalResourceChunkView.ts +340 -0
- package/front_end/panels/network/ResourceChunkView.ts +72 -46
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +3 -2
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +3 -3
- package/front_end/panels/network/originalResourceChunkView.css +49 -0
- package/front_end/panels/screencast/ScreencastView.ts +401 -260
- package/front_end/panels/screencast/screencastView.css +113 -100
- package/front_end/panels/sensors/LocationsSettingsTab.ts +329 -135
- package/front_end/panels/sensors/locationsSettingsTab.css +78 -4
- package/front_end/panels/settings/AISettingsTab.ts +17 -100
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +2 -2
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +4 -4
- package/front_end/panels/sources/AddSourceMapURLDialog.ts +3 -3
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +4 -3
- package/front_end/panels/sources/BreakpointEditDialog.ts +14 -14
- package/front_end/panels/sources/BreakpointsView.ts +14 -14
- package/front_end/panels/sources/CallStackSidebarPane.ts +6 -6
- package/front_end/panels/sources/CategorizedBreakpointL10n.ts +18 -18
- package/front_end/panels/sources/CoveragePlugin.ts +7 -7
- package/front_end/panels/sources/DebuggerPausedMessage.ts +23 -23
- package/front_end/panels/sources/DebuggerPlugin.ts +31 -31
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -2
- package/front_end/panels/sources/GoToLineQuickOpen.ts +10 -10
- package/front_end/panels/sources/NavigatorView.ts +34 -27
- package/front_end/panels/sources/OutlineQuickOpen.ts +3 -3
- package/front_end/panels/sources/PersistenceActions.ts +9 -9
- package/front_end/panels/sources/ProfilePlugin.ts +1 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +5 -5
- package/front_end/panels/sources/SnippetsPlugin.ts +2 -2
- package/front_end/panels/sources/SourcesNavigator.ts +20 -18
- package/front_end/panels/sources/SourcesPanel.ts +26 -25
- package/front_end/panels/sources/SourcesView.ts +5 -6
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -3
- package/front_end/panels/sources/ThreadsSidebarPane.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +7 -7
- package/front_end/panels/sources/components/HeadersView.ts +2 -2
- package/front_end/panels/sources/sources-meta.ts +164 -71
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/TimelineHistoryManager.ts +14 -3
- package/front_end/panels/timeline/TimelineLoader.ts +72 -42
- package/front_end/panels/timeline/TimelinePanel.ts +29 -4
- package/front_end/panels/timeline/timelineHistoryManager.css +4 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +187 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +91 -38
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +145 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.js +8 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +49 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts +0 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js +0 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +0 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +0 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/disposable.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/disposable.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +187 -1
- package/front_end/third_party/puppeteer/package/package.json +5 -5
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +155 -2
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +0 -2
- package/front_end/third_party/puppeteer/package/src/api/Dialog.ts +10 -2
- package/front_end/third_party/puppeteer/package/src/api/JSHandle.ts +0 -2
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +1 -3
- package/front_end/third_party/puppeteer/package/src/api/Realm.ts +0 -1
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +17 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +5 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +66 -0
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +0 -6
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/util.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +0 -3
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/disposable.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +9 -7
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +7 -8
- package/front_end/ui/legacy/Dialog.ts +103 -4
- package/front_end/ui/legacy/InspectorView.ts +1 -5
- package/front_end/ui/legacy/PopoverHelper.ts +5 -5
- package/front_end/ui/legacy/TabbedPane.ts +7 -2
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +40 -24
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +8 -4
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +14 -7
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/package.json +1 -1
- package/front_end/panels/sources/AiWarningInfobarPlugin.ts +0 -78
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devtools-ci
|
|
3
|
+
description: >-
|
|
4
|
+
Triage and analyze Chromium/DevTools LUCI build results and trybot failures,
|
|
5
|
+
including high-level builder status, compile errors, and detailed test
|
|
6
|
+
failures. Use this to inspect trybot buildbucket (bb) results for a patchset
|
|
7
|
+
overview or to query ResultDB directly for comprehensive, actionable information
|
|
8
|
+
about specific test regressions and infrastructure issues.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# LUCI Build Triage & Analysis
|
|
12
|
+
|
|
13
|
+
This skill provides access to specialized triage tools maintained within the
|
|
14
|
+
`depot_tools` repository. These tools are used to inspect Buildbucket results
|
|
15
|
+
and ResultDB test failures.
|
|
16
|
+
|
|
17
|
+
## Environment & Auth Discovery
|
|
18
|
+
|
|
19
|
+
- **Environment**: Always execute these scripts using **`vpython3`** instead
|
|
20
|
+
of `python3` to ensure all hermetic dependencies (like `httplib2`) are
|
|
21
|
+
satisfied.
|
|
22
|
+
- **Authentication**: Use `bb auth-info` to proactively check if you are
|
|
23
|
+
logged into Buildbucket. If not, inform the user they must run `bb auth-login`.
|
|
24
|
+
|
|
25
|
+
## Locating the Tools
|
|
26
|
+
|
|
27
|
+
The triage scripts and their detailed documentation are located relative to
|
|
28
|
+
the `depot_tools` installation:
|
|
29
|
+
|
|
30
|
+
1. **Locate Depot Tools**: Run `which gerrit_client.py` to find your local
|
|
31
|
+
`depot_tools` root.
|
|
32
|
+
2. **Navigation**:
|
|
33
|
+
- **Buildbucket (`bb_wrapper.py`)**: Found in `<DEPOT_TOOLS_ROOT>/agents/skills/buildbucket/`
|
|
34
|
+
- *Strengths*: High-level Build info (is it failing? what steps failed?),
|
|
35
|
+
compile errors, and infra issues.
|
|
36
|
+
- **Test Results (`luci_triage.py`)**: Found in `<DEPOT_TOOLS_ROOT>/agents/skills/luci-test-results/`
|
|
37
|
+
- *Strengths*: Detailed Test info (specific test case failures in
|
|
38
|
+
ResultDB).
|
|
39
|
+
|
|
40
|
+
## Troubleshooting
|
|
41
|
+
|
|
42
|
+
- **"No Artifacts Found"**: This usually occurs if:
|
|
43
|
+
1. The build failed so early (e.g., bot setup) that no artifacts were produced.
|
|
44
|
+
2. The build is too old and logs have been purged.
|
|
45
|
+
3. There is an authentication issue.
|
|
46
|
+
- **Fallback**: Try `bb log <build_id> <step_name>` to see the raw output
|
|
47
|
+
for the failed step.
|
|
48
|
+
|
|
49
|
+
## Available Skills in Depot Tools
|
|
50
|
+
|
|
51
|
+
Once you have located the `depot_tools` directory, read the following files
|
|
52
|
+
to understand how to use each tool:
|
|
53
|
+
|
|
54
|
+
- **`buildbucket`**: Used for high-level builder status and compile failures.
|
|
55
|
+
- Read: `<DEPOT_TOOLS_ROOT>/agents/skills/buildbucket/SKILL.md`
|
|
56
|
+
- **`luci-test-results`**: Used for detailed ResultDB test failure analysis.
|
|
57
|
+
- Read: `<DEPOT_TOOLS_ROOT>/agents/skills/luci-test-results/SKILL.md`
|
|
58
|
+
|
|
59
|
+
## Usage at Runtime
|
|
60
|
+
|
|
61
|
+
When you need to triage a build:
|
|
62
|
+
1. Locate `depot_tools` as described above.
|
|
63
|
+
2. Read the relevant `SKILL.md` file from `depot_tools`.
|
|
64
|
+
3. Follow the instructions in that file to execute the Python scripts (e.g.,
|
|
65
|
+
`bb_wrapper.py` or `luci_triage.py`) using their absolute paths.
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devtools-setting-migration
|
|
3
|
+
description: "Workflow for splitting an existing SettingRegistration into a SettingDescriptor (placed in the lowest layer where used: core/, models/, or ui/settings/) and SettingUIDescriptor (registered in a higher-level -meta.ts file, outside of core/ and models/)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DevTools Setting Migration Guide
|
|
7
|
+
|
|
8
|
+
This skill guide describes how to migrate an existing legacy `SettingRegistration` in DevTools by splitting it into a `SettingDescriptor` (non-UI descriptor) and a `SettingUIDescriptor` (UI descriptor).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Key Principles & Layer Boundaries
|
|
13
|
+
|
|
14
|
+
### 1. `SettingDescriptor` Location ("Lowest Layer")
|
|
15
|
+
* **Lowest Layer Rule:** A `SettingDescriptor` MUST be placed in the lowest architectural layer where the setting is used.
|
|
16
|
+
* **Core / Model Settings:** If a setting is used by `core/sdk` (or `models/`), its `SettingDescriptor` should be located in `core/sdk` (or `models/`).
|
|
17
|
+
* **Panel / UI Settings:** If a setting is only used by UI components or a specific panel (e.g. `panels/console/`), its `SettingDescriptor` **MUST GO INTO `ui/settings/FooSettings.ts`** (e.g. `ui/settings/ConsoleSettings.ts` where `Foo` is the panel name).
|
|
18
|
+
* **CRITICAL RULE — PANEL DESCRIPTORS MUST NOT BE PLACED IN `panels/`:**
|
|
19
|
+
* A `SettingDescriptor` **MUST NOT** be placed inside a `panels/` directory (e.g. `panels/console/ConsoleSettings.ts`).
|
|
20
|
+
* **Reason:** Panel `-meta.ts` files (e.g. `panels/console/console-meta.ts`) need to import the `SettingDescriptor` to call `SettingsUI.SettingUIRegistration.register(descriptor, uiDescriptor)`. `-meta.ts` files are loaded early and **MUST NOT import from `panels/`** (which would break lazy-loading of panel bundles). Since `ui/settings/` is in the `ui/` layer below `panels/`, `-meta.ts` files can safely import from `ui/settings/`.
|
|
21
|
+
* **CRITICAL RULE — MUST NOT BE IN A `-meta.ts` FILE:**
|
|
22
|
+
* A `SettingDescriptor` **MUST NOT** be placed in a `-meta.ts` file.
|
|
23
|
+
* **Reason:** Actual runtime code (e.g. models, panels, SDKs) needs to import the descriptor directly to call `Settings.instance().resolve(descriptor)`. Preload `-meta.ts` files are meant for lazy-loaded extension registrations and must not be imported by runtime code to avoid circular dependencies and module boundary violations.
|
|
24
|
+
|
|
25
|
+
### 2. `SettingUIDescriptor` Location (Higher-Level `-meta.ts` File)
|
|
26
|
+
* A `SettingUIDescriptor` defines UI-specific properties (category, title, tags, options, reload requirement, etc.).
|
|
27
|
+
* **Higher-Level Meta File Rule:** UI registrations **MUST BE PLACED IN A `-meta.ts` FILE ON A HIGHER LEVEL** (e.g., `entrypoints/main/main-meta.ts`, `entrypoints/inspector_main/inspector_main-meta.ts`, `panels/settings/settings-meta.ts`, or the specific panel's `-meta.ts` file).
|
|
28
|
+
* **CRITICAL RULE — MUST NOT REMAIN IN `core/` OR `models/`:**
|
|
29
|
+
* UI descriptors **MUST NOT** remain in or be added to `-meta.ts` files under `core/` or `models/` (such as `core/sdk/sdk-meta.ts` or `models/*/*-meta.ts`).
|
|
30
|
+
* **Goal:** A major goal of this migration is to completely eliminate `-meta.ts` files in `core/` and `models/`.
|
|
31
|
+
|
|
32
|
+
### 3. Resolving Settings vs `moduleSetting(name)`
|
|
33
|
+
* Legacy code retrieves settings using string identifiers: `Settings.instance().moduleSetting('setting-name')`.
|
|
34
|
+
* Refactored code should replace `moduleSetting('setting-name')` with `Settings.instance().resolve(settingDescriptor)`.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Step-by-Step Migration Workflow
|
|
39
|
+
|
|
40
|
+
Given a setting name (e.g., `'preserve-console-log'` or `'network-messages'`):
|
|
41
|
+
|
|
42
|
+
### Step 1: Locate Existing Registration & Analyze Use-Sites
|
|
43
|
+
1. Search for the setting name in `-meta.ts` files to find its `Common.Settings.registerSettingExtension` block.
|
|
44
|
+
2. Search for all occurrences of `'setting-name'` or `moduleSetting('setting-name')` across the codebase to identify all use-sites.
|
|
45
|
+
3. Determine the **lowest layer** among all use-sites:
|
|
46
|
+
* If used in `core/sdk` -> Target directory is `core/sdk/`.
|
|
47
|
+
* If used in `models/` -> Target directory is `models/<module>/`.
|
|
48
|
+
* If used in a panel (`panels/foo`) or UI -> Target directory is **`ui/settings/`** (file: `ui/settings/FooSettings.ts`). **NEVER place descriptors in `panels/`**.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
### Step 2: Extract & Define `SettingDescriptor` in the Lowest Layer
|
|
53
|
+
|
|
54
|
+
#### Decision Strategy: Create vs. Update File
|
|
55
|
+
When placing a `SettingDescriptor` in the target directory, decide whether to create or update a file using these rules:
|
|
56
|
+
|
|
57
|
+
1. **For Panel / UI Settings (Target is `ui/settings/`)**:
|
|
58
|
+
* **UPDATE**: Check if `ui/settings/FooSettings.ts` already exists (e.g., `ui/settings/ConsoleSettings.ts`). If so, add and export the `SettingDescriptor` there.
|
|
59
|
+
* **CREATE**: If `ui/settings/FooSettings.ts` does not exist:
|
|
60
|
+
* Create `ui/settings/FooSettings.ts`.
|
|
61
|
+
* Add `FooSettings.ts` to `sources` in `ui/settings/BUILD.gn`.
|
|
62
|
+
* Export `FooSettings.ts` from `ui/settings/settings.ts`.
|
|
63
|
+
|
|
64
|
+
2. **For Core / Model Settings (Target is `core/` or `models/`)**:
|
|
65
|
+
* **UPDATE**: Check if a module-wide settings file exists in that directory (e.g. `core/sdk/SDKSettings.ts`, `models/workspace/WorkspaceSettings.ts`). If so, add and export the `SettingDescriptor` there.
|
|
66
|
+
* **UPDATE**: If no module settings file exists and the setting is strictly used inside a single file (e.g., `ResourceTreeModel.ts`), update that `.ts` file by exporting the `SettingDescriptor` at the top.
|
|
67
|
+
* **CREATE**: Otherwise, create `<Module>Settings.ts` (e.g., `core/sdk/SDKSettings.ts`), add it to `sources` in `BUILD.gn`, and export it from the module's entrypoint (`sdk.ts`).
|
|
68
|
+
|
|
69
|
+
#### Code Definition Example:
|
|
70
|
+
Define and export the `SettingDescriptor` in the target file:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import type * as Common from '../core/common/common.js';
|
|
74
|
+
|
|
75
|
+
export const preserveConsoleLogSettingDescriptor: Common.Settings.SettingDescriptor<boolean> = {
|
|
76
|
+
name: 'preserve-console-log',
|
|
77
|
+
type: Common.Settings.SettingType.BOOLEAN,
|
|
78
|
+
defaultValue: false,
|
|
79
|
+
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
80
|
+
};
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
*Note: For conditional settings (dependent on `hostConfig`), use `Common.Settings.ConditionalSettingDescriptor<ValueT, ReasonT>` with an `isAvailable` function.*
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### Step 3: Move UI Registration to a Higher-Level `-meta.ts` File
|
|
88
|
+
If the original registration was in a `core/` or `models/` `-meta.ts` file (e.g., `core/sdk/sdk-meta.ts`), **MOVE** the UI registration to a higher-level `-meta.ts` file (e.g., `entrypoints/main/main-meta.ts` or `panels/console/console-meta.ts`).
|
|
89
|
+
|
|
90
|
+
In the higher-level `-meta.ts` file:
|
|
91
|
+
1. Import `SettingsUI` from `ui/settings/settings.js` (e.g., `import * as SettingsUI from '../../ui/settings/settings.js';`).
|
|
92
|
+
2. Import the `SettingDescriptor` (from `core/sdk/`, `models/`, or `ui/settings/`).
|
|
93
|
+
3. Register using `SettingsUI.SettingUIRegistration.register(...)`:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import * as SettingsUI from '../../ui/settings/settings.js';
|
|
97
|
+
import * as SDK from '../../core/sdk/sdk.js';
|
|
98
|
+
|
|
99
|
+
SettingsUI.SettingUIRegistration.register(SDK.SDKSettings.preserveConsoleLogSettingDescriptor, {
|
|
100
|
+
category: Common.Settings.SettingCategory.CONSOLE,
|
|
101
|
+
title: i18nLazyString(UIStrings.preserveLogUponNavigation),
|
|
102
|
+
options: [
|
|
103
|
+
{
|
|
104
|
+
value: true,
|
|
105
|
+
title: i18nLazyString(UIStrings.preserveLogUponNavigation),
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
value: false,
|
|
109
|
+
title: i18nLazyString(UIStrings.doNotPreserveLogUponNavigation),
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
4. **Delete** the old `Common.Settings.registerSettingExtension` call from the `core/` or `models/` `-meta.ts` file. (If the `-meta.ts` file becomes empty, delete the file and clean up its build references).
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### Step 4: Update Call Sites (`moduleSetting` to `resolve`)
|
|
120
|
+
Find all call sites referencing the setting via `moduleSetting`:
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
// BEFORE:
|
|
124
|
+
const setting = Common.Settings.Settings.instance().moduleSetting('preserve-console-log');
|
|
125
|
+
|
|
126
|
+
// AFTER:
|
|
127
|
+
import { preserveConsoleLogSettingDescriptor } from './SDKSettings.js';
|
|
128
|
+
...
|
|
129
|
+
const setting = Common.Settings.Settings.instance().resolve(preserveConsoleLogSettingDescriptor);
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
*For conditional settings, use `Common.Settings.Settings.instance().maybeResolve(descriptor)` instead of `resolve(descriptor)`.*
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### Step 5: Update `BUILD.gn` Files and Module Entrypoints
|
|
137
|
+
1. If a new `.ts` file was created (e.g., `SDKSettings.ts` or `ui/settings/ConsoleSettings.ts`):
|
|
138
|
+
* Add the file to `sources` in its module's `BUILD.gn`.
|
|
139
|
+
* Export the file from the module's entrypoint (`sdk.ts`, `settings.ts`, etc.).
|
|
140
|
+
2. If a `core/` or `models/` `-meta.ts` file was deleted, remove it from `BUILD.gn` and `devtools_grd_files.gni`.
|
|
141
|
+
3. Verify module imports strictly follow DevTools import rules (refer to `devtools-imports` skill).
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### Step 6: Verify Changes
|
|
146
|
+
1. Run `autoninja -C out/Default` to check GN build.
|
|
147
|
+
2. Run `npm run lint` to check style and formatting rules.
|
|
148
|
+
3. Run relevant unit tests for the modified module.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Concrete Examples
|
|
153
|
+
|
|
154
|
+
### Example 1: Core/SDK Setting Migration (`preserve-console-log`)
|
|
155
|
+
|
|
156
|
+
#### Before Migration
|
|
157
|
+
Setting registered in **`front_end/core/sdk/sdk-meta.ts`** *(Legacy core meta file)*:
|
|
158
|
+
```typescript
|
|
159
|
+
Common.Settings.registerSettingExtension({
|
|
160
|
+
category: Common.Settings.SettingCategory.CONSOLE,
|
|
161
|
+
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
162
|
+
title: i18nLazyString(UIStrings.preserveLogUponNavigation),
|
|
163
|
+
settingName: 'preserve-console-log',
|
|
164
|
+
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
165
|
+
defaultValue: false,
|
|
166
|
+
options: [...],
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Setting used in **`front_end/core/sdk/ResourceTreeModel.ts`**:
|
|
171
|
+
```typescript
|
|
172
|
+
const setting = Common.Settings.Settings.instance().moduleSetting('preserve-console-log');
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
#### After Migration
|
|
178
|
+
|
|
179
|
+
1. **`front_end/core/sdk/SDKSettings.ts`** *(Lowest Layer in Core — NOT a `-meta.ts` file)*:
|
|
180
|
+
```typescript
|
|
181
|
+
import type * as Common from '../common/common.js';
|
|
182
|
+
|
|
183
|
+
export const preserveConsoleLogSettingDescriptor: Common.Settings.SettingDescriptor<boolean> = {
|
|
184
|
+
name: 'preserve-console-log',
|
|
185
|
+
type: Common.Settings.SettingType.BOOLEAN,
|
|
186
|
+
defaultValue: false,
|
|
187
|
+
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
188
|
+
};
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
2. **`front_end/entrypoints/main/main-meta.ts`** *(Higher-Level Meta File — NOT in `core/` or `models/`)*:
|
|
192
|
+
```typescript
|
|
193
|
+
import * as SDK from '../../core/sdk/sdk.js';
|
|
194
|
+
import * as SettingsUI from '../../ui/settings/settings.js';
|
|
195
|
+
|
|
196
|
+
SettingsUI.SettingUIRegistration.register(SDK.SDKSettings.preserveConsoleLogSettingDescriptor, {
|
|
197
|
+
category: Common.Settings.SettingCategory.CONSOLE,
|
|
198
|
+
title: i18nLazyString(UIStrings.preserveLogUponNavigation),
|
|
199
|
+
options: [...],
|
|
200
|
+
});
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
3. **`front_end/core/sdk/ResourceTreeModel.ts`** *(Call Site in `core/sdk`)*:
|
|
204
|
+
```typescript
|
|
205
|
+
import { preserveConsoleLogSettingDescriptor } from './SDKSettings.js';
|
|
206
|
+
|
|
207
|
+
const setting = Common.Settings.Settings.instance().resolve(preserveConsoleLogSettingDescriptor);
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
4. **`front_end/core/sdk/sdk-meta.ts`**:
|
|
211
|
+
Registration for `'preserve-console-log'` removed.
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### Example 2: Panel UI Setting Migration (`network-messages`)
|
|
216
|
+
|
|
217
|
+
#### Before Migration
|
|
218
|
+
Setting registered in **`front_end/panels/console/console-meta.ts`**:
|
|
219
|
+
```typescript
|
|
220
|
+
Common.Settings.registerSettingExtension({
|
|
221
|
+
category: Common.Settings.SettingCategory.CONSOLE,
|
|
222
|
+
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
223
|
+
title: i18nLazyString(UIStrings.networkMessages),
|
|
224
|
+
settingName: 'network-messages',
|
|
225
|
+
settingType: Common.Settings.SettingType.BOOLEAN,
|
|
226
|
+
defaultValue: true,
|
|
227
|
+
options: [...],
|
|
228
|
+
});
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Setting used in **`front_end/panels/console/ConsoleView.ts`**:
|
|
232
|
+
```typescript
|
|
233
|
+
const setting = Common.Settings.Settings.instance().moduleSetting('network-messages');
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
#### After Migration
|
|
239
|
+
|
|
240
|
+
1. **`front_end/ui/settings/ConsoleSettings.ts`** *(Lowest Layer for UI/Panel Descriptor — NOT in `panels/console/`!)*:
|
|
241
|
+
```typescript
|
|
242
|
+
import type * as Common from '../../core/common/common.js';
|
|
243
|
+
|
|
244
|
+
export const networkMessagesSettingDescriptor: Common.Settings.SettingDescriptor<boolean> = {
|
|
245
|
+
name: 'network-messages',
|
|
246
|
+
type: Common.Settings.SettingType.BOOLEAN,
|
|
247
|
+
defaultValue: true,
|
|
248
|
+
storageType: Common.Settings.SettingStorageType.SYNCED,
|
|
249
|
+
};
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
2. **`front_end/panels/console/console-meta.ts`** *(Panel Meta File — Imports Descriptor from `ui/settings/`)*:
|
|
253
|
+
```typescript
|
|
254
|
+
import * as SettingsUI from '../../ui/settings/settings.js';
|
|
255
|
+
|
|
256
|
+
SettingsUI.SettingUIRegistration.register(SettingsUI.ConsoleSettings.networkMessagesSettingDescriptor, {
|
|
257
|
+
category: Common.Settings.SettingCategory.CONSOLE,
|
|
258
|
+
title: i18nLazyString(UIStrings.networkMessages),
|
|
259
|
+
options: [...],
|
|
260
|
+
});
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
3. **`front_end/panels/console/ConsoleView.ts`** *(Call Site in `panels/console`)*:
|
|
264
|
+
```typescript
|
|
265
|
+
import * as SettingsUI from '../../ui/settings/settings.js';
|
|
266
|
+
|
|
267
|
+
const setting = Common.Settings.Settings.instance().resolve(SettingsUI.ConsoleSettings.networkMessagesSettingDescriptor);
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Interface Reference Summary
|
|
273
|
+
|
|
274
|
+
### `SettingDescriptor<T>`
|
|
275
|
+
Defined in `core/common/Settings.ts`:
|
|
276
|
+
* `name: string`: Unique setting name (kebab-case).
|
|
277
|
+
* `type: SettingType`: `BOOLEAN`, `ENUM`, `ARRAY`, or `REGEX`.
|
|
278
|
+
* `defaultValue: ValueT | ((hostConfig: HostConfig) => ValueT)`: Default setting value.
|
|
279
|
+
* `storageType?: SettingStorageType`: `SYNCED`, `LOCAL`, `GLOBAL`, or `SESSION`.
|
|
280
|
+
|
|
281
|
+
### `SettingUIDescriptor`
|
|
282
|
+
Defined in `ui/settings/SettingUIRegistration.ts`:
|
|
283
|
+
* `category?: SettingCategory`: Category under which setting is listed in Settings UI.
|
|
284
|
+
* `order?: number`: Sorting order.
|
|
285
|
+
* `title?: () => LocalizedString`: Title string displayed in Settings UI.
|
|
286
|
+
* `tags?: Array<() => LocalizedString>`: Search tags for Command Menu.
|
|
287
|
+
* `options?: SettingExtensionOption[]`: Enum / boolean option descriptions.
|
|
288
|
+
* `reloadRequired?: boolean`: Whether setting change requires DevTools reload.
|
|
289
|
+
* `deprecationNotice?: { disabled: boolean, warning: () => LocalizedString, experiment?: string }`: Deprecation notice.
|
|
290
|
+
* `learnMore?: LearnMore`: Help link or tooltip info.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gerrit-cli
|
|
3
|
+
description: >-
|
|
4
|
+
Interacts with the public Gerrit Code Review platform using depot_tools'
|
|
5
|
+
gerrit_client.py. Use this skill when asked to query public CLs, retrieve
|
|
6
|
+
file revisions, add patchset comments, vote on review labels, submit changes,
|
|
7
|
+
or abandon/restore public CLs. Do not use this skill for Google-internal
|
|
8
|
+
attention set updates or internal AI-assisted code reviews (CRUAS) which are
|
|
9
|
+
unsupported by the public API.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Gerrit CLI Skill
|
|
13
|
+
|
|
14
|
+
Execute public Gerrit Code Review commands using `gerrit_client.py` from
|
|
15
|
+
depot_tools.
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
- **Environment**: Always execute the wrapper script using **`vpython3`** instead of `python3` to ensure all internal dependencies are satisfied.
|
|
20
|
+
|
|
21
|
+
- Ensure `gerrit_client.py` is available in the system `PATH` (typically part of
|
|
22
|
+
`depot_tools`). If `gerrit_client.py` is not available in your environment,
|
|
23
|
+
stop execution immediately.
|
|
24
|
+
- Use the wrapper script directly instead of an environment variable.
|
|
25
|
+
Substitute:
|
|
26
|
+
`vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py`
|
|
27
|
+
as the executable command in all examples and invocations.
|
|
28
|
+
|
|
29
|
+
## Just-in-Time (JiT) Loading Guidance
|
|
30
|
+
|
|
31
|
+
- Before running any Gerrit CLI command, read `references/commands.md`
|
|
32
|
+
to locate the required parameters and specific subcommand syntax.
|
|
33
|
+
- Before querying public CLs, adding comments, voting, or submitting changes,
|
|
34
|
+
read `references/workflows.md` for step-by-step procedures.
|
|
35
|
+
|
|
36
|
+
## Global Flags
|
|
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.
|
|
41
|
+
|
|
42
|
+
- **Default Host**: `https://chromium-review.googlesource.com`
|
|
43
|
+
- **Default Project**: `devtools/devtools-frontend`
|
|
44
|
+
- **JSON Output**: Always use the `--json_file=<path>` flag when querying
|
|
45
|
+
changes or fetching metadata to obtain structured, machine-readable output.
|
|
46
|
+
|
|
47
|
+
> [!CAUTION]
|
|
48
|
+
> **NEVER** use this to add patchset comments to an existing comment thread that
|
|
49
|
+
> contains human reviewers in it. Using an agent to reply to a human is a
|
|
50
|
+
> violation of Chromium's code of conduct.
|
|
51
|
+
>
|
|
52
|
+
> If the user requests this or you encounter this scenario as part of your work,
|
|
53
|
+
> inform the user about which comment threads cannot be updated but otherwise
|
|
54
|
+
> continue work.
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
> [!NOTE]
|
|
58
|
+
> This skill was adapted from the [Chromium Gerrit CLI skill](https://chromium.googlesource.com/chromium/agents/+/main/skills/gerrit-cli/)
|
|
59
|
+
> (automatically rolled in from upstream).
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Gerrit CLI Common Commands & Usage (Public)
|
|
2
|
+
|
|
3
|
+
Run the tool directly using the wrapper script path with the `--help` flag:
|
|
4
|
+
- `vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py --help`
|
|
5
|
+
- `vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py changes --help`
|
|
6
|
+
|
|
7
|
+
## Global Flags
|
|
8
|
+
|
|
9
|
+
Use the following global flags for all commands:
|
|
10
|
+
|
|
11
|
+
- `--host <url>` (e.g., `--host https://chromium-review.googlesource.com`).
|
|
12
|
+
- `--project <project_name>` (e.g., `--project chromium/src`).
|
|
13
|
+
- `--json_file <path>` (saves the structured response as a JSON file).
|
|
14
|
+
|
|
15
|
+
______________________________________________________________________
|
|
16
|
+
|
|
17
|
+
## Common Invocations
|
|
18
|
+
|
|
19
|
+
### 1. Inspecting and Searching Changes
|
|
20
|
+
|
|
21
|
+
- **Query active changes:**
|
|
22
|
+
```bash
|
|
23
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
24
|
+
changes \
|
|
25
|
+
--query "owner:self status:open"
|
|
26
|
+
```
|
|
27
|
+
- **View the content of a specific file in a change:**
|
|
28
|
+
```bash
|
|
29
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
30
|
+
content \
|
|
31
|
+
--json_file output.json \
|
|
32
|
+
--change <change_id> --revision <revision> --path <file_path>
|
|
33
|
+
```
|
|
34
|
+
- **Get related changes:**
|
|
35
|
+
```bash
|
|
36
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
37
|
+
relatedchanges \
|
|
38
|
+
--change <change_id> --revision <revision>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Reviewing and Voting
|
|
42
|
+
|
|
43
|
+
- **Add a patchset-level comment:**
|
|
44
|
+
```bash
|
|
45
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
46
|
+
addpatchsetcomment \
|
|
47
|
+
--change <change_id> --revision <revision> \
|
|
48
|
+
--message "Review findings: <message>"
|
|
49
|
+
```
|
|
50
|
+
- **Vote on a review label (e.g., Code-Review +1):**
|
|
51
|
+
```bash
|
|
52
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
53
|
+
setlabel \
|
|
54
|
+
--change <change_id> \
|
|
55
|
+
--label Code-Review 1
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. Actions and Shepherding
|
|
59
|
+
|
|
60
|
+
- **Submit/Merge a change:**
|
|
61
|
+
```bash
|
|
62
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
63
|
+
submitchange \
|
|
64
|
+
--change <change_id>
|
|
65
|
+
```
|
|
66
|
+
- **Abandon a change:**
|
|
67
|
+
```bash
|
|
68
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
69
|
+
abandon \
|
|
70
|
+
--change <change_id> \
|
|
71
|
+
--message "<reason>"
|
|
72
|
+
```
|
|
73
|
+
- **Restore an abandoned change:**
|
|
74
|
+
```bash
|
|
75
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
76
|
+
restore \
|
|
77
|
+
--change <change_id> \
|
|
78
|
+
--message "<reason>"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
______________________________________________________________________
|
|
82
|
+
|
|
83
|
+
## Just-in-Time Help
|
|
84
|
+
|
|
85
|
+
Explore the built-in CLI help for additional subcommands or advanced syntax:
|
|
86
|
+
|
|
87
|
+
- Display all top-level commands:
|
|
88
|
+
`vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py --help`
|
|
89
|
+
- Display help for a specific subcommand:
|
|
90
|
+
```bash
|
|
91
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
92
|
+
help <command>
|
|
93
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Gerrit CLI Workflows (Public)
|
|
2
|
+
|
|
3
|
+
## 1. Change List Review Workflow
|
|
4
|
+
|
|
5
|
+
Execute these steps in chronological order to review a Change List (CL) when
|
|
6
|
+
provided with a link or ID:
|
|
7
|
+
|
|
8
|
+
1. **Query CL Metadata**: Retrieve CL details and verify its current status:
|
|
9
|
+
```bash
|
|
10
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
11
|
+
changes \
|
|
12
|
+
--query "change:<id>"
|
|
13
|
+
```
|
|
14
|
+
2. **Fetch File Contents**: Retrieve the content of specific files modified in
|
|
15
|
+
the CL:
|
|
16
|
+
```bash
|
|
17
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
18
|
+
content \
|
|
19
|
+
--change <change_id> --revision current --path <file_path>
|
|
20
|
+
```
|
|
21
|
+
3. **Analyze Local Modifications**: Inspect the fetched contents and local diffs
|
|
22
|
+
for any logic or formatting issues.
|
|
23
|
+
4. **Add Review Comment**: Post a patchset-level comment containing the review
|
|
24
|
+
findings:
|
|
25
|
+
```bash
|
|
26
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
27
|
+
addpatchsetcomment \
|
|
28
|
+
--change <change_id> --revision current \
|
|
29
|
+
--message "Review findings: ..."
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 2. Shepherding & Submission Workflow
|
|
33
|
+
|
|
34
|
+
Execute these steps in chronological order to approve and merge a Change List:
|
|
35
|
+
|
|
36
|
+
1. **Check Related Changes**: Retrieve the status of all related changes to
|
|
37
|
+
ensure there are no unresolved blockers:
|
|
38
|
+
```bash
|
|
39
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
40
|
+
relatedchanges \
|
|
41
|
+
--change <change_id> --revision current
|
|
42
|
+
```
|
|
43
|
+
2. **Vote on Review Labels**: Apply the required Code-Review approval vote:
|
|
44
|
+
```bash
|
|
45
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
46
|
+
setlabel \
|
|
47
|
+
--change <change_id> \
|
|
48
|
+
--label Code-Review 1
|
|
49
|
+
```
|
|
50
|
+
3. **Submit Change**: Merge the change once all CQ presubmits pass and all
|
|
51
|
+
approval requirements are satisfied:
|
|
52
|
+
```bash
|
|
53
|
+
vpython3 .agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py \
|
|
54
|
+
submitchange \
|
|
55
|
+
--change <change_id>
|
|
56
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# Copyright 2026 The Chromium Authors
|
|
3
|
+
# Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
# found in the LICENSE file.
|
|
5
|
+
"""Helper wrapper script to run gerrit_client.py from PATH."""
|
|
6
|
+
|
|
7
|
+
import shutil
|
|
8
|
+
import subprocess
|
|
9
|
+
import sys
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def main():
|
|
13
|
+
client = shutil.which('gerrit_client.py')
|
|
14
|
+
if not client:
|
|
15
|
+
print('gerrit_client.py not found. '
|
|
16
|
+
'Is depot_tools available and added to PATH?')
|
|
17
|
+
sys.exit(1)
|
|
18
|
+
|
|
19
|
+
# DevTools specific defaults
|
|
20
|
+
default_args = [
|
|
21
|
+
'--host',
|
|
22
|
+
'https://chromium-review.googlesource.com',
|
|
23
|
+
'--project',
|
|
24
|
+
'devtools/devtools-frontend',
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
# gerrit_client.py expects: <command> [options] [args]
|
|
28
|
+
# We need to extract the command from sys.argv and put it first.
|
|
29
|
+
user_args = sys.argv[1:]
|
|
30
|
+
command = []
|
|
31
|
+
other_args = []
|
|
32
|
+
for i, arg in enumerate(user_args):
|
|
33
|
+
if not arg.startswith('-'):
|
|
34
|
+
command = [arg]
|
|
35
|
+
other_args = user_args[:i] + user_args[i + 1:]
|
|
36
|
+
break
|
|
37
|
+
else:
|
|
38
|
+
other_args = user_args
|
|
39
|
+
|
|
40
|
+
full_args = command + default_args + other_args
|
|
41
|
+
|
|
42
|
+
rc = subprocess.call(['vpython3', client] + full_args)
|
|
43
|
+
sys.exit(rc)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
if __name__ == '__main__':
|
|
47
|
+
main()
|