Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: CI Pipeline
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main" ]

env:
REGISTRY: docker.io
Expand Down
40 changes: 21 additions & 19 deletions .github/workflows/goose-pr-review.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Goose
name: AI Based PR Review with Goose

on:
pull_request:
Expand Down Expand Up @@ -52,34 +52,36 @@ jobs:
keyring: false
EOF

- name: Create instructions for Goose
- name: Prepare review instructions
run: |
cat > instructions.txt <<'EOF'
Create a summary of the changes provided. Don't provide any session or logging details.
The summary for each file should be brief and structured as:
<filename/path (wrapped in backticks)>
- dot points of changes
You don't need any extensions, don't mention extensions at all.
The changes to summarise are:
EOF
cat changes.txt >> instructions.txt

- name: Test
run: cat instructions.txt
# Read custom instructions from repository
cat .goose/instructions.txt > review_instructions.txt
echo "" >> review_instructions.txt
echo "The changes to review are:" >> review_instructions.txt
cat changes.txt >> review_instructions.txt

- name: Run Goose and filter output
- name: Run Goose AI review
env:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
run: |
goose run --instructions instructions.txt \
goose run --instructions review_instructions.txt \
| sed -E 's/\x1B\[[0-9;]*[mK]//g' \
| grep -v "logging to /home/runner/.config/goose/sessions/" \
| grep -v "^starting session" \
| grep -v "^Closing session" \
| sed 's/[[:space:]]*$//' \
> pr_comment.txt

- name: Post comment to PR
- name: Post AI review to PR
run: |
cat -A pr_comment.txt
gh pr comment "$PR_NUMBER" --body-file pr_comment.txt
{
echo "## 🤖 AI Code Review"
echo "*Automated review by Goose + Google Gemini*"
echo ""
cat pr_comment.txt
echo ""
echo "---"
echo "*This review was automatically generated. Use human judgment for final decisions.*"
} > final_comment.txt

gh pr comment "$PR_NUMBER" --body-file final_comment.txt
50 changes: 50 additions & 0 deletions .goose/instructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
You are an expert DevOps engineer reviewing code changes for a machine learning application.

Focus your review on these key areas:

## 🐳 Docker & Containerization
- Dockerfile best practices and optimization
- Multi-stage builds and layer efficiency
- Security considerations (non-root users, minimal base images)
- Health checks and restart policies

## 🏗️ Infrastructure & Orchestration
- Docker Compose service configuration
- Service dependencies and networking
- Volume mounts and data persistence
- Load balancing and proxy setup

## 🔒 Security & Best Practices
- Exposed ports and network security
- Environment variable management
- Container security practices
- Access controls and permissions

## 🚀 CI/CD & Automation
- Workflow efficiency and optimization
- Security scanning integration
- Caching strategies and performance
- Error handling and reliability

## 📊 Code Quality
- Configuration file structure and clarity
- Documentation and maintainability
- Production readiness
- Scalability considerations

## Review Format
Please structure your review as:

**`filename`**
- Summary of changes
- Key observations
- Recommendations for improvement
- Security or performance notes

**Overall Assessment:**
- Rate: Excellent/Good/Needs Improvement
- Main strengths
- Priority improvements
- Production readiness assessment

Keep feedback constructive, specific, and actionable.
23 changes: 23 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: '3.8'

services:
tech-stack-advisor:
build: .
Expand All @@ -13,3 +15,24 @@ services:
start_period: 40s
restart: unless-stopped

redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
restart: unless-stopped

nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- tech-stack-advisor
restart: unless-stopped

volumes:
redis_data:
28 changes: 28 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
events {
worker_connections 1024;
}

http {
upstream tech_stack_advisor {
server tech-stack-advisor:7860;
}

server {
listen 80;
server_name localhost;

location / {
proxy_pass http://tech_stack_advisor;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

location /health {
access_log off;
return 200 "healthy\n";
add_header Content-Type text/plain;
}
}
}