Skip to content

Commit d208265

Browse files
authored
Merge pull request #7 from brianwcook/fix/node18-compatibility
🔧 Fix Node.js 18 compatibility in CI workflow. fixed all githubs actions tests
2 parents 03022d5 + c03968f commit d208265

File tree

16 files changed

+272
-84
lines changed

16 files changed

+272
-84
lines changed

.eslintrc.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,22 @@ jobs:
2424
node-version: ${{ matrix.node-version }}
2525
cache: 'yarn'
2626

27-
- name: Install dependencies
27+
- name: Install dependencies (Node.js 18.x - ignore engines)
28+
if: matrix.node-version == '18.x'
29+
run: yarn install --frozen-lockfile --ignore-engines
30+
31+
- name: Install dependencies (Node.js 20.x - strict engines)
32+
if: matrix.node-version == '20.x'
2833
run: yarn install --frozen-lockfile
2934

30-
- name: Lint code
35+
- name: Lint renderer package only (Node.js 18.x)
36+
if: matrix.node-version == '18.x'
37+
run: |
38+
cd tekton-pipeline-renderer
39+
npm run lint
40+
41+
- name: Lint all packages (Node.js 20.x)
42+
if: matrix.node-version == '20.x'
3143
run: npm run lint
3244

3345
- name: Run renderer tests
@@ -36,12 +48,13 @@ jobs:
3648
- name: Build renderer package
3749
run: npm run build:renderer
3850

39-
- name: Propagate changes to VSCode extension
51+
- name: Propagate changes to VSCode extension (Node.js 20+ only)
52+
if: matrix.node-version == '20.x'
4053
run: npm run propagate
4154

4255
- name: Run VSCode extension tests (Node.js 20+ only)
4356
if: matrix.node-version == '20.x'
44-
run: npm run test:vscode
57+
run: xvfb-run -a npm run test:vscode
4558

4659
- name: Build VSCode extension (Node.js 20+ only)
4760
if: matrix.node-version == '20.x'
@@ -57,23 +70,23 @@ jobs:
5770
if: github.ref == 'refs/heads/main'
5871

5972
steps:
60-
- name: Checkout repository
61-
uses: actions/checkout@v4
62-
63-
- name: Use Node.js 18.x
64-
uses: actions/setup-node@v4
65-
with:
66-
node-version: 18.x
67-
cache: 'yarn'
68-
69-
- name: Install dependencies
70-
run: yarn install --frozen-lockfile
71-
72-
- name: Run complete release check
73-
run: npm run release:check
74-
75-
- name: Check if ready for release
76-
run: |
77-
echo "✅ All checks passed - packages are ready for release"
78-
echo "📦 NPM Package: Run 'npm run npm:publish' to publish"
79-
echo "🔌 VSCode Extension: Run 'npm run vscode:package' to create .vsix file"
73+
- name: Checkout code
74+
uses: actions/checkout@v4
75+
76+
- name: Setup Node.js 20.x
77+
uses: actions/setup-node@v4
78+
with:
79+
node-version: '20.x'
80+
cache: 'yarn'
81+
82+
- name: Install dependencies
83+
run: yarn install --frozen-lockfile
84+
85+
- name: Run comprehensive tests
86+
run: xvfb-run -a npm run ci
87+
88+
- name: Validate packages are ready for release
89+
run: |
90+
echo "✅ All tests passed - packages are ready for release"
91+
echo "🚀 Renderer package: Ready for npm publish"
92+
echo "📦 VSCode extension: Ready for marketplace publish"

AI_WORKFLOW_GUIDE.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# 🤖 AI Assistant Workflow Guide
2+
3+
**Quick reference for AI assistants working on this codebase**
4+
5+
## 🎯 Architecture Summary
6+
7+
**Single Source of Truth**: All pipeline rendering logic lives in `tekton-pipeline-renderer/`
8+
9+
**Propagation**: Changes copy from `tekton-pipeline-renderer/src/``tekton-vscode/src/lib/tekton-renderer/`
10+
11+
**Testing**: Both packages have independent test suites + integration tests
12+
13+
## 🚨 Critical Rules
14+
15+
1. **NEVER** add rendering logic to `tekton-vscode/src/` (except extension-specific code)
16+
2. **NEVER** edit `tekton-vscode/src/lib/` (auto-generated by propagation)
17+
3. **ALWAYS** implement features in `tekton-pipeline-renderer/` first
18+
4. **ALWAYS** run `npm run propagate` after renderer changes
19+
20+
## 🔄 Standard Workflow
21+
22+
### Making Changes to Pipeline Rendering:
23+
```bash
24+
# 1. Edit files in tekton-pipeline-renderer/src/
25+
# 2. Test the renderer
26+
npm run test:renderer
27+
28+
# 3. Propagate to VSCode extension
29+
npm run propagate
30+
31+
# 4. Test the extension
32+
npm run test:vscode
33+
34+
# 5. Verify complete pipeline
35+
npm run pre-push
36+
```
37+
38+
### Before Pushing to GitHub:
39+
```bash
40+
npm run pre-push
41+
# This runs: lint + build:renderer + build:extension + vscode:package
42+
```
43+
44+
## 📁 Where to Edit What
45+
46+
### ✅ Edit in `tekton-pipeline-renderer/src/`:
47+
- React components (`components/`)
48+
- Custom hooks (`hooks/`)
49+
- Utilities and parsers (`utils/`)
50+
- Type definitions (`types/`)
51+
- Tests (`__tests__/`)
52+
53+
### ✅ Edit in `tekton-vscode/src/`:
54+
- Extension entry point (`extension.ts`)
55+
- VSCode webview integration (`webview/`)
56+
- Extension tests (`test/`)
57+
- Extension configuration (`package.json`, etc.)
58+
59+
### ❌ NEVER Edit:
60+
- `tekton-vscode/src/lib/` (auto-generated)
61+
62+
## 🧪 Testing Commands
63+
64+
```bash
65+
npm run test # All tests
66+
npm run test:renderer # Renderer package only
67+
npm run test:vscode # VSCode extension only
68+
npm run sample # Interactive React demo
69+
```
70+
71+
## 🔧 Key Commands
72+
73+
```bash
74+
npm run propagate # Copy renderer changes to VSCode
75+
npm run pre-push # Complete GitHub Actions equivalent
76+
npm run build # Build both packages
77+
npm run vscode:package # Create .vsix file
78+
npm run clean # Clean all artifacts
79+
```
80+
81+
## 🐛 Common Issues
82+
83+
**"TypeScript build errors after propagation"**
84+
→ Check for conflicting type definitions, run `npm run propagate` again
85+
86+
**"Tests pass locally but GitHub Actions fails"**
87+
→ Run `npm run pre-push` to match GitHub Actions exactly
88+
89+
**"VSCode extension not updating"**
90+
→ Run `npm run propagate` then rebuild extension
91+
92+
## 📋 Commit Checklist
93+
94+
- [ ] Changes implemented in `tekton-pipeline-renderer/`
95+
- [ ] Tests added/updated for new functionality
96+
- [ ] `npm run propagate` executed
97+
- [ ] `npm run pre-push` passes (lint, build, package)
98+
- [ ] Manual testing with sample pipelines
99+
100+
## 🎯 Architecture Goals
101+
102+
- **No Drift**: Single source prevents package divergence
103+
- **Reusability**: Renderer can be used in other contexts
104+
- **Testing**: Comprehensive coverage at all levels
105+
- **Distribution**: Both npm package and VSCode extension from same source

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
"lint:fix": "yarn workspace tekton-pipeline-renderer run lint:fix && yarn workspace tekton-vscode run lint:fix",
3030
"propagate": "node scripts/propagate-changes.js",
3131
"ci": "npm run clean && npm run install:all && npm run lint && npm run test && npm run build",
32+
"ci:github": "npm run lint && npm run build:renderer && npm run build:extension && npm run vscode:package",
33+
"pre-push": "npm run ci:github",
3234
"release:check": "npm run ci && npm run propagate && npm run test",
3335
"release:prepare": "npm run release:check && npm run build:extension",
3436
"vscode:package": "yarn workspace tekton-vscode run vscode:package",

tekton-pipeline-renderer/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Konflux Team
3+
Copyright (c) 2025 Brian Cook
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

tekton-pipeline-renderer/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"LICENSE"
2222
],
2323
"scripts": {
24-
"build": "rollup -c rollup.config.js",
24+
"build": "rollup -c rollup.config.mjs",
2525
"build:extension": "webpack --mode production",
26-
"build:watch": "rollup -c rollup.config.js --watch",
26+
"build:watch": "rollup -c rollup.config.mjs --watch",
2727
"dev": "webpack-dev-server --config webpack.config.js --mode development",
2828
"dev:extension": "webpack --mode development --watch",
2929
"sample": "webpack serve --config example/webpack.config.js --mode development",
@@ -93,7 +93,7 @@
9393
"url": "https://github.com/your-org/tekton-pipeline-combo/issues"
9494
},
9595
"author": "Your Name",
96-
"license": "Apache-2.0",
96+
"license": "MIT",
9797
"engines": {
9898
"node": ">=18.0.0"
9999
}

tekton-pipeline-renderer/rollup.config.js renamed to tekton-pipeline-renderer/rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import commonjs from 'rollup-plugin-commonjs';
33
import typescript from 'rollup-plugin-typescript2';
44
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
55
import postcss from 'rollup-plugin-postcss';
6-
import pkg from './package.json' assert { type: 'json' };
6+
import pkg from './package.json' with { type: 'json' };
77

88
export default {
99
input: 'src/index.ts',

tekton-pipeline-renderer/src/components/TopologyVisualization.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export const TopologyVisualization: React.FC<TopologyVisualizationProps> = ({
165165
width = '100%',
166166
height = '600px',
167167
className,
168-
onError,
168+
onError: _onError,
169169
}) => {
170170
const model = React.useMemo(() => {
171171
if (!pipelineRun) return null;

tekton-pipeline-renderer/src/components/__tests__/VisualizationFactory.spec.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ describe('VisualizationFactory', () => {
203203

204204
describe('Control Bar Integration', () => {
205205
it('should render control bar when provided', () => {
206-
const mockControlBar = (controller: Controller) => (
206+
const mockControlBar = (_controller: Controller) => (
207207
<div data-testid="custom-control-bar">Control Bar</div>
208208
);
209209

@@ -367,8 +367,9 @@ describe('VisualizationFactory', () => {
367367
})
368368
};
369369

370-
jest.mocked(require('@patternfly/react-topology').Visualization)
371-
.mockImplementationOnce(() => errorVisualization);
370+
// eslint-disable-next-line @typescript-eslint/no-var-requires
371+
const { Visualization } = require('@patternfly/react-topology');
372+
jest.mocked(Visualization).mockImplementationOnce(() => errorVisualization);
372373

373374
// Capture console.error calls during this test
374375
const consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => {});

tekton-pipeline-renderer/src/treeProvider.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export class TektonTreeProvider implements vscode.TreeDataProvider<TektonItem> {
101101
}
102102

103103
private async findYamlFiles(uri: vscode.Uri): Promise<vscode.Uri[]> {
104-
const files: vscode.Uri[] = [];
105104
const yamlPattern = new vscode.RelativePattern(uri, '**/*.{yaml,yml}');
106105
const yamlFiles = await vscode.workspace.findFiles(yamlPattern, '**/node_modules/**');
107106

0 commit comments

Comments
 (0)