Skip to content

Commit b6fb283

Browse files
committed
📖 Update CONTRIBUTING.md with PR feedback
- Update Go version requirement to 1.23+ - Change binary name from kantra to analyzer-lsp - Add links to existing provider settings examples - Reorder sections to emphasize container-based development - Add note about test-data volume population - Use make target for cleanup commands - Add link to docs/rules.md for comprehensive rule documentation Signed-off-by: tsanders <[email protected]>
1 parent e11b53b commit b6fb283

File tree

1 file changed

+57
-42
lines changed

1 file changed

+57
-42
lines changed

CONTRIBUTING.md

Lines changed: 57 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Welcome! This guide will help you contribute to the Konveyor Analyzer LSP projec
1717

1818
### Prerequisites
1919

20-
- **Go 1.21+** - For building the analyzer and Go provider
20+
- **Go 1.23+** - For building the analyzer and Go provider
2121
- **Java 17+** - For Java provider (JDTLS)
2222
- **Node.js 18+** - For Node.js/TypeScript provider
2323
- **Python 3.9+** - For Python provider
@@ -60,7 +60,7 @@ Java provider uses Eclipse JDTLS which is bundled in the container image.
6060
Build the main analyzer binary:
6161

6262
```bash
63-
go build -o kantra main.go
63+
go build -o analyzer-lsp main.go
6464
```
6565

6666
### Building External Providers
@@ -119,49 +119,18 @@ The `examples/` directory contains test projects for each language:
119119
- `examples/python/` - Python test projects
120120
- `examples/yaml/` - YAML/Kubernetes manifests
121121

122-
### Running Analysis Locally
123-
124-
Create a provider settings file (e.g., `provider_settings.json`):
125-
126-
```json
127-
{
128-
"name": "nodejs",
129-
"binaryPath": "/usr/local/bin/typescript-language-server",
130-
"address": "127.0.0.1:0",
131-
"initConfig": [
132-
{
133-
"location": "/path/to/your/project",
134-
"providerSpecificConfig": {
135-
"includedPaths": ["src/"],
136-
"excludedPaths": ["node_modules/", "dist/"]
137-
}
138-
}
139-
]
140-
}
141-
```
142-
143-
Run analysis:
144-
145-
```bash
146-
./kantra \
147-
--provider-settings=provider_settings.json \
148-
--rules=rule-example.yaml \
149-
--output-file=output.yaml \
150-
--verbose=1
151-
```
152-
153-
## Container-Based Development
122+
### Container-Based Development
154123

155124
Container-based testing is the **recommended approach** for comprehensive testing with all providers.
156125

157-
### Why Use Containers?
126+
#### Why Use Containers?
158127

159128
1. **Consistent Environment** - Same environment as CI/CD
160129
2. **All Providers Together** - Test interactions between providers
161130
3. **Resource Isolation** - Prevents provider memory/CPU conflicts
162131
4. **Reproducible** - Matches production deployment
163132

164-
### Container Testing Workflow
133+
#### Container Testing Workflow
165134

166135
This is the workflow used for regenerating `demo-output.yaml`:
167136

@@ -182,7 +151,7 @@ podman build -f demo-local.Dockerfile -t localhost/testing:latest .
182151
make run-demo-image
183152
```
184153

185-
### Provider Pod Architecture
154+
#### Provider Pod Architecture
186155

187156
The `run-external-providers-pod` target creates a pod named `analyzer` with 6 containers:
188157

@@ -195,7 +164,9 @@ The `run-external-providers-pod` target creates a pod named `analyzer` with 6 co
195164

196165
All containers share the `test-data` volume for accessing example projects.
197166

198-
### Resource Requirements
167+
**Note:** The `test-data` volume is populated by copying from the `examples/` directories that are built into the analyzer-lsp and provider images.
168+
169+
#### Resource Requirements
199170

200171
**Minimum Resources for All Providers:**
201172
- **RAM**: 12GB (8GB causes Java provider OOM)
@@ -216,23 +187,67 @@ podman machine set --memory 12288 # 12GB
216187
podman machine start
217188
```
218189

219-
### Cleaning Up Containers
190+
#### Cleaning Up Containers
220191

221192
If you need to restart the provider pod:
222193

223194
```bash
224-
# Remove pod and volume
225-
podman pod rm -f analyzer
226-
podman volume rm test-data
195+
# Clean up everything (pod, containers, and volume)
196+
make stop-external-providers-pod
227197

228198
# Recreate pod
229199
make run-external-providers-pod
230200
```
231201

202+
### Running Analysis Locally
203+
204+
Create a provider settings file. See existing examples:
205+
- [`provider_local_settings.json`](provider_local_settings.json) - Simple local development setup
206+
- [`provider_container_settings.json`](provider_container_settings.json) - Container-based setup with all providers
207+
- [`provider_pod_local_settings.json`](provider_pod_local_settings.json) - Pod-based local setup
208+
209+
Example provider settings file for Node.js:
210+
211+
```json
212+
[
213+
{
214+
"name": "nodejs",
215+
"binaryPath": "./external-providers/generic-external-provider/generic-external-provider",
216+
"initConfig": [{
217+
"analysisMode": "full",
218+
"providerSpecificConfig": {
219+
"lspServerName": "nodejs",
220+
"lspServerPath": "typescript-language-server",
221+
"lspServerArgs": ["--stdio"],
222+
"workspaceFolders": ["file:///path/to/your/project"]
223+
}
224+
}]
225+
},
226+
{
227+
"name": "builtin",
228+
"initConfig": [
229+
{"location": "path/to/your/project/"}
230+
]
231+
}
232+
]
233+
```
234+
235+
Run analysis:
236+
237+
```bash
238+
./analyzer-lsp \
239+
--provider-settings=provider_settings.json \
240+
--rules=rule-example.yaml \
241+
--output-file=output.yaml \
242+
--verbose=1
243+
```
244+
232245
## Adding New Rules
233246

234247
Rules are defined in YAML files (e.g., `rule-example.yaml`).
235248

249+
**For comprehensive documentation on rule syntax, provider capabilities, and advanced features, see [docs/rules.md](docs/rules.md).**
250+
236251
### Rule Structure
237252

238253
```yaml

0 commit comments

Comments
 (0)