Skip to content

Commit ee78073

Browse files
Version 3.0
# iRulescan v3.0.0 Release Notes ## 🎉 Major Features ### New MCP Server Integration - Added MCP (Model Context Protocol) server support with `mcpserver` command - Seamless integration with VS Code Copilot for AI-assisted iRule scanning - HTTP stream transport for real-time code analysis ### Enhanced API Server - Upgraded from Swagger to OpenAPI v3 specification - Improved web interface for interactive iRule scanning - Better support for single file and multi-file scanning ## 🔧 Enhanced Output Format ### Structured Finding Reports Replaced simple string messages with detailed structured output providing better context and precise error location tracking. **Before:** ```json "warning": ["Unquoted expr at `1` in `expr 1 + $one`"] ``` **After:** ```json "warning": [{ "message": "unsafe expression, use braces `{ .. }`", "issue_location": "$one", "context": "expr 1 + $one", "line": 2 }] ``` New fields include: - `message`: Clear description of the issue - `issue_location`: Exact problematic code segment - `context`: Full expression context - `line`: Line number where issue occurs ## ⚙️ Configuration & Environment Variables ### New Environment Variables - **`IRULESCAN_FILE_EXTENSIONS`**: Customize file extensions to scan (default: `.tcl,.irul,.irule`) - **`IRULESCAN_LISTEN`**: Configure server listen address (default: `0.0.0.0:8000`) - **`IRULESCAN_LOG`**: Set logging level (`trace`, `debug`, `info`, `warn`, `error`) ## 🚀 Improved CLI Experience ### Enhanced Command Structure - Added `mcpserver` and `apiserver` commands - Support for stdin input with `-` parameter - Better help documentation and usage examples ### Container Improvements - New specialized container tags: `:apiserver` and `:mcpserver` - Flexible file extension scanning via environment variables - Enhanced CI/CD pipeline integration capabilities ## 📝 Breaking Changes ⚠️ **Important**: The output format has changed from simple strings to structured objects with detailed metadata. This may affect existing scripts that parse irulescan output. Please update your integration scripts accordingly. ### Migration Guide If you're parsing the old format, update your scripts to handle the new structured format: - Access `message` field for the main issue description - Use `line` field for line number information - Utilize `issue_location` for precise code targeting - Reference `context` for full expression details ## 🐳 Container Updates - **Latest**: General purpose scanning with new CLI features - **API Server**: `simonkowallik/irulescan:apiserver` - OpenAPI v3 web interface - **MCP Server**: `simonkowallik/irulescan:mcpserver` - VS Code Copilot integration
1 parent afa969b commit ee78073

Some content is hidden

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

64 files changed

+10389
-2769
lines changed

.github/workflows/release-apiserver.yaml renamed to .github/workflows/release.yaml_disabled

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release Container Image - apiserver
1+
name: Release Container Image
22

33
on:
44
workflow_dispatch:
@@ -43,11 +43,8 @@ jobs:
4343
images: |
4444
${{ github.repository }}
4545
ghcr.io/${{ github.repository }}
46-
flavor: |
47-
latest=false
48-
prefix=apiserver-,onlatest=true
4946
tags: |
50-
type=raw,value=apiserver,prefix=,enable={{is_default_branch}}
47+
type=raw,value=latest,enable={{is_default_branch}}
5148
type=schedule,pattern={{date 'YYYYMMDD-HHmmss' tz='UTC'}}
5249
type=pep440,pattern={{major}}.{{minor}}.{{patch}}
5350
type=pep440,pattern={{version}}
@@ -59,7 +56,7 @@ jobs:
5956
with:
6057
context: .
6158
platforms: linux/amd64,linux/arm64
62-
file: files/Dockerfile.apiserver
59+
file: files/Dockerfile
6360
push: true
6461
cache-from: type=gha
6562
cache-to: type=gha,mode=max
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Scheduled Test Build
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '5 5 */14 * *'
7+
permissions:
8+
contents: write
9+
jobs:
10+
trigger:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Trigger another workflow
14+
uses: peter-evans/repository-dispatch@v3
15+
with:
16+
event-type: start-scheduled-test
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Test Build
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [released]
7+
push:
8+
branches:
9+
- "main"
10+
repository_dispatch:
11+
types: [start-scheduled-test]
12+
13+
jobs:
14+
build:
15+
strategy:
16+
matrix:
17+
containers:
18+
- file: files/Dockerfile
19+
tags: |
20+
irulescan:latest
21+
- file: files/Dockerfile.apiserver
22+
tags: |
23+
irulescan:apiserver
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Go
30+
uses: actions/setup-go@v5
31+
32+
- name: Install jd
33+
run: |
34+
go install github.com/josephburnett/[email protected]
35+
echo "$HOME/go/bin" >> $GITHUB_PATH
36+
37+
- name: Set up QEMU
38+
uses: docker/setup-qemu-action@v3
39+
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
43+
- name: Build container image
44+
uses: docker/build-push-action@v6
45+
with:
46+
context: .
47+
file: ${{ matrix.containers.file }}
48+
platforms: linux/amd64
49+
push: false
50+
load: true
51+
cache-from: type=gha
52+
cache-to: type=gha,mode=max
53+
tags: ${{ matrix.containers.tags }}
54+
55+
- name: Run container test on single file
56+
if: ${{ matrix.containers.file == 'files/Dockerfile' }}
57+
run: |
58+
cat tests/basic/dangerous.tcl | docker run --rm -i -v "$PWD/tests:/scandir/tests" \
59+
irulescan:latest check -r 'tests/basic/dangerous.tcl.stdin.json' -
60+
61+
- name: Run container tests on directory
62+
if: ${{ matrix.containers.file == 'files/Dockerfile' }}
63+
run: |
64+
docker run --rm -v ${PWD}/tests/basic:/scandir \
65+
irulescan:latest > output.json
66+
jd -mset output.json tests/basic/irulescan.json || exit 1
67+
68+
- name: Start apiserver in background
69+
if: ${{ matrix.containers.file == 'files/Dockerfile.apiserver' }}
70+
run: |
71+
docker run --rm -p 8000:8000 -d \
72+
irulescan:apiserver
73+
sleep 10
74+
75+
- name: Run apiserver scanfiles test
76+
if: ${{ matrix.containers.file == 'files/Dockerfile.apiserver' }}
77+
run: |
78+
curl -s http://localhost:8000/scanfiles/ \
79+
-F 'file=@tests/basic/ok.tcl' \
80+
-F 'file=@tests/basic/warning.tcl' \
81+
-F 'file=@tests/basic/dangerous.tcl' > output.json
82+
jd -mset output.json tests/basic/irulescan.json || exit 1
83+
84+
- name: Run apiserver scan test
85+
if: ${{ matrix.containers.file == 'files/Dockerfile.apiserver' }}
86+
run: |
87+
curl -s http://localhost:8000/scan/ \
88+
--data-binary '@tests/basic/dangerous.tcl' > output.json
89+
jd -mset output.json tests/basic/dangerous.tcl.stdin.json || exit 1

.gitignore

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
/target
2-
/irulescan/target
3-
/irulescan/src/tcl.rs
1+
**/target
2+
src/tcl.rs
43
**/private
5-
**/.ruff_cache
4+
**/artifacts
5+
**/build
6+
**/packages
7+
**/.melange.yaml
8+
**/.PKGINFO
69
.local
710
.vscode
811
.idea
912
**/*.DS_Store
10-
.venv
11-
venv/
12-
__pycache__/
13-
/archived
13+
cosign.*
14+
melange.*

0 commit comments

Comments
 (0)