Skip to content

Commit 27d73ff

Browse files
authored
Merge pull request #184 from mylonics/develop
Creating Release: 2.0.4
2 parents 68fb14f + 4e89012 commit 27d73ff

23 files changed

+1813
-1002
lines changed

.github/copilot-instructions.md

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Zephyr IDE is a VS Code extension that provides comprehensive tools for Zephyr R
77
## Working Effectively
88

99
### Bootstrap and Dependencies
10+
1011
**CRITICAL: All build and test commands take significant time. NEVER CANCEL operations.**
1112

1213
```bash
@@ -24,13 +25,14 @@ which ninja && ninja --version
2425
```
2526

2627
### Build Commands
28+
2729
**Set timeouts to 10+ minutes for all build commands. NEVER CANCEL.**
2830

2931
```bash
3032
# Compile TypeScript (3 seconds)
3133
npm run test-compile
3234

33-
# Compile for development (3 seconds)
35+
# Compile for development (3 seconds)
3436
npm run compile
3537

3638
# Bundle extension with esbuild (1 second)
@@ -47,6 +49,7 @@ npm run pretest
4749
```
4850

4951
### Testing Commands
52+
5053
**CRITICAL: Integration tests take 10-15 minutes each. Set timeouts to 20+ minutes. NEVER CANCEL.**
5154

5255
```bash
@@ -57,16 +60,17 @@ npm test
5760
# Run specific integration test suites (requires Zephyr SDK)
5861
# TIMEOUT: 15+ minutes each - NEVER CANCEL
5962
xvfb-run -a node scripts/run-integration-tests.js standard
60-
xvfb-run -a node scripts/run-integration-tests.js git
63+
xvfb-run -a node scripts/run-integration-tests.js west-git
6164
xvfb-run -a node scripts/run-integration-tests.js zephyr-ide-git
62-
xvfb-run -a node scripts/run-integration-tests.js open-current-dir
63-
xvfb-run -a node scripts/run-integration-tests.js out-of-tree
65+
xvfb-run -a node scripts/run-integration-tests.js local-west
66+
xvfb-run -a node scripts/run-integration-tests.js external-zephyr
6467

6568
# Skip actual Zephyr builds in tests (faster testing)
6669
SKIP_BUILD_TESTS=true npm test
6770
```
6871

6972
### VS Code Extension Development
73+
7074
```bash
7175
# Open extension for development
7276
# 1. Open VS Code in the repository directory
@@ -80,23 +84,27 @@ SKIP_BUILD_TESTS=true npm test
8084
**ALWAYS test these scenarios after making changes to ensure functionality:**
8185

8286
### Manual Extension Validation
87+
8388
1. **Extension Loading**: Press F5 to launch extension host, verify Zephyr IDE appears in activity bar
8489
2. **Workspace Setup**: Test workspace initialization commands work
8590
3. **Project Creation**: Verify project creation from templates functions
8691
4. **Build Configuration**: Test build configuration setup
8792
5. **Command Palette**: Verify all "Zephyr IDE:" commands are available
8893

8994
### Integration Test Coverage
95+
9096
The integration tests validate complete workflows:
97+
9198
- **Standard Workspace**: Dependencies → west setup → SDK install → project creation → build (15 min)
92-
- **Git Workspace**: Git clone → SDK → project → custom board build (15 min)
99+
- **Git Workspace**: Git clone → SDK → project → custom board build (15 min)
93100
- **Zephyr IDE Git**: Zephyr IDE specific git workflow (15 min)
94101
- **Open Directory**: Current directory workspace setup (15 min)
95-
- **Out of Tree**: Out-of-tree project builds (15 min)
102+
- **External Zephyr**: External zephyr workspace builds (15 min)
96103

97104
## Repository Structure
98105

99106
### Core Source Files
107+
100108
```
101109
src/
102110
├── extension.ts - Main extension entry point, registers commands and webview panels
@@ -131,11 +139,11 @@ src/
131139
│ ├── flash.ts - Device flashing and debugging
132140
│ └── twister.ts - Test execution and reporting
133141
├── test/ - Integration test suites (15+ min each)
134-
│ ├── standard-workspace.test.ts - Full workspace setup → build
135-
│ ├── west-git-workspace.test.ts - Git-based workspace creation
136-
│ ├── zephyr-ide-git-workspace.test.ts - Zephyr IDE specific git workflow
137-
│ ├── open-current-directory.test.ts - Current directory workspace
138-
│ ├── workspace-out-of-tree.test.ts - Out-of-tree project builds
142+
│ ├── workspace-standard.test.ts - Full workspace setup → build
143+
│ ├── workspace-west-git.test.ts - Git-based workspace creation
144+
│ ├── workspace-zephyr-ide-git.test.ts - Zephyr IDE specific git workflow
145+
│ ├── workspace-local-west.test.ts - Current directory workspace
146+
│ ├── workspace-external-zephyr.test.ts - External zephyr workspace builds
139147
│ ├── test-runner.ts - Test execution framework
140148
│ └── ui-mock-interface.ts - Mock UI for headless testing
141149
└── utilities/ - Shared helper functions
@@ -145,6 +153,7 @@ src/
145153
```
146154

147155
### Build and Distribution
156+
148157
```
149158
dist/ - Production bundled extension (esbuild output)
150159
out/ - Development compiled TypeScript (tsc output)
@@ -153,6 +162,7 @@ west_templates/ - West.yml templates for different workspace types
153162
```
154163

155164
### Configuration Files
165+
156166
```
157167
package.json - Extension manifest, commands, activation events, npm scripts
158168
tsconfig.json - TypeScript compilation settings, path mappings
@@ -163,6 +173,7 @@ tsconfig.json - TypeScript compilation settings, path mappings
163173
```
164174

165175
### Key Architecture Patterns
176+
166177
- **Command Registration**: All VS Code commands defined in `package.json` and registered in `extension.ts`
167178
- **Webview Communication**: Panels use message passing between TypeScript and HTML/JS
168179
- **State Management**: Extension state persisted via VS Code APIs in `state-management.ts`
@@ -172,6 +183,7 @@ tsconfig.json - TypeScript compilation settings, path mappings
172183
## Common Development Tasks
173184

174185
### Code Changes Workflow
186+
175187
```bash
176188
# 1. Make code changes to src/
177189
# 2. Compile and lint
@@ -187,7 +199,9 @@ xvfb-run -a node scripts/run-integration-tests.js standard # Full test
187199
```
188200

189201
### Before Committing
202+
190203
**ALWAYS run these commands before committing changes:**
204+
191205
```bash
192206
# Required for CI to pass
193207
npm run lint
@@ -199,6 +213,7 @@ npm run pretest
199213
```
200214

201215
### Extension Packaging
216+
202217
```bash
203218
# Build for production
204219
npm run vscode:prepublish
@@ -210,28 +225,33 @@ vsce package
210225
## Troubleshooting
211226

212227
### Build Issues
228+
213229
- **TypeScript errors**: Run `npm run compile` to see detailed errors
214230
- **Bundling issues**: Check `npm run esbuild` output
215231
- **Lint failures**: Run `npm run lint` and fix ESLint warnings
216232

217-
### Test Issues
233+
### Test Issues
234+
218235
- **VS Code download failures**: Network connectivity issue, retry tests
219236
- **Integration test timeouts**: NEVER CANCEL - tests take 15+ minutes
220237
- **Zephyr build failures**: Install Zephyr SDK and build dependencies
221238
- **Mock UI failures**: Check UI mock interface in test files
222239

223240
### Development Issues
241+
224242
- **Extension not loading**: Check console for errors in extension host
225243
- **Commands not working**: Verify command registration in package.json
226244
- **Webview issues**: Check panel implementations in src/panels/
227245

228246
## CI/CD Integration
229247

230248
The `.github/workflows/integration-tests.yml` runs on:
249+
231250
- Push to main, pre-release, develop branches
232251
- Pull requests to those branches
233252

234253
**CI Requirements:**
254+
235255
- Ubuntu with Zephyr build tools
236256
- 20+ minute timeouts for integration tests
237257
- xvfb for headless VS Code testing
@@ -247,28 +267,32 @@ The `.github/workflows/integration-tests.yml` runs on:
247267
## Dependencies
248268

249269
### Required for Development
270+
250271
- Node.js 18+ (for npm and extension bundling)
251272
- VS Code (for extension development and testing)
252273
- Git (for version control)
253274

254275
### Required for Full Testing
276+
255277
- Python 3.8+ with pip
256278
- west (`pip3 install west`)
257279
- cmake, ninja-build
258280
- Zephyr SDK (for integration tests)
259281
- xvfb (for headless testing on Linux)
260282

261283
### System Packages (Ubuntu)
284+
262285
```bash
263286
sudo apt-get install python3-pip python3-venv cmake ninja-build gperf \
264287
ccache dfu-util device-tree-compiler wget file make gcc gcc-multilib \
265288
g++-multilib libsdl2-dev libmagic1
266289
```
267290

268291
**TIMING EXPECTATIONS:**
292+
269293
- npm install: ~40 seconds
270-
- TypeScript compilation: ~3 seconds
294+
- TypeScript compilation: ~3 seconds
271295
- ESLint: ~2 seconds
272296
- esbuild bundling: ~1 second
273297
- Integration tests: 15+ minutes each - NEVER CANCEL
274-
- Full CI pipeline: 60+ minutes - NEVER CANCEL
298+
- Full CI pipeline: 60+ minutes - NEVER CANCEL

.github/workflows/integration-tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
- name: Run linting
3939
run: npm run lint
4040

41-
- name: Run workspace out of tree integration tests
41+
- name: Run external zephyr workspace integration tests
4242
run: |
43-
xvfb-run -a node scripts/run-integration-tests.js out-of-tree
43+
xvfb-run -a node scripts/run-integration-tests.js external-zephyr
4444
env:
4545
NODE_ENV: test
4646
ZEPHYR_BASE: /tmp/zephyr
@@ -52,9 +52,9 @@ jobs:
5252
NODE_ENV: test
5353
ZEPHYR_BASE: /tmp/zephyr
5454

55-
- name: Run git workflow integration tests
55+
- name: Run west git workflow integration tests
5656
run: |
57-
xvfb-run -a node scripts/run-integration-tests.js git
57+
xvfb-run -a node scripts/run-integration-tests.js west-git
5858
env:
5959
NODE_ENV: test
6060
ZEPHYR_BASE: /tmp/zephyr
@@ -66,9 +66,9 @@ jobs:
6666
NODE_ENV: test
6767
ZEPHYR_BASE: /tmp/zephyr
6868

69-
- name: Run open current directory integration tests
69+
- name: Run local west workspace integration tests
7070
run: |
71-
xvfb-run -a node scripts/run-integration-tests.js open-current-dir
71+
xvfb-run -a node scripts/run-integration-tests.js local-west
7272
env:
7373
NODE_ENV: test
7474
ZEPHYR_BASE: /tmp/zephyr

0 commit comments

Comments
 (0)