Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
75d24b6
added "<- return to agent" button
Jul 29, 2025
6d88625
added weight dialog with backend logic to update in db
Aug 1, 2025
2536bcb
check api key given to change weights
Aug 12, 2025
0a75c8c
Bump requests from 2.32.4 to 2.32.5 in /backend-agent
dependabot[bot] Aug 24, 2025
ab766ab
Bump flask from 3.1.1 to 3.1.2 in /backend-agent
dependabot[bot] Aug 24, 2025
d718efc
Add new models and refactor google and bedrock connectors
marcorosa Aug 26, 2025
e653bf7
Adopt new SAP AI gen sdk library
marcorosa Aug 26, 2025
144fe65
Fix openai completions call
marcorosa Aug 26, 2025
77d2d6a
Use kwargs in local openai and ollama classes
marcorosa Aug 26, 2025
e53ddaa
Remove deprecated models
marcorosa Aug 26, 2025
cadfe67
Replace gpt-4 with gpt-4o
marcorosa Aug 26, 2025
86d2e93
Mention garak tool
marcorosa Aug 26, 2025
ec4f14f
Merge pull request #88 from SAP/lib/sap-ai-sdk-gen
marcorosa Aug 26, 2025
7afc3e4
Merge pull request #87 from SAP/dependabot/pip/backend-agent/develop/…
marcorosa Aug 26, 2025
c539f7c
Merge pull request #85 from SAP/dependabot/pip/backend-agent/develop/…
marcorosa Aug 26, 2025
a6b7eca
Bump flask-cors from 6.0.0 to 6.0.1 in /backend-agent
dependabot[bot] Aug 26, 2025
b087010
Merge pull request #84 from SAP/dependabot/pip/backend-agent/develop/…
marcorosa Aug 26, 2025
44a0eb5
Add SAP AI PR bot
marcorosa Aug 27, 2025
c97cc55
Merge pull request #89 from SAP/action/sap-pr-bot
marcorosa Aug 27, 2025
35c242a
forgot blank lines
Sep 2, 2025
9d7648d
Merge branch 'develop' into risk-dashboard-ui
marcorosa Sep 2, 2025
6dd7153
Set missing action permissions
marcorosa Sep 2, 2025
b58f976
Fix wrong indentation
marcorosa Sep 2, 2025
22abecd
Fix lint-frontend permissions
marcorosa Sep 2, 2025
35a8e7d
Run linters when PRs come from forks
marcorosa Sep 4, 2025
be9962a
fixed constructor injections to inject()
Sep 4, 2025
8e091f2
addressed es-lint violation (BL with space and line too long)
Sep 4, 2025
52ae1aa
addressed any types errors
Sep 4, 2025
83ec44e
Revert "fixed constructor injections to inject()"
Sep 4, 2025
5811505
fixed constructor injections to inject()
Sep 4, 2025
59c94a6
Merge pull request #91 from SAP/risk-dashboard-ui
marcorosa Sep 4, 2025
9c5d22b
Add support for uv
marcorosa Sep 5, 2025
a3305b5
Print version at startup
marcorosa Sep 5, 2025
6a89c7a
Add uv.lock file
marcorosa Sep 5, 2025
f08bba5
Remove pep8speaks bot
marcorosa Sep 5, 2025
35482a7
Update installation workflow using uv
marcorosa Sep 5, 2025
c95f897
Bump python version
marcorosa Sep 5, 2025
8098c6b
Trigger changelog-ci only for backend releases
marcorosa Sep 5, 2025
90bc5fd
Merge branch 'develop' into chore/uv
marcorosa Sep 5, 2025
cb83472
Fix working directory
marcorosa Sep 5, 2025
aa05bd7
Add build system
marcorosa Sep 5, 2025
1b9e3b0
Merge pull request #94 from SAP/chore/uv
marcorosa Sep 5, 2025
8a312ca
Bump actions/setup-python from 5 to 6
dependabot[bot] Sep 7, 2025
d5b3375
Bump actions/setup-node from 4 to 5
dependabot[bot] Sep 7, 2025
e17fa2f
Bump the js-dependencies group across 1 directory with 28 updates
dependabot[bot] Sep 7, 2025
ec421b3
Merge pull request #99 from SAP/dependabot/npm_and_yarn/frontend/deve…
marcorosa Sep 8, 2025
8848d86
Merge pull request #96 from SAP/dependabot/github_actions/develop/act…
marcorosa Sep 8, 2025
6c92bd3
Merge pull request #95 from SAP/dependabot/github_actions/develop/act…
marcorosa Sep 8, 2025
326f29c
Use configService to manage be-fe configuration at runtime
marcorosa Sep 9, 2025
dba6a96
Adopt changes in local deployment
marcorosa Sep 9, 2025
2a66d80
Simplify npm run start
marcorosa Sep 9, 2025
2d6dc94
Deprecate old environments
marcorosa Sep 9, 2025
7cf0615
Use uv image for backend
marcorosa Sep 10, 2025
000d987
Build containers for amd64
marcorosa Sep 10, 2025
01a7c6f
Update after rebuilding frontend
marcorosa Sep 10, 2025
63498a1
Update connection to backend when using docker
marcorosa Sep 10, 2025
adb562f
Improve backend container
marcorosa Sep 10, 2025
9585916
Add github action to build docker container
marcorosa Sep 11, 2025
9a31fe6
Merge branch 'develop' into chore/k8s
marcorosa Sep 11, 2025
f1fe3d7
Merge pull request #100 from SAP/chore/k8s
marcorosa Sep 11, 2025
5c0c118
Suggest the usage of gpt-5 as eval model in codeattack and artprompt
marcorosa Sep 12, 2025
8ceba9d
Fix params for calls to LLMs in pyrit
marcorosa Sep 12, 2025
216a315
Bump be version
marcorosa Sep 12, 2025
eb7f023
[Changelog CI] Add Changelog for Version v0.5.0
github-actions[bot] Sep 12, 2025
24d3811
Re-generate lock file
marcorosa Sep 12, 2025
4794cc9
Run also on (re-)open/sync prs
marcorosa Sep 12, 2025
92f8dc6
Ignore uv.lock
marcorosa Sep 12, 2025
9a74cfd
Fix action syntax
marcorosa Sep 12, 2025
af12515
Address pr comments
marcorosa Sep 12, 2025
ba93380
Limit to 1 review per pull request
marcorosa Sep 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/changelog-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
types: [ opened, reopened ]
branches: [ main ]
paths: ['backend-agent/**']
# changelog-ci triggers only on backend changes

# Optionally you can use `workflow_dispatch` to run Changelog CI Manually
workflow_dispatch:
Expand Down
205 changes: 205 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
name: Build and Push Docker Images

on:
pull_request:
types:
- closed
branches:
- main

jobs:
check_version_update:
name: Check Version Updates
if: github.event.pull_request.merged
runs-on: ubuntu-latest
outputs:
build_backend: ${{ steps.version_check.outputs.build_backend }}
build_frontend: ${{ steps.version_check.outputs.build_frontend }}
backend_version: ${{ steps.version_check.outputs.backend_version }}
frontend_version: ${{ steps.version_check.outputs.frontend_version }}
steps:
- name: Check out the repo
uses: actions/checkout@v5
with:
fetch-depth: 2 # Need at least 2 commits to compare

- name: Detect version changes
id: version_check
run: |
echo "🔍 Checking for version changes..."

# Get current commit and previous commit
CURRENT_COMMIT=$(git rev-parse HEAD)
# Previous commit refers to the latest commit on main before the PR
# was merged
PREVIOUS_COMMIT=$(git rev-parse HEAD~1)

echo "Current commit: $CURRENT_COMMIT"
echo "Previous commit: $PREVIOUS_COMMIT"

# Initialize build flags and version variables
BUILD_BACKEND=false
BUILD_FRONTEND=false
# Extract current versions for backend and frontend
BACKEND_VERSION=$(grep '^version = ' backend-agent/pyproject.toml | sed "s/version = '\(.*\)'/\1/")
FRONTEND_VERSION=$(grep '"version":' frontend/package.json | sed 's/.*"version": "\(.*\)".*/\1/')
Comment on lines +44 to +45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version extraction logic using sed is fragile and could break with different formatting. Consider using a more robust JSON/TOML parser or add validation:

# For backend version
BACKEND_VERSION=$(python -c "import tomllib; print(tomllib.load(open('backend-agent/pyproject.toml', 'rb'))['project']['version'])")
# For frontend version
FRONTEND_VERSION=$(node -p "require('./frontend/package.json').version")


# Check if backend version file changed
if git diff --name-only $PREVIOUS_COMMIT $CURRENT_COMMIT | grep -q 'backend-agent/pyproject.toml'; then
# Extract previous backend version
PREVIOUS_BACKEND_VERSION=$(git show $PREVIOUS_COMMIT:backend-agent/pyproject.toml | grep '^version = ' | sed "s/version = '\(.*\)'/\1/")
echo "Backend version - Current: $BACKEND_VERSION, Previous: $PREVIOUS_BACKEND_VERSION"

if [ "$BACKEND_VERSION" != "$PREVIOUS_BACKEND_VERSION" ]; then
# The version has changed, set flag to build backend
BUILD_BACKEND=true
echo "✅ Backend version changed: $PREVIOUS_BACKEND_VERSION → $BACKEND_VERSION"
else
echo "❎ Backend version unchanged: $BACKEND_VERSION. Skip docker backend."
fi
Comment on lines +53 to +59
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script assumes that version changes always indicate the need to build. Consider adding validation to ensure the version actually increased (not decreased or unchanged in a different way):

if [ "$BACKEND_VERSION" != "$PREVIOUS_BACKEND_VERSION" ]; then
  # Add semantic version comparison here
  if [[ "$BACKEND_VERSION" > "$PREVIOUS_BACKEND_VERSION" ]]; then
    BUILD_BACKEND=true
    echo "✅ Backend version increased: $PREVIOUS_BACKEND_VERSION$BACKEND_VERSION"
  else
    echo "⚠️ Backend version changed but not increased: $PREVIOUS_BACKEND_VERSION$BACKEND_VERSION"
  fi
fi

fi

# Check if frontend version file changed
if git diff --name-only $PREVIOUS_COMMIT $CURRENT_COMMIT | grep -q 'frontend/package.json'; then
# Extract previous frontend version
PREVIOUS_FRONTEND_VERSION=$(git show $PREVIOUS_COMMIT:frontend/package.json | grep '"version":' | sed 's/.*"version": "\(.*\)".*/\1/')
echo "Frontend version - Current: $FRONTEND_VERSION, Previous: $PREVIOUS_FRONTEND_VERSION"

if [ "$FRONTEND_VERSION" != "$PREVIOUS_FRONTEND_VERSION" ]; then
# The version has changed, set flag to build frontend
BUILD_FRONTEND=true
echo "✅ Frontend version changed: $PREVIOUS_FRONTEND_VERSION → $FRONTEND_VERSION"
else
echo "❎ Frontend version unchanged: $FRONTEND_VERSION. Skip docker frontend."
fi
fi

# Set build outputs
echo "build_backend=$BUILD_BACKEND" >> $GITHUB_OUTPUT
echo "build_frontend=$BUILD_FRONTEND" >> $GITHUB_OUTPUT
echo "backend_version=$BACKEND_VERSION" >> $GITHUB_OUTPUT
echo "frontend_version=$FRONTEND_VERSION" >> $GITHUB_OUTPUT

if [ "$BUILD_BACKEND" = "false" ] && [ "$BUILD_FRONTEND" = "false" ]; then
echo "⚠️ No version changes detected. Skipping builds."
fi

build-backend:
name: Build and Push Backend Docker Image
if: github.event.pull_request.merged && needs.check_version_update.outputs.build_backend == 'true'
needs: check_version_update
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v5

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: 🐳 Build and push Backend Docker image
uses: docker/build-push-action@v6
with:
context: ./backend-agent
file: ./backend-agent/Dockerfile
push: true
tags: |
${{ secrets.DOCKER_REGISTRY_URL }}/stars-backend:${{ needs.check_version_update.outputs.backend_version }}
${{ secrets.DOCKER_REGISTRY_URL }}/stars-backend:latest
cache-from: type=gha
cache-to: type=gha,mode=max
Comment on lines +106 to +116
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding error handling for Docker build failures and implementing retry logic for robustness:

- name: 🐳 Build and push Backend Docker image
  uses: docker/build-push-action@v6
  with:
    context: ./backend-agent
    file: ./backend-agent/Dockerfile
    push: true
    tags: |
      ${{ secrets.DOCKER_REGISTRY_URL }}/stars-backend:${{ needs.check_version_update.outputs.backend_version }}
      ${{ secrets.DOCKER_REGISTRY_URL }}/stars-backend:latest
    cache-from: type=gha
    cache-to: type=gha,mode=max
  retry:
    max_attempts: 3
    retry_wait_seconds: 30


- name: Backend Build Summary
run: |
echo "Backend Build Complete"
echo "✅ Backend: stars-backend:${{ needs.check_version_update.outputs.backend_version }}"

build-frontend:
name: Build and Push Frontend Docker Image
if: github.event.pull_request.merged && needs.check_version_update.outputs.build_frontend == 'true'
needs: check_version_update
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v5

- name: Set up Node.js for Frontend build
uses: actions/setup-node@v5
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Build Angular application
run: |
cd frontend
npm ci
npm run build -- --configuration production
# Verify build output exists
ls -la dist/

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: 🐳 Build and push Frontend Docker image
uses: docker/build-push-action@v6
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: |
${{ secrets.DOCKER_REGISTRY_URL }}/stars-frontend:${{ needs.check_version_update.outputs.frontend_version }}
${{ secrets.DOCKER_REGISTRY_URL }}/stars-frontend:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Frontend Build Summary
run: |
echo "Frontend Build Complete"
echo "✅ Frontend: stars-frontend:${{ needs.check_version_update.outputs.frontend_version }}"

build-summary:
name: Build Pipeline Summary
needs: [check_version_update, build-backend, build-frontend]
runs-on: ubuntu-latest
# Allow this job to run even if backend or frontend jobs are skipped
if: always() && github.event.pull_request.merged
steps:
- name: Pipeline Summary
run: |
echo "STARS Build Pipeline Summary"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Backend
if [ "${{ needs.check_version_update.outputs.build_backend }}" = "true" ]; then
if [ "${{ needs.build-backend.result }}" = "success" ]; then
echo "✅ Backend: stars-backend:${{ needs.check_version_update.outputs.backend_version }}"
else
echo "❌ Backend: Build failed"
fi
else
echo "⏭️ (SKIP) Backend: No version change detected"
fi
# Frontend
if [ "${{ needs.check_version_update.outputs.build_frontend }}" = "true" ]; then
if [ "${{ needs.build-frontend.result }}" = "success" ]; then
echo "✅ Frontend: stars-frontend:${{ needs.check_version_update.outputs.frontend_version }}"
else
echo "❌ Frontend: Build failed"
fi
else
echo "⏭️ (SKIP) Frontend: No version change detected"
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
20 changes: 13 additions & 7 deletions .github/workflows/installation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,24 @@ jobs:
uses: actions/checkout@v5

- name: Set up Python environment
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version: "3.11"
token: ${{ secrets.GITHUB_TOKEN }}
cache: 'pip'
cache-dependency-path: backend-agent/requirements.txt
- run: pip install -r backend-agent/requirements.txt

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
enable-cache: true

- name: Install dependencies
run: uv sync --locked --all-extras --dev --project backend-agent

- name: Start server and check health
working-directory: backend-agent
run: |
cd backend-agent
DISABLE_AGENT=1 DB_PATH=${RUNNER_TEMP}/data.db python main.py > server.log 2>&1 &
DISABLE_AGENT=1 DB_PATH=${RUNNER_TEMP}/data.db uv run main.py > server.log 2>&1 &
for i in {1..20}; do
sleep 1
status=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/health || true)
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/lint-backend.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Lint backend

on:
pull_request:
pull_request_target:
branches:
- develop
- main
Expand All @@ -11,7 +11,8 @@ on:

permissions:
checks: write
contents: write
contents: read
pull-requests: write

jobs:
lint-backend:
Expand All @@ -23,9 +24,9 @@ jobs:
uses: actions/checkout@v5

- name: Set up Python environment
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version: "3.12"
token: ${{ secrets.GITHUB_TOKEN }}
cache: 'pip'

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Lint frontend

on:
pull_request:
pull_request_target:
branches:
- develop
- main
Expand All @@ -19,13 +19,16 @@ jobs:
lint-frontend:
name: Run frontend linters
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- name: Check out Git repository
uses: actions/checkout@v5

- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: 20

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pr-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: AI-assisted
on:
pull_request:
types: [ready_for_review, opened, reopened]

jobs:
summary:
name: PR Summary
runs-on: [ubuntu-latest]
steps:
- uses: SAP/ai-assisted-github-actions/pr-summary@v3
with:
aicore-service-key: ${{ secrets.AICORE_SERVICE_KEY }}
model: gpt-4o
exclude-files: package-lock.json, uv.lock
Comment on lines +6 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow lacks proper error handling and could benefit from conditional execution. Consider adding failure handling:

jobs:
  summary:
    name: PR Summary
    runs-on: [ubuntu-latest]
    continue-on-error: true  # Don't fail the entire PR if AI summary fails
    steps:
      - uses: SAP/ai-assisted-github-actions/pr-summary@v3
        with:
          aicore-service-key: ${{ secrets.AICORE_SERVICE_KEY }}
          model: gpt-4o
          exclude-files: package-lock.json, uv.lock
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

review:
name: PR Review
runs-on: [ubuntu-latest]
steps:
- uses: SAP/ai-assisted-github-actions/pr-review@v3
with:
aicore-service-key: ${{ secrets.AICORE_SERVICE_KEY }}
model: anthropic--claude-4-sonnet
exclude-files: package-lock.json, uv.lock
footer-text: |
---
> Always critique what AI says. Do not let AI replace YOUR I.
28 changes: 0 additions & 28 deletions .pep8speaks.yml

This file was deleted.

15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Version: v0.5.0

* [#84](https://github.com/SAP/STARS/pull/84): Bump flask-cors from 6.0.0 to 6.0.1 in /backend-agent
* [#85](https://github.com/SAP/STARS/pull/85): Bump requests from 2.32.4 to 2.32.5 in /backend-agent
* [#87](https://github.com/SAP/STARS/pull/87): Bump flask from 3.1.1 to 3.1.2 in /backend-agent
* [#88](https://github.com/SAP/STARS/pull/88): Replace SAP library for accessing LLMs
* [#89](https://github.com/SAP/STARS/pull/89): Add GitHub action for SAP PR bot
* [#91](https://github.com/SAP/STARS/pull/91): Add back button and weights config in dashboard
* [#94](https://github.com/SAP/STARS/pull/94): Add support for uv
* [#95](https://github.com/SAP/STARS/pull/95): Bump actions/setup-python from 5 to 6
* [#96](https://github.com/SAP/STARS/pull/96): Bump actions/setup-node from 4 to 5
* [#99](https://github.com/SAP/STARS/pull/99): Bump the js-dependencies group across 1 directory with 28 updates
* [#100](https://github.com/SAP/STARS/pull/100): Improve maintainability and add docker action


# Version: v0.4.0

* [#44](https://github.com/SAP/STARS/pull/44): Add Garak tool
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Hereafter, a list with all the attacks the Agent is able to run, grouped by atta
- [PyRIT](https://github.com/Azure/PyRIT)
- [CodeAttack](https://github.com/renqibing/CodeAttack)
- [ArtPrompt](https://github.com/uw-nsl/ArtPrompt)
- [Garak](https://github.com/NVIDIA/garak)


## Requirements and Setup
Expand Down
Loading