Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1806520
Refactor project to support modular architecture
RadCod3 Feb 12, 2026
5c58ca5
Add separate workflow for python and refactor existing
RadCod3 Feb 12, 2026
475e3d1
Bump versions of packages
RadCod3 Feb 12, 2026
5a6becc
Fix release python workflow
RadCod3 Feb 12, 2026
2cfbb38
Fix version bump logic in python workflow
RadCod3 Feb 12, 2026
add6463
Add update checker and notify users
RadCod3 Feb 13, 2026
b8c7f9b
Use rich for cli colors instead of ansi codes
RadCod3 Feb 13, 2026
525cd9c
Bump version of afm-core and afm-cli
RadCod3 Feb 13, 2026
fe062e6
Add debug logs for update check
RadCod3 Feb 13, 2026
2179ac0
Bump version
RadCod3 Feb 13, 2026
53ba1e1
Fix version flag and test update notifications
RadCod3 Feb 13, 2026
d5ae2cc
Remove unused cors settings
RadCod3 Feb 13, 2026
742d042
Rename langchain-interpreter folder to python-interpreter
RadCod3 Feb 13, 2026
f92a5a3
Update workflows to support new folder structure
RadCod3 Feb 13, 2026
a440d6b
Add correct license header to files
RadCod3 Feb 13, 2026
bb74ffc
Fix validate command to skip env resolving
RadCod3 Feb 16, 2026
160bb78
Remove unused env setting and fix test
RadCod3 Feb 16, 2026
5e58224
Refactor release notes to use heredocs
RadCod3 Feb 16, 2026
59229d4
Fix always-true condition in release-python
RadCod3 Feb 16, 2026
281ce76
Fix test_version to handle missing afm-cli package
RadCod3 Feb 16, 2026
ac5ee43
Remove __version__ from source code
RadCod3 Feb 17, 2026
4fb5e4f
Add proper README files for packages and workspace
RadCod3 Feb 17, 2026
124abb5
Refactor release workflows and extract common Docker logic
RadCod3 Feb 17, 2026
1d982bb
Update RELEASING.md file to reflect current workflows
RadCod3 Feb 17, 2026
e55843a
Add version constraints to afm-cli and afm-langchain
RadCod3 Feb 19, 2026
700173e
Bump trivy scan version
RadCod3 Feb 19, 2026
d8d79c6
Bump versions
RadCod3 Feb 19, 2026
7bac8f5
Bump python-interpreter afm-core versions to next patch
github-actions[bot] Feb 19, 2026
7d2f4e2
Fix trivy scan version
RadCod3 Feb 19, 2026
3d485a0
Bump langchain version
RadCod3 Feb 19, 2026
83dc58a
Update github action order
RadCod3 Feb 19, 2026
5f38b70
Bump package versions
RadCod3 Feb 19, 2026
a7505be
Bump python-interpreter afm-core versions to next patch
github-actions[bot] Feb 19, 2026
0f25b22
Bump python-interpreter afm-langchain versions to next patch
github-actions[bot] Feb 19, 2026
5db8002
Update release-python.yml to handle multiple tokens
RadCod3 Feb 23, 2026
64b0bb3
Regen uv.lock file
RadCod3 Feb 23, 2026
8e0a8bb
Update README file
RadCod3 Feb 23, 2026
8f880b5
Refactor update notification logic
RadCod3 Feb 23, 2026
e07e080
Update missing framework msg
RadCod3 Feb 23, 2026
5ff4815
Fix update notification when switching between core and cli
RadCod3 Feb 23, 2026
e195d40
Improve load_runner ambiguity
RadCod3 Feb 24, 2026
b9fb1eb
Improve package manager detection logic
RadCod3 Feb 24, 2026
e3504fc
Add version validity check before sed
RadCod3 Feb 24, 2026
f115b06
Remove mention of re-release workflow
RadCod3 Feb 24, 2026
e38666d
Pass package name to relase-finalize
RadCod3 Feb 24, 2026
4b9b515
Add python-based impl contribution guidelines
RadCod3 Feb 24, 2026
b68cbb3
Refactor README and RELEASING files
RadCod3 Feb 24, 2026
414d509
Apply suggestions from code review
RadCod3 Feb 25, 2026
6fa87ef
Address review comments
RadCod3 Feb 25, 2026
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
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: LangChain Interpreter CI
name: Python Interpreter CI

on:
push:
branches: [main, dev]
paths:
- "langchain-interpreter/**"
- ".github/workflows/langchain-interpreter.yml"
- "python-interpreter/**"
- ".github/workflows/python-interpreter.yml"
pull_request:
branches: [main, dev]
paths:
- "langchain-interpreter/**"
- ".github/workflows/langchain-interpreter.yml"
- "python-interpreter/**"
- ".github/workflows/python-interpreter.yml"

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: langchain-interpreter
working-directory: python-interpreter

steps:
- name: Checkout repository
Expand All @@ -34,6 +34,9 @@ jobs:
- name: Run tests
run: uv run pytest

- name: Check formatting
run: uv run ruff format --check .

- name: Lint with ruff
run: uv run ruff check .

Expand All @@ -45,7 +48,7 @@ jobs:
packages: write
defaults:
run:
working-directory: langchain-interpreter
working-directory: python-interpreter

steps:
- name: Checkout repository
Expand Down Expand Up @@ -73,7 +76,7 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: langchain-interpreter
context: python-interpreter
push: true
platforms: linux/amd64,linux/arm64
tags: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
name: Release
name: Release Ballerina

on:
workflow_dispatch:
inputs:
implementation:
description: 'Implementation to release'
required: true
type: choice
options:
- ballerina-interpreter
- langchain-interpreter
branch:
description: 'Branch to release from'
required: false
default: 'main'
type: string

concurrency:
group: release-${{ github.event.inputs.implementation }}
group: release-ballerina-interpreter
cancel-in-progress: false

jobs:
Expand All @@ -28,6 +21,7 @@ jobs:
outputs:
release_version: ${{ steps.version.outputs.RELEASE_VERSION }}
next_version: ${{ steps.version.outputs.NEXT_VERSION }}
tag: ${{ steps.version.outputs.TAG }}
steps:
- name: Validate branch format
env:
Expand All @@ -47,16 +41,11 @@ jobs:

- name: Read and validate version
id: version
env:
IMPLEMENTATION: ${{ inputs.implementation }}
run: |
# Determine version file
if [ -f "$IMPLEMENTATION/Ballerina.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/Ballerina.toml"
elif [ -f "$IMPLEMENTATION/pyproject.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/pyproject.toml"
else
echo "::error::No version file found for implementation: $IMPLEMENTATION"
VERSION_FILE="ballerina-interpreter/Ballerina.toml"

if [ ! -f "$VERSION_FILE" ]; then
echo "::error::Version file not found: $VERSION_FILE"
exit 1
fi

Expand All @@ -74,45 +63,82 @@ jobs:
MINOR=$(echo "$RELEASE_VERSION" | cut -d. -f2)
PATCH=$(echo "$RELEASE_VERSION" | cut -d. -f3)
NEXT_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
TAG="ballerina-interpreter-v$RELEASE_VERSION"

echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT
echo "NEXT_VERSION=$NEXT_VERSION" >> $GITHUB_OUTPUT
echo "Releasing $RELEASE_VERSION, next will be $NEXT_VERSION"
echo "TAG=$TAG" >> $GITHUB_OUTPUT
echo "Releasing ballerina-interpreter $RELEASE_VERSION (tag: $TAG), next will be $NEXT_VERSION"

- name: Check tag doesn't already exist
env:
TAG: ${{ inputs.implementation }}-v${{ steps.version.outputs.RELEASE_VERSION }}
TAG: ${{ steps.version.outputs.TAG }}
run: |
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "::error::Tag $TAG already exists. Use re-release workflow to overwrite."
echo "::error::Tag $TAG already exists."
exit 1
fi

- name: Check release branch doesn't already exist
env:
RELEASE_BRANCH: release-${{ inputs.implementation }}-${{ steps.version.outputs.RELEASE_VERSION }}
RELEASE_BRANCH: release-ballerina-interpreter-${{ steps.version.outputs.RELEASE_VERSION }}
run: |
if git ls-remote --exit-code --heads origin "$RELEASE_BRANCH" >/dev/null 2>&1; then
echo "::error::Release branch $RELEASE_BRANCH already exists. Use re-release workflow to overwrite."
echo "::error::Release branch $RELEASE_BRANCH already exists."
exit 1
fi

release:
test:
needs: validate
uses: ./.github/workflows/release-common.yml
runs-on: ubuntu-latest
defaults:
run:
working-directory: ballerina-interpreter
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
fetch-depth: 0

- name: Set up Ballerina
uses: ballerina-platform/setup-ballerina@v1.1.3
with:
version: 2201.12.10

- name: Build and test
run: |
bal build
bal test

docker:
needs: [validate, test]
uses: ./.github/workflows/release-docker.yml
with:
implementation: ${{ inputs.implementation }}
context: ballerina-interpreter
image_name: afm-ballerina-interpreter
version: ${{ needs.validate.outputs.release_version }}
branch: ${{ inputs.branch }}
update_latest: ${{ inputs.branch == 'main' || inputs.branch == 'dev' }}
is_rerelease: false
image_title: AFM Ballerina Interpreter
permissions:
contents: write
packages: write
security-events: write

finalize:
needs: [validate, docker]
uses: ./.github/workflows/release-finalize.yml
with:
tag: ${{ needs.validate.outputs.tag }}
implementation: ballerina-interpreter
package: ballerina-interpreter
version: ${{ needs.validate.outputs.release_version }}
branch: ${{ inputs.branch }}
is_rerelease: false
permissions:
contents: write

bump-version:
needs: [validate, release]
needs: [validate, finalize]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -125,20 +151,14 @@ jobs:
- name: Bump version to next
env:
BRANCH: ${{ inputs.branch }}
IMPLEMENTATION: ${{ inputs.implementation }}
NEXT_VERSION: ${{ needs.validate.outputs.next_version }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git pull origin "$BRANCH" --rebase
# Determine version file
if [ -f "$IMPLEMENTATION/Ballerina.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/Ballerina.toml"
elif [ -f "$IMPLEMENTATION/pyproject.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/pyproject.toml"
fi


VERSION_FILE="ballerina-interpreter/Ballerina.toml"
sed -i "s/^version = \".*\"/version = \"$NEXT_VERSION\"/" "$VERSION_FILE"
git add "$VERSION_FILE"
git commit -m "Bump $IMPLEMENTATION version to $NEXT_VERSION"
git commit -m "Bump ballerina-interpreter version to $NEXT_VERSION"
Comment on lines +159 to +163
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find Ballerina.toml files in the repository
fd "Ballerina.toml" --type f

Repository: wso2/reference-implementations-afm

Length of output: 114


🏁 Script executed:

# Read the Ballerina.toml file and check for lines matching ^version =
cat ballerina-interpreter/Ballerina.toml

Repository: wso2/reference-implementations-afm

Length of output: 1777


sed replaces all version entries in Ballerina.toml, corrupting dependency versions.

Line 160's sed -i "s/^version = \".*\"/version = \"$NEXT_VERSION\"/" replaces every line matching ^version = "...". The Ballerina.toml file has 10 such lines: the package version (line 3) plus 9 dependency versions (lines 10, 15, 20, 25, 30, 35, 40, 45, 50). This would set all dependency versions to $NEXT_VERSION, breaking the build. The read step (line 53) correctly uses head -1 to grab only the first match, but the write step lacks this constraint.

📝 Proposed fix — limit replacement to the first match
-          sed -i "s/^version = \".*\"/version = \"$NEXT_VERSION\"/" "$VERSION_FILE"
+          sed -i '0,/^version = ".*"/{s/^version = ".*"/version = "'"$NEXT_VERSION"'"/}' "$VERSION_FILE"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-ballerina.yml around lines 158 - 162, The current
sed command replaces every line matching ^version = "..." in VERSION_FILE,
corrupting dependency versions; change the replacement to only affect the first
match by using the sed range for the first occurrence, e.g. replace the sed
invocation in the block that touches VERSION_FILE with: sed -i '0,/^version =
".*"/s//version = "'"$NEXT_VERSION"'"' "$VERSION_FILE" (i.e. update the sed
command that currently reads sed -i "s/^version = \".*\"/version =
\"$NEXT_VERSION\"/" to use the 0,/pattern/ range so only the first ^version =
... line is updated).

git push origin "$BRANCH"
Loading