Merged in feature/ai-pr-review-agent (pull request #906)

Add AI code review agent to pull request pipeline

* Add AI code review agent to pull request pipeline

Adds a pull-requests pipeline that runs CI checks (lint, type check,
unit tests) followed by an AI code review step. The AI review uses
OIDC to authenticate with AWS Bedrock - no hardcoded AWS keys. It
clones the code-review-agent repo and posts a review comment on the PR.

* Fix AI code review step: install git in python:3.12-slim image

* Trigger pipeline

* Trigger pipeline

* Trigger pipeline

* Trigger pipeline

* Trigger pipeline

* Trigger pipeline

* Trigger pipeline

* Remove debug token decode line

* Update guide: all checklist items complete, agent working

* Remove guide file from repo

* Trigger pipeline


Approved-by: Katon Minhas
This commit is contained in:
Siddhant Medar
2026-03-10 22:02:53 +00:00
parent 4236f49ab2
commit ec0b758bd5
+55 -28
View File
@@ -3,38 +3,65 @@ definitions:
- script: &install
pip install uv;
uv sync --group dev --group test;
pipelines:
default:
- step:
steps:
- step: &install-deps
name: Install Dependencies
image: python:3.12.7
script:
- *install
caches:
- pip
- step: &lint
name: Lint (black)
image: python:3.12.7
script:
- *install
- uv run black --check src/
caches:
- pip
- step: &typecheck
name: Type Check (mypy)
image: python:3.12.7
script:
- *install
- uv run mypy src/
caches:
- pip
- step: &unit-tests
name: Unit Tests (pytest)
image: python:3.12.7
script:
- *install
- uv run pytest src/tests/
caches:
- pip
pipelines:
default:
- step: *install-deps
- parallel:
- step:
name: Lint (black)
image: python:3.12.7
script:
- *install
- uv run black --check src/
caches:
- pip
- step:
name: Type Check (mypy)
image: python:3.12.7
script:
- *install
- uv run mypy src/
caches:
- pip
- step:
name: Unit Tests (pytest)
image: python:3.12.7
script:
- *install
- uv run pytest src/tests/
caches:
- pip
- step: *lint
- step: *typecheck
- step: *unit-tests
pull-requests:
'**':
- step: *install-deps
- parallel:
- step: *lint
- step: *typecheck
- step: *unit-tests
- step:
name: AI Code Review
image: python:3.12-slim
oidc: true
script:
- apt-get update && apt-get install -y git
- pip install boto3 requests
- export AWS_REGION=us-east-1
- export AWS_ROLE_ARN=arn:aws:iam::975049960860:role/DoczyAI-Bitbucket-OIDC
- export AWS_WEB_IDENTITY_TOKEN_FILE=$(pwd)/web-identity-token
- echo $BITBUCKET_STEP_OIDC_TOKEN > $(pwd)/web-identity-token
- git clone https://x-token-auth:${BITBUCKET_CLONE_TOKEN}@bitbucket.org/${BITBUCKET_WORKSPACE}/code-review-agent.git
- export PR_URL="https://bitbucket.org/${BITBUCKET_WORKSPACE}/${BITBUCKET_REPO_SLUG}/pull-requests/${BITBUCKET_PR_ID}"
- cd code-review-agent && python main.py "$PR_URL"