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
85 changes: 85 additions & 0 deletions .github/workflows/01-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,82 @@ jobs:
fail-fast: false # Show all linter failures, not just the first
matrix:
include:
# Security & Secret Detection (BLOCKING)
- id: detect-private-keys
name: "🔑 Detect Private Keys"
blocking: true
cmd: |
if grep -r "BEGIN.*PRIVATE KEY" \
--include="*.py" --include="*.js" \
--include="*.ts" --include="*.env*" . 2>/dev/null | \
grep -v ".git" | grep -v "node_modules"; then
echo "❌ Private keys detected! Remove before merging."
exit 1
else
echo "✅ No private keys found"
fi

- id: detect-ai-artifacts
name: "🤖 Detect AI Artifacts"
blocking: true
cmd: |
PATTERN="(as an ai language model|i am an ai developed by"
PATTERN="${PATTERN}|source=chatgpt\.com|\[oaicite:\?\?\d+\]"
PATTERN="${PATTERN}|:contentReference)"
if grep -rE "${PATTERN}" \
--include="*.py" --include="*.md" \
--include="*.js" --include="*.ts" . 2>/dev/null | \
grep -v ".git" | grep -v "node_modules" | grep -v ".github"; then
echo "❌ AI-generated artifacts detected! Clean before merging."
exit 1
else
echo "✅ No AI artifacts found"
fi

# File Hygiene Checks (BLOCKING)
- id: check-merge-conflicts
name: "📝 Check Merge Conflicts"
blocking: true
cmd: |
if grep -rn "^<<<<<<< \|^=======$\|^>>>>>>> " \
--include="*.py" --include="*.js" \
--include="*.ts" . 2>/dev/null | \
grep -v ".git" | grep -v "node_modules"; then
echo "❌ Merge conflict markers detected!"
exit 1
else
echo "✅ No merge conflicts"
fi

- id: check-large-files
name: "📏 Check Large Files"
blocking: true
cmd: |
if find . -type f -size +5M \
-not -path "./.git/*" \
-not -path "./node_modules/*" 2>/dev/null | head -1; then
echo "⚠️ Large files detected (>5MB):"
find . -type f -size +5M \
-not -path "./.git/*" \
-not -path "./node_modules/*" -exec ls -lh {} \;
echo "❌ Large files should be stored in Git LFS or excluded"
exit 1
else
echo "✅ No large files"
fi

- id: check-debug-statements
name: "🐍 Check Debug Statements"
blocking: true
cmd: |
if grep -rn "import pdb\|breakpoint()\|import ipdb" \
--include="*.py" backend/rag_solution/ 2>/dev/null; then
echo "⚠️ Debug statements found - remove before merging"
exit 1
else
echo "✅ No debug statements"
fi

# Configuration file linting
- id: yamllint
name: "YAML Lint"
Expand Down Expand Up @@ -104,6 +180,15 @@ jobs:
python-version: '3.12'
cache: 'pip'

- name: 🧹 Free Up Disk Space
if: |
contains(matrix.id, 'ruff') || contains(matrix.id, 'mypy') ||
contains(matrix.id, 'pylint') || contains(matrix.id, 'pydocstyle')
run: |
echo "Initial: $(df -h / | awk 'NR==2 {print $4}') available"
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost "$AGENT_TOOLSDIRECTORY"
echo "After cleanup: $(df -h / | awk 'NR==2 {print $4}') available"

- name: 🔍 Install jq for JSON linting
if: matrix.id == 'jsonlint'
run: sudo apt-get update && sudo apt-get install -y jq
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/04-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@

# 5️⃣ Install Python dependencies (main + test, skip dev)
- name: 📥 Install main + test dependencies (skip dev)
run: |
cd backend
# Install runtime + test deps; skip dev tools to reduce disk usage.
# Note: We intentionally skip the 'dev' group in unit tests to avoid
# heavy linters/type-checkers. pytest-cov and friends are declared in
# the 'test' group in pyproject.toml, so coverage still works.
# If coverage fails due to env drift, consider adding pytest-cov here
# explicitly or switching to `--with dev,test` selectively.
poetry install --with test --without dev
run: |

Check failure on line 95 in .github/workflows/04-pytest.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

95:7 syntax error: expected <block end>, but found '?' (syntax)

Check failure on line 95 in .github/workflows/04-pytest.yml

View workflow job for this annotation

GitHub Actions / YAML Lint

95:7 syntax error: expected <block end>, but found '?' (syntax)
cd backend
# Install runtime + test deps; skip dev tools to reduce disk usage.
# Note: We intentionally skip the 'dev' group in unit tests to avoid
# heavy linters/type-checkers. pytest-cov and friends are declared in
# the 'test' group in pyproject.toml, so coverage still works.
# If coverage fails due to env drift, consider adding pytest-cov here
# explicitly or switching to `--with dev,test` selectively.
poetry install --with test --without dev

# 6️⃣ Validate free disk space after cleanup (optional)
- name: ✅ Ensure sufficient free disk space
Expand Down
180 changes: 90 additions & 90 deletions .github/workflows/pr-devcontainer-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,93 +12,93 @@ jobs:
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check Dev Container Configuration
id: check-devcontainer
run: |
if [ -f ".devcontainer/devcontainer.json" ]; then
echo "devcontainer-exists=true" >> $GITHUB_OUTPUT
else
echo "devcontainer-exists=false" >> $GITHUB_OUTPUT
fi

- name: Comment on PR with Dev Container Instructions
if: steps.check-devcontainer.outputs.devcontainer-exists == 'true'
uses: actions/github-script@v7
with:
script: |
const prNumber = context.issue.number;
const branch = context.payload.pull_request.head.ref;

const comment = `## 🚀 Development Environment Options

This repository supports Dev Containers for a consistent development environment.

### Option 1: GitHub Codespaces (Recommended)

Create a cloud-based development environment:

1. Click the green **Code** button above
2. Select the **Codespaces** tab
3. Click **Create codespace on ${branch}**
4. Wait 2-3 minutes for environment setup
5. Start coding with all tools pre-configured!

### Option 2: VS Code Dev Containers (Local)

Use Dev Containers on your local machine:

1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop)
2. Install [VS Code](https://code.visualstudio.com/)
3. Install the [Dev Containers extension](
https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
4. Clone this PR branch locally
5. Open in VS Code and click "Reopen in Container" when prompted

### Option 3: Traditional Local Setup

Set up the development environment manually:

\`\`\`bash
# Clone the repository
git clone https://github.com/${{ github.repository }}.git
cd rag_modulo
git checkout ${branch}

# Initialize development environment
make dev-init
make dev-build
make dev-up
make dev-validate
\`\`\`

### Available Commands

Once in your development environment:

\`\`\`bash
make help # Show all available commands
make dev-validate # Validate environment setup
make test-atomic # Run atomic tests
make test-unit # Run unit tests
make lint # Run linting
\`\`\`

### Services Available

When running \`make dev-up\`:
- Backend API: http://localhost:8000
- Frontend: http://localhost:3000
- MLflow: http://localhost:5001

---
*This automated message helps reviewers quickly set up the development environment.*`;

await github.rest.issues.createComment({
issue_number: prNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
- name: Checkout code
uses: actions/checkout@v4

- name: Check Dev Container Configuration
id: check-devcontainer
run: |
if [ -f ".devcontainer/devcontainer.json" ]; then
echo "devcontainer-exists=true" >> $GITHUB_OUTPUT
else
echo "devcontainer-exists=false" >> $GITHUB_OUTPUT
fi

- name: Comment on PR with Dev Container Instructions
if: steps.check-devcontainer.outputs.devcontainer-exists == 'true'
uses: actions/github-script@v7
with:
script: |
const prNumber = context.issue.number;
const branch = context.payload.pull_request.head.ref;

const comment = `## 🚀 Development Environment Options

This repository supports Dev Containers for a consistent development environment.

### Option 1: GitHub Codespaces (Recommended)

Create a cloud-based development environment:

1. Click the green **Code** button above
2. Select the **Codespaces** tab
3. Click **Create codespace on ${branch}**
4. Wait 2-3 minutes for environment setup
5. Start coding with all tools pre-configured!

### Option 2: VS Code Dev Containers (Local)

Use Dev Containers on your local machine:

1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop)
2. Install [VS Code](https://code.visualstudio.com/)
3. Install the [Dev Containers extension](
https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
4. Clone this PR branch locally
5. Open in VS Code and click "Reopen in Container" when prompted

### Option 3: Traditional Local Setup

Set up the development environment manually:

\`\`\`bash
# Clone the repository
git clone https://github.com/${{ github.repository }}.git
cd rag_modulo
git checkout ${branch}

# Initialize development environment
make dev-init
make dev-build
make dev-up
make dev-validate
\`\`\`

### Available Commands

Once in your development environment:

\`\`\`bash
make help # Show all available commands
make dev-validate # Validate environment setup
make test-atomic # Run atomic tests
make test-unit # Run unit tests
make lint # Run linting
\`\`\`

### Services Available

When running \`make dev-up\`:
- Backend API: http://localhost:8000
- Frontend: http://localhost:3000
- MLflow: http://localhost:5001

---
*This automated message helps reviewers quickly set up the development environment.*`;

await github.rest.issues.createComment({
issue_number: prNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
Loading
Loading