Skip to content

Commit 64c290c

Browse files
authored
Merge pull request #117 from SAP/develop
Release v0.6.0
2 parents 97b88f0 + 99d7f56 commit 64c290c

29 files changed

Lines changed: 3639 additions & 3750 deletions

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ updates:
2424
patterns:
2525
- "*"
2626

27-
- package-ecosystem: "pip"
27+
- package-ecosystem: "uv"
2828
directory: "/backend-agent"
2929
schedule:
3030
interval: "weekly"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Test backend installation
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- main
8+
paths:
9+
- '**.py'
10+
- '**.txt'
11+
- '**/pyproject.toml'
12+
- '**/uv.lock'
13+
workflow_dispatch:
14+
15+
permissions:
16+
checks: read
17+
contents: read
18+
19+
jobs:
20+
installation-backend:
21+
name: Test backend installation
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check out Git repository
25+
uses: actions/checkout@v5
26+
27+
- name: Set up Python environment
28+
uses: actions/setup-python@v6
29+
with:
30+
python-version: "3.11"
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v6
35+
with:
36+
version: "latest"
37+
enable-cache: true
38+
prune-cache: false
39+
40+
- name: Install dependencies
41+
run: uv sync --locked --all-extras --dev --project backend-agent
42+
43+
- name: Start server and check health
44+
working-directory: backend-agent
45+
run: |
46+
DISABLE_AGENT=1 DB_PATH=${RUNNER_TEMP}/data.db uv run main.py > server.log 2>&1 &
47+
for i in {1..60}; do
48+
sleep 1
49+
status=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/health || true)
50+
if [ "$status" -eq 200 ]; then
51+
echo "Health check succeeded"
52+
cat server.log
53+
exit 0
54+
fi
55+
done
56+
echo "Health check failed after waiting"
57+
cat server.log
58+
exit 1

.github/workflows/docker.yml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ jobs:
112112
tags: |
113113
${{ secrets.DOCKER_REGISTRY_URL }}/stars-backend:${{ needs.check_version_update.outputs.backend_version }}
114114
${{ secrets.DOCKER_REGISTRY_URL }}/stars-backend:latest
115-
cache-from: type=gha
116-
cache-to: type=gha,mode=max
115+
cache-from: type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/stars-backend:cache
116+
cache-to: type=registry,ref=${{ secrets.DOCKER_REGISTRY_URL }}/stars-backend:cache,mode=max
117+
# Use docker registry cache not to exceed GitHub Actions storage limits
118+
# Builds will be slower but won't fail due to storage limits
117119

118120
- name: Backend Build Summary
119121
run: |
@@ -203,3 +205,51 @@ jobs:
203205
echo "⏭️ (SKIP) Frontend: No version change detected"
204206
fi
205207
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
208+
209+
deploy-backend:
210+
name: Restart Backend Deployment
211+
if: github.event.pull_request.merged && needs.build-backend.result == 'success'
212+
needs: [check_version_update, build-backend]
213+
runs-on: ubuntu-latest
214+
steps:
215+
- name: Set up kubectl
216+
uses: azure/setup-kubectl@v4
217+
with:
218+
version: 'latest'
219+
220+
- name: Configure kubectl for SAP BTP Kyma
221+
run: |
222+
mkdir -p ~/.kube
223+
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
224+
chmod 600 ~/.kube/config
225+
226+
- name: Restart Backend Deployment
227+
run: |
228+
echo "🔄 Restarting backend deployment to pull latest image..."
229+
kubectl rollout restart deployment/stars-backend -n stars
230+
kubectl rollout status deployment/stars-backend -n stars --timeout=10m
231+
echo "✅ Backend deployment restarted successfully"
232+
233+
deploy-frontend:
234+
name: Restart Frontend Deployment
235+
if: github.event.pull_request.merged && needs.build-frontend.result == 'success'
236+
needs: [check_version_update, build-frontend]
237+
runs-on: ubuntu-latest
238+
steps:
239+
- name: Set up kubectl
240+
uses: azure/setup-kubectl@v4
241+
with:
242+
version: 'latest'
243+
244+
- name: Configure kubectl for SAP BTP Kyma
245+
run: |
246+
mkdir -p ~/.kube
247+
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
248+
chmod 600 ~/.kube/config
249+
250+
- name: Restart Frontend Deployment
251+
run: |
252+
echo "🔄 Restarting frontend deployment to pull latest image..."
253+
kubectl rollout restart deployment/stars-frontend -n stars
254+
kubectl rollout status deployment/stars-frontend -n stars --timeout=10m
255+
echo "✅ Frontend deployment restarted successfully"
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Test frontend installation
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- main
8+
paths:
9+
- 'frontend/package*.json'
10+
- 'frontend/**.ts'
11+
- 'frontend/**.js'
12+
- 'frontend/**.json'
13+
- 'frontend/**.css'
14+
- 'frontend/**.html'
15+
workflow_dispatch:
16+
17+
permissions:
18+
checks: read
19+
contents: read
20+
21+
jobs:
22+
installation-frontend:
23+
name: Test frontend installation
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Check out Git repository
27+
uses: actions/checkout@v5
28+
29+
- name: Set up Node.js environment
30+
uses: actions/setup-node@v5
31+
with:
32+
node-version: "24"
33+
34+
- name: Install dependencies
35+
working-directory: frontend
36+
run: npm ci
37+
38+
- name: Build frontend
39+
working-directory: frontend
40+
run: npm run build
41+
42+
- name: Verify build artifacts
43+
working-directory: frontend
44+
run: |
45+
if [ -d "dist/" ]; then
46+
echo "Build artifacts found in dist/"
47+
ls -la dist/
48+
else
49+
echo "Build artifacts not found"
50+
exit 1
51+
fi
52+
53+
- name: Test dev server startup
54+
working-directory: frontend
55+
timeout-minutes: 2
56+
run: |
57+
# Start the dev server in background
58+
npm start &
59+
DEV_SERVER_PID=$!
60+
61+
# Wait for server to be ready (max 60 seconds)
62+
for i in {1..60}; do
63+
sleep 1
64+
if curl -f -s http://localhost:4200 > /dev/null 2>&1; then
65+
echo "Dev server started successfully"
66+
kill $DEV_SERVER_PID
67+
exit 0
68+
fi
69+
done
70+
71+
echo "Dev server failed to start within 60 seconds"
72+
kill $DEV_SERVER_PID
73+
exit 1

.github/workflows/installation-test.yml

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

.github/workflows/lint-backend.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- main
88
paths:
99
- '**.py'
10+
- 'CHANGELOG.md'
1011
workflow_dispatch:
1112

1213
permissions:

.github/workflows/lint-frontend.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
- develop
77
- main
88
paths:
9-
- '**.json'
109
- '**.ts'
1110
- '**.js'
11+
- '**/package.json'
12+
- 'CHANGELOG.md'
1213
workflow_dispatch:
1314

1415
permissions:
@@ -30,18 +31,18 @@ jobs:
3031
- name: Set up Node.js
3132
uses: actions/setup-node@v5
3233
with:
33-
node-version: 20
34+
node-version: 24
3435

3536
- name: Install Node.js dependencies
37+
working-directory: frontend
3638
run: |
37-
cd frontend
3839
npm ci
3940
4041
- name: Run linters
4142
uses: reviewdog/action-eslint@v1
4243
with:
4344
github_token: ${{ secrets.GITHUB_TOKEN }}
4445
reporter: github-pr-review
46+
workdir: frontend
4547
eslint_flags: "--format rdjson --ext .js,.jsx,.ts,.tsx ./"
4648
fail_level: error
47-
workdir: frontend

.github/workflows/pr-bot.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: AI-assisted
22
on:
3-
pull_request:
3+
pull_request_target:
44
types: [ready_for_review, opened, reopened]
55

66
jobs:
77
summary:
88
name: PR Summary
9+
if: github.actor != 'dependabot'
910
runs-on: [ubuntu-latest]
1011
steps:
1112
- uses: SAP/ai-assisted-github-actions/pr-summary@v3
@@ -15,6 +16,7 @@ jobs:
1516
exclude-files: package-lock.json, uv.lock
1617
review:
1718
name: PR Review
19+
if: github.actor != 'dependabot'
1820
runs-on: [ubuntu-latest]
1921
steps:
2022
- uses: SAP/ai-assisted-github-actions/pr-review@v3
@@ -25,3 +27,7 @@ jobs:
2527
footer-text: |
2628
---
2729
> Always critique what AI says. Do not let AI replace YOUR I.
30+
prompt-addition: |
31+
Do not feel obliged to comment on every file. Focus on the most important aspects of the code change.
32+
Keep your comments concise and to the point.
33+
Avoid unnecessary complexity, and focus on maintainability, readability, and performance.

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# Version: v0.6.0
2+
3+
* [#93](https://github.com/SAP/STARS/pull/93): Add 2 PyRIT orchestrators ((Crescendo, PAIR)) and re-strucutre PyRIT code.
4+
* [#102](https://github.com/SAP/STARS/pull/102): Restart k8s deployments running new images
5+
* [#103](https://github.com/SAP/STARS/pull/103): Optimize docker builds and auto-deploy
6+
* [#104](https://github.com/SAP/STARS/pull/104): Bump azure/setup-kubectl from 3 to 4
7+
* [#106](https://github.com/SAP/STARS/pull/106): Bump ollama from 0.5.3 to 0.5.4 in /backend-agent
8+
* [#107](https://github.com/SAP/STARS/pull/107): Bump the js-dependencies group across 1 directory with 22 updates
9+
* [#109](https://github.com/SAP/STARS/pull/109): [chore] Fix GitHub Actions
10+
* [#110](https://github.com/SAP/STARS/pull/110): Add run_all cli + route
11+
* [#111](https://github.com/SAP/STARS/pull/111): Update current dependencies with versions
12+
* [#113](https://github.com/SAP/STARS/pull/113): Bump pyyaml from 6.0.2 to 6.0.3 in /backend-agent
13+
* [#114](https://github.com/SAP/STARS/pull/114): Bump ollama from 0.5.4 to 0.6.0 in /backend-agent
14+
* [#115](https://github.com/SAP/STARS/pull/115): Bump the js-dependencies group in /frontend with 15 updates
15+
* [#116](https://github.com/SAP/STARS/pull/116): Fix run_all attacks configuration
16+
17+
118
# Version: v0.5.0
219

320
* [#84](https://github.com/SAP/STARS/pull/84): Bump flask-cors from 6.0.0 to 6.0.1 in /backend-agent

backend-agent/.dockerignore

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Caches
22
**/__pycache__
33
cache
4+
**/.cache
5+
**/.mypy_cache
46

57
# Libraries
68
venv*
@@ -13,10 +15,28 @@ logger.log
1315
result_gptfuzz.txt
1416
prompt_success.txt
1517

18+
# Non-relevant files and folders
19+
README.md
20+
*.md
21+
docs/
22+
examples/
23+
build/
24+
dist/
25+
*.egg-info/
26+
1627
# Sensitive data
17-
.env
28+
.env*
1829

19-
# Development files
30+
# Development files and folders
2031
.vscode
2132
.gitignore
22-
README.md
33+
.git
34+
**/*.pyc
35+
**/*.pyo
36+
**/*.pyd
37+
**/.pytest_cache
38+
**/test*
39+
**/Test*
40+
**/.coverage
41+
**/htmlcov
42+
**/.tox

0 commit comments

Comments
 (0)