chrome-devtools-frontend 1.0.1698733 → 1.0.1700561
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-verification/SKILL.md +19 -0
- package/.agents/skills/{repro-flaky-tests → fix-tests}/SKILL.md +2 -2
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +2 -2
- package/front_end/core/sdk/DOMModel.ts +3 -5
- package/front_end/core/sdk/NetworkManager.ts +2 -2
- package/front_end/core/sdk/OverlayModel.ts +11 -12
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +3 -0
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +84 -32
- package/front_end/core/sdk/StorageBucketsModel.ts +2 -0
- package/front_end/entrypoints/main/GlobalAiButton.ts +2 -6
- package/front_end/entrypoints/main/MainImpl.ts +8 -1
- package/front_end/generated/InspectorBackendCommands.ts +12 -2
- package/front_end/generated/SupportedCSSProperties.ts +14 -0
- package/front_end/generated/protocol-mapping.d.ts +48 -1
- package/front_end/generated/protocol-proxy-api.d.ts +37 -1
- package/front_end/generated/protocol.ts +131 -0
- package/front_end/models/bindings/NetworkProject.ts +30 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +62 -0
- package/front_end/models/change_tracker/ChangeTracker.ts +1 -1
- package/front_end/models/comment_manager/CD4ABridge.ts +2 -2
- package/front_end/models/comment_manager/CommentManager.ts +18 -0
- package/front_end/models/emulation/DeviceModeModel.ts +1 -1
- package/front_end/models/extensions/ExtensionAPI.ts +4 -2
- package/front_end/models/issues_manager/CookieIssue.ts +0 -15
- package/front_end/models/persistence/NetworkPersistenceManager.ts +29 -4
- package/front_end/models/source_map_scopes/NamesResolver.ts +34 -4
- package/front_end/models/source_map_scopes/ScopeChainModel.ts +31 -7
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +281 -3
- package/front_end/panels/accessibility/accessibilityAnnouncementRecordingView.css +85 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -2
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +5 -8
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/application/AppManifestView.ts +128 -134
- package/front_end/panels/application/CrashReportContextView.ts +6 -6
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +17 -17
- package/front_end/panels/application/DeviceBoundSessionsView.ts +136 -137
- package/front_end/panels/application/IndexedDBModel.ts +3 -0
- package/front_end/panels/application/IndexedDBViews.ts +1 -1
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
- package/front_end/panels/application/OriginTrialTreeView.ts +18 -23
- package/front_end/panels/application/ReportingApiTreeElement.ts +3 -3
- package/front_end/panels/application/ReportingApiView.ts +6 -14
- package/front_end/panels/application/application-meta.ts +7 -7
- package/front_end/panels/application/components/AdsView.ts +63 -1
- package/front_end/panels/application/components/adsView.css +11 -1
- package/front_end/panels/common/CommentThreadWidget.ts +20 -22
- package/front_end/panels/common/CommentsOverlayWidget.ts +115 -9
- package/front_end/panels/common/CommentsStatusBarPill.ts +13 -1
- package/front_end/panels/common/ExtensionServer.ts +43 -34
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/common/commentThreadWidget.css +6 -0
- package/front_end/panels/common/common-meta.ts +4 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
- package/front_end/panels/elements/ElementsPanel.ts +4 -4
- package/front_end/panels/elements/ElementsTreeElement.ts +9 -2
- package/front_end/panels/elements/ElementsTreeOutline.ts +25 -33
- package/front_end/panels/elements/elementsTreeOutline.css +8 -4
- package/front_end/panels/event_listeners/EventListenersView.ts +9 -4
- package/front_end/panels/issues/IssuesPane.ts +34 -22
- package/front_end/panels/lighthouse/LighthouseController.ts +1 -1
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
- package/front_end/panels/network/RequestPayloadView.ts +17 -15
- package/front_end/panels/recorder/RecordingView.ts +32 -53
- package/front_end/panels/recorder/StepView.ts +19 -4
- package/front_end/panels/recorder/TimelineSection.ts +1 -1
- package/front_end/panels/recorder/controlButton.css +6 -0
- package/front_end/panels/recorder/recordingView.css +11 -2
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +2 -1
- package/front_end/panels/settings/EditFileSystemView.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +137 -56
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +17 -15
- package/front_end/panels/timeline/components/DetailsView.ts +3 -3
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +0 -2
- package/front_end/panels/timeline/components/LiveMetricsView.ts +59 -64
- package/front_end/panels/timeline/components/OriginMap.ts +1 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -3
- package/front_end/panels/timeline/components/liveMetricsView.css +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1580 -1524
- package/front_end/third_party/lighthouse/locales/ar-XB.json +111 -72
- package/front_end/third_party/lighthouse/locales/ar.json +113 -74
- package/front_end/third_party/lighthouse/locales/bg.json +112 -73
- package/front_end/third_party/lighthouse/locales/ca.json +112 -73
- package/front_end/third_party/lighthouse/locales/cs.json +112 -73
- package/front_end/third_party/lighthouse/locales/da.json +112 -73
- package/front_end/third_party/lighthouse/locales/de.json +112 -73
- package/front_end/third_party/lighthouse/locales/el.json +112 -73
- package/front_end/third_party/lighthouse/locales/en-GB.json +111 -72
- package/front_end/third_party/lighthouse/locales/en-US.json +102 -66
- package/front_end/third_party/lighthouse/locales/en-XA.json +111 -72
- package/front_end/third_party/lighthouse/locales/en-XL.json +102 -66
- package/front_end/third_party/lighthouse/locales/es-419.json +112 -73
- package/front_end/third_party/lighthouse/locales/es.json +112 -73
- package/front_end/third_party/lighthouse/locales/fi.json +112 -73
- package/front_end/third_party/lighthouse/locales/fil.json +112 -73
- package/front_end/third_party/lighthouse/locales/fr.json +112 -73
- package/front_end/third_party/lighthouse/locales/he.json +112 -73
- package/front_end/third_party/lighthouse/locales/hi.json +112 -73
- package/front_end/third_party/lighthouse/locales/hr.json +112 -73
- package/front_end/third_party/lighthouse/locales/hu.json +112 -73
- package/front_end/third_party/lighthouse/locales/id.json +112 -73
- package/front_end/third_party/lighthouse/locales/it.json +113 -74
- package/front_end/third_party/lighthouse/locales/ja.json +112 -73
- package/front_end/third_party/lighthouse/locales/ko.json +112 -73
- package/front_end/third_party/lighthouse/locales/lt.json +112 -73
- package/front_end/third_party/lighthouse/locales/lv.json +112 -73
- package/front_end/third_party/lighthouse/locales/nl.json +112 -73
- package/front_end/third_party/lighthouse/locales/no.json +112 -73
- package/front_end/third_party/lighthouse/locales/pl.json +112 -73
- package/front_end/third_party/lighthouse/locales/pt-PT.json +112 -73
- package/front_end/third_party/lighthouse/locales/pt.json +112 -73
- package/front_end/third_party/lighthouse/locales/ro.json +112 -73
- package/front_end/third_party/lighthouse/locales/ru.json +112 -73
- package/front_end/third_party/lighthouse/locales/sk.json +112 -73
- package/front_end/third_party/lighthouse/locales/sl.json +112 -73
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +112 -73
- package/front_end/third_party/lighthouse/locales/sr.json +112 -73
- package/front_end/third_party/lighthouse/locales/sv.json +124 -85
- package/front_end/third_party/lighthouse/locales/ta.json +112 -73
- package/front_end/third_party/lighthouse/locales/te.json +112 -73
- package/front_end/third_party/lighthouse/locales/th.json +112 -73
- package/front_end/third_party/lighthouse/locales/tr.json +113 -74
- package/front_end/third_party/lighthouse/locales/uk.json +112 -73
- package/front_end/third_party/lighthouse/locales/vi.json +112 -73
- package/front_end/third_party/lighthouse/locales/zh-HK.json +112 -73
- package/front_end/third_party/lighthouse/locales/zh-TW.json +113 -74
- package/front_end/third_party/lighthouse/locales/zh.json +113 -74
- package/front_end/third_party/lighthouse/report/bundle.d.ts +4 -4
- package/front_end/third_party/lighthouse/report/bundle.js +10 -3
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +2 -2
- package/front_end/third_party/lit/lit.ts +3 -0
- package/front_end/third_party/lit/package.json +3 -0
- package/front_end/third_party/lit/rebuild.sh +3 -2
- package/front_end/ui/comments/CommentAnchorResolver.ts +8 -2
- package/front_end/ui/comments/CommentOverlayManager.ts +2 -1
- package/front_end/ui/components/buttons/Button.ts +19 -1
- package/front_end/ui/legacy/ContextMenu.ts +16 -1
- package/front_end/ui/legacy/InspectorView.ts +4 -3
- package/front_end/ui/legacy/PlusButton.ts +5 -6
- package/front_end/ui/legacy/TabbedPane.ts +121 -80
- package/front_end/ui/legacy/Treeoutline.ts +37 -6
- package/front_end/ui/legacy/UIUtils.ts +7 -0
- package/front_end/ui/legacy/Widget.ts +33 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +3 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +14 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +157 -171
- package/front_end/ui/lit/lit.ts +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/inspector_overlay/highlight_anchor.ts +197 -0
- package/inspector_overlay/tool_highlight.ts +8 -0
- package/package.json +1 -1
- package/.agents/skills/devtools-ci/SKILL.md +0 -65
- package/.agents/skills/evaluate-ai-css-completion/SKILL.md +0 -143
- package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +0 -104
- package/.agents/skills/fixing-skipped-tests/SKILL.md +0 -32
- package/.agents/skills/gerrit-cli/SKILL.md +0 -74
- package/.agents/skills/gerrit-cli/references/commands.md +0 -169
- package/.agents/skills/gerrit-cli/references/workflows.md +0 -63
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +0 -85
- package/front_end/models/issues_manager/descriptions/cookieExcludeBlockedWithinRelatedWebsiteSet.md +0 -4
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
# Gerrit CLI Common Commands & Usage (Public)
|
|
2
|
-
|
|
3
|
-
Run `gerrit_client.py` directly with the `--help` flag:
|
|
4
|
-
|
|
5
|
-
- `gerrit_client.py --help`
|
|
6
|
-
- `gerrit_client.py changes --help`
|
|
7
|
-
|
|
8
|
-
## Global Flags
|
|
9
|
-
|
|
10
|
-
Use the following global flags for all commands:
|
|
11
|
-
|
|
12
|
-
- `--host <url>` (e.g., `--host https://chromium-review.googlesource.com`).
|
|
13
|
-
- `--project <project_name>` (e.g., `--project chromium/src`).
|
|
14
|
-
- `--json_file <path>` (saves the structured response as a JSON file).
|
|
15
|
-
|
|
16
|
-
______________________________________________________________________
|
|
17
|
-
|
|
18
|
-
## Common Invocations
|
|
19
|
-
|
|
20
|
-
### 1. Inspecting and Searching Changes
|
|
21
|
-
|
|
22
|
-
- **Query active changes:**
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
gerrit_client.py \
|
|
26
|
-
changes \
|
|
27
|
-
--host https://chromium-review.googlesource.com \
|
|
28
|
-
--query "owner:self status:open"
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
- **Get published file and line comments across patchsets:**
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
gerrit_client.py \
|
|
35
|
-
comments \
|
|
36
|
-
--host https://chromium-review.googlesource.com \
|
|
37
|
-
--change <change_id> \
|
|
38
|
-
--json_file <path>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
This writes the unchanged structured Gerrit JSON to `--json_file`. Filtering,
|
|
42
|
-
threading, and presentation are the caller's responsibility.
|
|
43
|
-
|
|
44
|
-
- **View the content of a specific file in a change:**
|
|
45
|
-
|
|
46
|
-
**Note:** This command does not work with the `--json_file` flag, instead use
|
|
47
|
-
stdout redirection (`>`).
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
gerrit_client.py \
|
|
51
|
-
content \
|
|
52
|
-
--host https://chromium-review.googlesource.com \
|
|
53
|
-
--project <project> \
|
|
54
|
-
--change <change_id> \
|
|
55
|
-
--revision <revision> \
|
|
56
|
-
--path <file_path> \
|
|
57
|
-
> output_file
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
- **Get a formatted patch for a change:**
|
|
61
|
-
|
|
62
|
-
`--revision <revision>` is optional and defaults to `current`. Use the
|
|
63
|
-
optional `--path <file_path>`, `--parent <parent_number>`, and
|
|
64
|
-
`--context <lines>` flags to customize the patch.
|
|
65
|
-
|
|
66
|
-
**Note:** Decoded formatted patch bytes are written to stdout, so redirect
|
|
67
|
-
them to a file (`>`). The `--json_file` flag is not used for patch bytes.
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
gerrit_client.py \
|
|
71
|
-
patch \
|
|
72
|
-
--host https://chromium-review.googlesource.com \
|
|
73
|
-
--change <change_id> \
|
|
74
|
-
> output.patch
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
- **Get related changes:**
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
gerrit_client.py \
|
|
81
|
-
relatedchanges \
|
|
82
|
-
--host https://chromium-review.googlesource.com \
|
|
83
|
-
--change <change_id> --revision <revision>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### 2. Reviewing and Voting
|
|
87
|
-
|
|
88
|
-
- **Add a patchset-level comment:**
|
|
89
|
-
```bash
|
|
90
|
-
gerrit_client.py \
|
|
91
|
-
addpatchsetcomment \
|
|
92
|
-
--host https://chromium-review.googlesource.com \
|
|
93
|
-
--change <change_id> --revision <revision> \
|
|
94
|
-
--message "Review findings: <message>"
|
|
95
|
-
```
|
|
96
|
-
- **Vote on a review label (e.g., Code-Review +1):**
|
|
97
|
-
```bash
|
|
98
|
-
gerrit_client.py \
|
|
99
|
-
setlabel \
|
|
100
|
-
--host https://chromium-review.googlesource.com \
|
|
101
|
-
--change <change_id> \
|
|
102
|
-
--label Code-Review 1
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### 3. Actions and Shepherding
|
|
106
|
-
|
|
107
|
-
- **Submit/Merge a change:**
|
|
108
|
-
```bash
|
|
109
|
-
gerrit_client.py \
|
|
110
|
-
submitchange \
|
|
111
|
-
--host https://chromium-review.googlesource.com \
|
|
112
|
-
--change <change_id>
|
|
113
|
-
```
|
|
114
|
-
- **Abandon a change:**
|
|
115
|
-
```bash
|
|
116
|
-
gerrit_client.py \
|
|
117
|
-
abandon \
|
|
118
|
-
--host https://chromium-review.googlesource.com \
|
|
119
|
-
--change <change_id> \
|
|
120
|
-
--message "<reason>"
|
|
121
|
-
```
|
|
122
|
-
- **Restore an abandoned change:**
|
|
123
|
-
```bash
|
|
124
|
-
gerrit_client.py \
|
|
125
|
-
restore \
|
|
126
|
-
--host https://chromium-review.googlesource.com \
|
|
127
|
-
--change <change_id> \
|
|
128
|
-
--message "<reason>"
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
______________________________________________________________________
|
|
132
|
-
|
|
133
|
-
## Just-in-Time Help
|
|
134
|
-
|
|
135
|
-
Explore the built-in CLI help for additional subcommands or advanced syntax:
|
|
136
|
-
|
|
137
|
-
- Display all top-level commands:
|
|
138
|
-
`gerrit_client.py --help`
|
|
139
|
-
- Display help for a specific subcommand:
|
|
140
|
-
```bash
|
|
141
|
-
gerrit_client.py \
|
|
142
|
-
help <command>
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## Advanced / Escape Hatch: Arbitrary REST API Calls (`rawapi`)
|
|
146
|
-
|
|
147
|
-
If the built-in subcommands do not cover a specific action or metadata query,
|
|
148
|
-
you can use the `rawapi` subcommand to execute arbitrary HTTP requests against
|
|
149
|
-
the Gerrit REST API.
|
|
150
|
-
|
|
151
|
-
- **Endpoint Reference**:
|
|
152
|
-
[Gerrit REST API - Changes](https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html)
|
|
153
|
-
|
|
154
|
-
### Usage
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
gerrit_client.py \
|
|
158
|
-
rawapi \
|
|
159
|
-
--host https://chromium-review.googlesource.com \
|
|
160
|
-
--path "/changes/<change_id>/detail?o=SUBMITTABLE" \
|
|
161
|
-
--json_file output.json
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
- **Options**:
|
|
165
|
-
- `--path`: HTTP path of the API endpoint (e.g.
|
|
166
|
-
`/changes/<change_id>/revisions/current/mergeable`).
|
|
167
|
-
- `--method`: HTTP method (GET, POST, PUT, DELETE). Defaults to GET.
|
|
168
|
-
- `--body`: JSON string body for write requests (e.g., POST/PUT).
|
|
169
|
-
- `--accept_status`: Comma-separated list of successful HTTP status codes.
|
|
@@ -1,63 +0,0 @@
|
|
|
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
|
-
gerrit_client.py \
|
|
11
|
-
changes \
|
|
12
|
-
--host https://chromium-review.googlesource.com \
|
|
13
|
-
--query "change:<id>"
|
|
14
|
-
```
|
|
15
|
-
2. **Fetch File Contents**: Retrieve the content of specific files modified in
|
|
16
|
-
the CL:
|
|
17
|
-
```bash
|
|
18
|
-
gerrit_client.py \
|
|
19
|
-
content \
|
|
20
|
-
--host https://chromium-review.googlesource.com \
|
|
21
|
-
--project <project> \
|
|
22
|
-
--change <change_id> --revision current --path <file_path>
|
|
23
|
-
```
|
|
24
|
-
3. **Analyze Local Modifications**: Inspect the fetched contents and local diffs
|
|
25
|
-
for any logic or formatting issues.
|
|
26
|
-
4. **Add Review Comment**: Post a patchset-level comment containing the review
|
|
27
|
-
findings:
|
|
28
|
-
```bash
|
|
29
|
-
gerrit_client.py \
|
|
30
|
-
addpatchsetcomment \
|
|
31
|
-
--host https://chromium-review.googlesource.com \
|
|
32
|
-
--change <change_id> --revision current \
|
|
33
|
-
--message "Review findings: ..."
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## 2. Shepherding & Submission Workflow
|
|
37
|
-
|
|
38
|
-
Execute these steps in chronological order to approve and merge a Change List:
|
|
39
|
-
|
|
40
|
-
1. **Check Related Changes**: Retrieve the status of all related changes to
|
|
41
|
-
ensure there are no unresolved blockers:
|
|
42
|
-
```bash
|
|
43
|
-
gerrit_client.py \
|
|
44
|
-
relatedchanges \
|
|
45
|
-
--host https://chromium-review.googlesource.com \
|
|
46
|
-
--change <change_id> --revision current
|
|
47
|
-
```
|
|
48
|
-
2. **Vote on Review Labels**: Apply the required Code-Review approval vote:
|
|
49
|
-
```bash
|
|
50
|
-
gerrit_client.py \
|
|
51
|
-
setlabel \
|
|
52
|
-
--host https://chromium-review.googlesource.com \
|
|
53
|
-
--change <change_id> \
|
|
54
|
-
--label Code-Review 1
|
|
55
|
-
```
|
|
56
|
-
3. **Submit Change**: Merge the change once all CQ presubmits pass and all
|
|
57
|
-
approval requirements are satisfied:
|
|
58
|
-
```bash
|
|
59
|
-
gerrit_client.py \
|
|
60
|
-
submitchange \
|
|
61
|
-
--host https://chromium-review.googlesource.com \
|
|
62
|
-
--change <change_id>
|
|
63
|
-
```
|
|
@@ -1,85 +0,0 @@
|
|
|
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
|
-
"""Imports the Gerrit CLI skill from upstream and adapts it for DevTools."""
|
|
6
|
-
|
|
7
|
-
import io
|
|
8
|
-
import re
|
|
9
|
-
import subprocess
|
|
10
|
-
import sys
|
|
11
|
-
import tarfile
|
|
12
|
-
import tempfile
|
|
13
|
-
import urllib.request
|
|
14
|
-
from pathlib import Path
|
|
15
|
-
|
|
16
|
-
UPSTREAM_URL = "https://chromium.googlesource.com/chromium/agents/+archive/refs/heads/main/skills/gerrit-cli.tar.gz"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def fetch_upstream_skill(target_dir: Path):
|
|
20
|
-
print(f"Downloading upstream skill from {UPSTREAM_URL}...")
|
|
21
|
-
req = urllib.request.Request(UPSTREAM_URL,
|
|
22
|
-
headers={'User-Agent': 'Mozilla/5.0'})
|
|
23
|
-
with urllib.request.urlopen(req) as resp:
|
|
24
|
-
tar_data = resp.read()
|
|
25
|
-
|
|
26
|
-
print(f"Extracting docs to {target_dir}...")
|
|
27
|
-
with tarfile.open(fileobj=io.BytesIO(tar_data), mode='r:gz') as tar:
|
|
28
|
-
# Only extract docs (SKILL.md & references), skip unused upstream wrapper scripts
|
|
29
|
-
docs = [
|
|
30
|
-
m for m in tar.getmembers() if not m.name.startswith("scripts/")
|
|
31
|
-
]
|
|
32
|
-
tar.extractall(path=target_dir, members=docs)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def apply_devtools_revisions(target_dir: Path):
|
|
36
|
-
print("Adapting skill for DevTools...")
|
|
37
|
-
for md_path in target_dir.rglob("*.md"):
|
|
38
|
-
content = md_path.read_text()
|
|
39
|
-
|
|
40
|
-
# Direct gerrit_client.py execution instead of wrapper script
|
|
41
|
-
content = re.sub(
|
|
42
|
-
r'-\s+Use the wrapper script directly[^\n]*\n\s+Substitute:\s*\n\s+`[^`]+`\s*\n\s+as the executable command[^\n]*',
|
|
43
|
-
'- Execute `gerrit_client.py` directly for all commands and invocations.',
|
|
44
|
-
content)
|
|
45
|
-
content = re.sub(
|
|
46
|
-
r'Run the tool directly using the wrapper script path with the `--help` flag:',
|
|
47
|
-
'Run `gerrit_client.py` directly with the `--help` flag:', content)
|
|
48
|
-
content = re.sub(
|
|
49
|
-
r'(?:v)?python3\s+(?:\.agents/skills|agents/shared/skills)/gerrit-cli/(?:scripts/gerrit_client_wrapper\.py)?',
|
|
50
|
-
'gerrit_client.py', content)
|
|
51
|
-
|
|
52
|
-
if md_path.name == "SKILL.md" and "> [!NOTE]" not in content:
|
|
53
|
-
content += """
|
|
54
|
-
> [!NOTE]
|
|
55
|
-
> This skill was adapted from the [Chromium Gerrit CLI skill](https://chromium.googlesource.com/chromium/agents/+/main/skills/gerrit-cli/)
|
|
56
|
-
> (automatically rolled in from upstream).
|
|
57
|
-
"""
|
|
58
|
-
md_path.write_text(content)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def validate_gerrit_client():
|
|
62
|
-
print("Validating gerrit_client.py...")
|
|
63
|
-
with tempfile.NamedTemporaryFile(suffix=".json") as tmp:
|
|
64
|
-
subprocess.run([
|
|
65
|
-
"gerrit_client.py", "changes", "--query", "change:8147179",
|
|
66
|
-
"--host", "https://chromium-review.googlesource.com",
|
|
67
|
-
"--json_file", tmp.name
|
|
68
|
-
],
|
|
69
|
-
check=True,
|
|
70
|
-
capture_output=True)
|
|
71
|
-
if b"8147179" not in Path(tmp.name).read_bytes():
|
|
72
|
-
sys.exit("Validation failed: query response invalid")
|
|
73
|
-
print(" - Validation passed successfully!")
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def main():
|
|
77
|
-
skill_dir = Path(__file__).parent.parent.resolve()
|
|
78
|
-
fetch_upstream_skill(skill_dir)
|
|
79
|
-
apply_devtools_revisions(skill_dir)
|
|
80
|
-
validate_gerrit_client()
|
|
81
|
-
print("Upstream sync completed successfully!")
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if __name__ == "__main__":
|
|
85
|
-
main()
|