Skip to content

Commit cf67383

Browse files
committed
merge in master
2 parents ce29252 + 7dabb7c commit cf67383

File tree

100 files changed

+2945
-1539
lines changed

Some content is hidden

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

100 files changed

+2945
-1539
lines changed

.github/workflows/jscpd.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"pattern": "packages/**/*.ts",
3+
"ignore": ["**node_modules**", "**dist**"],
4+
"gitignore": true,
5+
"threshold": 1.34,
6+
"minLines": 15
7+
}

.github/workflows/node.js.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest
4242
strategy:
4343
matrix:
44-
node-version: [16.x]
44+
node-version: [18.x]
4545
vscode-version: [stable]
4646
env:
4747
NODE_OPTIONS: '--max-old-space-size=8192'
@@ -55,14 +55,32 @@ jobs:
5555
- run: npm run testCompile
5656
- run: npm run lint
5757

58+
jscpd:
59+
needs: lint-commits
60+
runs-on: ubuntu-latest
61+
strategy:
62+
matrix:
63+
node-version: [18.x]
64+
env:
65+
NODE_OPTIONS: '--max-old-space-size=8192'
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Use Node.js ${{ matrix.node-version }}
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version: ${{ matrix.node-version }}
72+
- run: npm install jscpd
73+
- name: Run jscpd
74+
run: npx jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json"
75+
5876
macos:
5977
needs: lint-commits
6078
name: test macOS
6179
runs-on: macos-latest
6280
strategy:
6381
fail-fast: false
6482
matrix:
65-
node-version: [16.x]
83+
node-version: [18.x]
6684
vscode-version: [minimum, stable, insiders]
6785
env:
6886
VSCODE_TEST_VERSION: ${{ matrix.vscode-version }}
@@ -110,7 +128,7 @@ jobs:
110128
strategy:
111129
fail-fast: true
112130
matrix:
113-
node-version: [16.x]
131+
node-version: [18.x]
114132
vscode-version: [stable, insiders]
115133
env:
116134
VSCODE_TEST_VERSION: ${{ matrix.vscode-version }}
@@ -136,7 +154,7 @@ jobs:
136154
strategy:
137155
fail-fast: false
138156
matrix:
139-
node-version: [16.x]
157+
node-version: [18.x]
140158
vscode-version: [stable, insiders]
141159
env:
142160
VSCODE_TEST_VERSION: ${{ matrix.vscode-version }}

buildspec/linuxIntegrationTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ phases:
2121
install:
2222
run-as: root
2323
runtime-versions:
24-
nodejs: 16
24+
nodejs: 18
2525
dotnet: 6.0
2626
java: latest
2727

buildspec/linuxTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ phases:
1818
install:
1919
run-as: root
2020
runtime-versions:
21-
nodejs: 16
21+
nodejs: 18
2222
commands:
2323
- bash buildspec/shared/linux-install.sh
2424

buildspec/packageTestVsix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ phases:
1313
install:
1414
run-as: root
1515
runtime-versions:
16-
nodejs: 16
16+
nodejs: 18
1717
commands:
1818
- bash buildspec/shared/linux-install.sh
1919

buildspec/windowsTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env:
55
phases:
66
install:
77
runtime-versions:
8-
nodejs: 16
8+
nodejs: 18
99
commands:
1010
- |
1111
if(-Not($Env:CODECOV_TOKEN -eq $null)) {

docs/telemetry-perf.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,70 @@ How long it took from when the user stopped pressing a key to when they were sho
258258
rHandler->>User: add to already shown results
259259
end
260260
```
261+
262+
## Crash Monitoring
263+
264+
We make an attempt to gather information regarding when the IDE crashes, then report it to telemetry. This is the diagram of the steps that take place.
265+
266+
### Sequence Diagram
267+
268+
> Keep in mind that the entire sequence below is duplicated for each instance of our extension.
269+
> They all work together to "crash check" on behalf of the other crashed extension instance.
270+
271+
`Crash Service`: The high level "service" that starts the heartbeats and crash checks
272+
273+
`Heartbeat`: Sends heartbeats which signal that the extension is still running and has not crashed
274+
275+
`Crash Checker`: Observes the heartbeats, reporting a telemetry event if a crash is detected
276+
277+
`File System State`: The user's file system where we store the heartbeat files from each extension instance
278+
279+
```mermaid
280+
%%{init: {'theme':'default'}}%%
281+
sequenceDiagram
282+
autonumber
283+
284+
participant VSC as VS Code
285+
participant Service as Crash Service
286+
participant Checker as Crash Checker
287+
participant Heartbeat as Heartbeat
288+
participant State as File System State
289+
participant Telemetry as Telemetry
290+
291+
rect rgb(121, 210, 121)
292+
alt Extension Startup
293+
VSC ->> Service: activate() - Start Service
294+
295+
Service ->> Heartbeat: Start Heartbeats
296+
Heartbeat ->> State: Send Initial Heartbeat <br/> (in a folder add a unique file w/ timestamp)
297+
rect rgb(64, 191, 64)
298+
par every N minutes
299+
Heartbeat ->> State: Send Heartbeat <br/> (overwrite the unique file w/ new timestamp)
300+
end
301+
end
302+
303+
Service ->> Checker: Start Crash Checking
304+
rect rgb(64, 191, 64)
305+
par every N*2 minutes
306+
Checker ->> Checker: If computer went to sleep, skip this iteration (gives time for a heartbeat)
307+
Checker ->> State: Request all heartbeat timestamps (readdir all heartbeat files)
308+
State ->> Checker: Receive all heartbeat timestamps
309+
loop for each crashed extension (it's timestamp >= N*2 minutes)
310+
Checker ->> State: Delete heartbeat file
311+
Checker ->> Telemetry: Send metric representing a crash: session_end
312+
end
313+
end
314+
end
315+
end
316+
end
317+
318+
rect rgb(255, 128, 128)
319+
alt Graceful Shutdown
320+
VSC ->> Service: deactivate() - Stop Service
321+
Service ->> Checker: Stop
322+
Service ->> Heartbeat: Stop
323+
Heartbeat ->> State: Delete timestamp file <br/> (This is missed when a crash happens)
324+
end
325+
end
326+
327+
```

0 commit comments

Comments
 (0)