Skip to content

Commit fff2da2

Browse files
committed
Merge branch 'chrome-base' of github.com:PerfLab-io/devtools-frontend
2 parents b2e3cea + e53fe65 commit fff2da2

File tree

33,753 files changed

+5814395
-232327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

33,753 files changed

+5814395
-232327
lines changed

.clang-format-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Void parent level config to enable formatting.

.gemini/OWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
file://config/owner/COMMON_OWNERS
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
description = "Migrates a test file to the e2e_non_hosted folder"
2+
prompt = """
3+
# Task: Migrates a test file to the e2e_non_hosted format.
4+
5+
**The user's raw command is appended below your instructions.**
6+
7+
Your task is to parse the `<original_test_file>`, `<target_test_file>`, and `<issue_id>` from their input
8+
and migrate `<original_test_file>` to the `<target_test_file>`.
9+
10+
## Expected Format
11+
The command follows this format: `/migrate-e2e-non-hosted <original_test_file> <target_test_file> <issue_id>`
12+
13+
## Step-by-step instructions
14+
15+
Step by step instructions:
16+
17+
1) Read all tests in @<target_test_file> as examples to understand the aspects of the already migrated files.
18+
2) Read all files in @test/e2e_non_hosted/shared.
19+
3) Read the non-migrated test file @<original_test_file>.
20+
4) Read relevant helpers files imported from the test file.
21+
5) Create an empty file for the migrated test @<target_test_file>.
22+
6) Update BUILD.gn files to include the new file into the build and remove it from the BUILD.gn files in the e2e folder.
23+
7) Migrate the test file following the following instructions:
24+
25+
- each test function should receive a 'devToolsPage' via its arguments and 'inspectedPage' if needed.
26+
- when calling helpers pass the 'devToolsPage' as the last argument.
27+
- update the helpers that are used by the test to accept 'devToolsPage' as the last argument if needed. CRITICAL: DO NOT UPDATE helpers if an equivalent already exists on the 'DevToolsPage'. Remember that $$, $, waitFor, click, hover, typeText helpers are available directly on devToolsPage. Rewrite accordingly.
28+
- keep the helpers from @test/e2e/helpers in place.
29+
- in helpers, the 'devToolsPage' argument should be the last one and it should be optional defaulting to 'getBrowserAndPagesWrappers().devToolsPage'.
30+
- use the globally available 'setup' function define experiments and flags for the test.
31+
- rewrite any beforeEach/afterEach hooks to be local helper functions called from the test directly.
32+
- instead of using 'devToolsPage.keyboard.press' use 'devToolsPage.keyboard.pressKey'.
33+
- instead of using global 'click' use 'devToolsPage.click'.
34+
35+
8) After you are done with changes, run 'npm run test -- -t StrictTypes <target_test_file>' to verify.
36+
9) Delete the original test file.
37+
10) Create a new branch `git checkout -b fixed-<issue_id>`.
38+
11) Commit the changes with the message 'Migrate <original_test_file>'
39+
12) Run 'git cl presubmit --upload'
40+
13) Run 'git cl upload -a -s -d -f --hashtag=migration-ai -x <issue_id>' to upload the change.
41+
14) Fix any lint issues. You may have to re-commit if files changed. When re-committing, amend the initial commit to preserve the commit message.
42+
43+
"""

.gemini/commands/review.toml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
description = "Reviews the latest commit"
2+
prompt = """
3+
You are an AI assistant programmed to perform meticulous, context-aware code reviews using the tools available in the Gemini CLI. Your task is to review the latest `git` commit.
4+
5+
**Workflow:**
6+
7+
1. **Identify Changes:** Use the `git` tool to get the commit message and identify all files modified in the latest commit.
8+
2. **Review Individually:** Process each changed file one by one.
9+
3. **Gather Full Context:** For each file, get its specific code diff. Crucially, to understand the full impact of a change, use tools to read other, unchanged files in the repository as needed (e.g., to see a function definition, a class signature, or a constant that is referenced in the changed code).
10+
11+
**Analysis and Reporting:**
12+
13+
After gathering the full context for a change, analyze it against the detailed checklist below. Format your findings precisely according to the specified output structure.
14+
15+
---
16+
17+
**Review Checklist:**
18+
19+
1. **Functionality & Intent:**
20+
* Does the code appear to achieve the stated goal described in the commit message?
21+
* Are there logical flaws preventing it? Does it fully address the problem/feature described?
22+
2. **Correctness:**
23+
* Is the implementation logic sound? Any apparent errors?
24+
* Are patterns (e.g., Revealers, event handling, state management) used correctly per conventions or best practices?
25+
* Is data/state propagation robust? Any potential inconsistencies?
26+
* Is lookup logic (e.g., finding elements/data) safe against null/undefined/missing cases?
27+
* Are types used correctly/consistently?
28+
* Are component/object lifecycle methods used appropriately (initialization, cleanup)?
29+
3. **Asynchronicity:**
30+
* Is the usage of `async`/`await`, Promises, `setTimeout`, UI framework async helpers correct and necessary?
31+
* Any potential race conditions?
32+
* Is async operation cancellation handled where needed?
33+
4. **Resource Management:**
34+
* **Critical:** Examine timers (`setTimeout`, `setInterval`), event listeners (`addEventListener`), subscriptions, WebSockets, file handles, manual DOM manipulations outside framework lifecycles, etc.
35+
* **Verify explicit cleanup:** Is there corresponding cleanup logic (e.g., `removeEventListener`, `clearTimeout`, `clearInterval`, `.unsubscribe()`, `.close()`, framework-specific cleanup hooks) in appropriate lifecycle methods (e.g., `disconnectedCallback`, `useEffect` cleanup, `ngOnDestroy`, `finally`) to prevent leaks when the component/object is destroyed or the resource is no longer needed?
36+
5. **Error Handling & Edge Cases:**
37+
* Is error handling present and robust for expected failures (e.g., network, API, data validation, file operations)?
38+
* Are edge cases handled gracefully (e.g., empty inputs, nulls, zeros, boundary conditions, unexpected data types)?
39+
6. **Performance:**
40+
* Any obvious performance bottlenecks (e.g., inefficient loops, excessive re-renders/recalculations, large memory allocations, blocking operations on main thread)?
41+
* Any clear opportunities for optimization (e.g., memoization, lazy loading, debouncing/throttling)?
42+
7. **Security:**
43+
* Any potential security risks (e.g., improper handling of user input (XSS), insecure API usage, exposing sensitive data)? (Basic check)
44+
8. **Accessibility (a11y):** (Especially for UI/HTML changes)
45+
* Is semantic HTML used correctly (e.g., `<button>` for buttons, `<nav>` for navigation)?
46+
* Are necessary ARIA attributes used appropriately for custom components or complex interactions?
47+
* Is content perceivable (e.g., sufficient color contrast, alternatives for non-text content)?
48+
* Is functionality operable via keyboard? Are focus states managed correctly?
49+
9. **Testability:**
50+
* Is the code structured in a way that facilitates unit or integration testing?
51+
* Are there clear dependencies that might hinder testing? Could dependency injection help?
52+
* Based on the change, are new tests needed or existing tests require updates? (Consider this even if tests aren't in the CL).
53+
10. **Code Style, Readability & Documentation:**
54+
* Any significant issues impacting readability or maintainability beyond automated linting (e.g., unclear variable/function names, overly complex logic, magic numbers/strings)?
55+
* Are comments present for complex or non-obvious logic? Are existing comments accurate and up-to-date?
56+
* Is code documentation (e.g., JSDoc, TSDoc) needed or updated for public APIs or complex functions?
57+
11. **CSS/Styling (if applicable):** Is CSS correct, efficient, maintainable? Does it follow conventions? Any potential style conflicts or specificity issues?
58+
59+
---
60+
61+
**Output:**
62+
63+
Generate code review feedback as a series of structured comment blocks. Each block must correspond to a **single, concrete identified issue** and follow this **exact format**. **Crucially, do not use Markdown headings (#, ##, ---, === under text) for the labels (File:, Line:, Context:, Comment:).** Use the specified separator `***` between comments.
64+
65+
File: <path/to/relevant/file.ext>
66+
Line: <line_number_of_issue_or_most_relevant_line>
67+
Context:
68+
```
69+
<Code from line_number_or_relevant_line - 1>
70+
<Code from line_number_or_relevant_line>
71+
<Code from line_number_or_relevant_line + 1>
72+
```
73+
74+
Comment: <Your specific, **concrete**, and actionable review comment. Clearly explain the **identified** issue (not a potential or speculative one). If suggesting alternatives or pointing out omissions, provide **specific examples** where possible. Ask clarifying questions only if essential information seems missing in the CL for analysis. Phrased objectively and concisely.>
75+
***
76+
77+
# Guidelines for Output:
78+
79+
* Replace placeholders `<...>` with actual values based on your analysis.
80+
* **Formatting:** Ensure the labels `File:`, `Line:`, `Context:`, `Comment:` start on new lines and are treated as plain text, not Markdown headings.
81+
* For `Line:`, use the specific line number where the issue occurs. If the issue spans a block or concerns a general aspect of a function/file (e.g., missing cleanup for a resource initialized elsewhere), use the most representative line number within that context (e.g., the function definition line, the resource initialization line).
82+
* For `Context:`, provide exactly one line of code before and one line after the target line number, **wrapped in its own triple-backtick code block**. Ensure these context lines accurately reflect the code surrounding the specified line. If the target line is the first or last line of the file, provide only the available context line(s) within the code block.
83+
* Ensure each `Comment:` targets a single, distinct, and concrete issue identified from the checklist analysis. The comment text itself *can* contain Markdown formatting (like bolding), but should not start with heading markers.
84+
* Generate one complete block (including the `***` separator) for each concrete issue found. The blocks should be sequential.
85+
"""

.geminiignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
/third_party/
3+
front_end/core/i18n/locales/*.json
4+
front_end/third_party/lighthouse/locales/*.json
5+
front_end/third_party/puppeteer/package/lib/cjs/
6+
front_end/panels/timeline/fixtures/traces/

.git-blame-ignore-revs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,11 @@ aaf6c64ae8d791f878599bf2cea8a9b1e6a5001c
349349

350350
# Always add braces to single-line if-statements (https://crrev.com/c/1821526)
351351
1d6e57a0e314d709029cac52b98898b828f45a12
352+
353+
# [AI Assistance] Renames and refactorings (https://crrev.com/c/6080811)
354+
786bd4290956c5b8560a03cf73d860572559e382
355+
356+
# RPP mass-renames. https://crrev.com/c/5867685 https://crrev.com/c/6191870 https://crrev.com/c/6190947
357+
8da83d7f627b0588b1c49d7761a90368efbfed73
358+
b1b834b0a1f9e61213fba85d8bc4a3c9ccfdefd7
359+
a59de5d27b5977b0bb8d260634f1d8d45e69cfdf

.gitallowed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# This key is expected to be visible in the frontend code
22
# b/349721878
33
CRUX_API_KEY
4+
# Publicly-visible API key for Firebase analytics, used in NetworkRequestHandler.test.ts
5+
AIzaSyCGxLbbFQxH4BV1fY0RODlxTos9nJa2l_g
46

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
package-lock.json binary
2+
front_end/ui/visual_logging/KnownContextValues.ts merge=union
23
# Automatically normalize line endings (to LF) for all text-based files.
3-
* text=auto eol=lf
4+
* text=auto eol=lf

.github/OWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
file://config/owner/INFRA_OWNERS
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Auto-close PRs
2+
3+
permissions:
4+
pull-requests: write
5+
issues: write
6+
7+
on:
8+
schedule:
9+
# Run everyday at: https://crontab.guru/#0_6_*_*_*.
10+
- cron: '0 6 * * *'
11+
workflow_dispatch:
12+
13+
jobs:
14+
auto-close:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
sparse-checkout: |
20+
.github
21+
- name: Close open pull requests
22+
shell: bash
23+
env:
24+
GH_TOKEN: ${{ github.token }}
25+
run: |
26+
PRS=$(gh pr list --state=open --repo=ChromeDevTools/devtools-frontend --json number --jq '.[].number')
27+
for PR in $PRS; do
28+
# See https://cli.github.com/manual/gh_pr_close
29+
gh pr close --comment "Auto-closing the pull request because we do not accept PRs via the GitHub mirror. See README.md on how to contribute to DevTools." $PR
30+
done

0 commit comments

Comments
 (0)