Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
2b38a98
Jules was unable to complete the task in time. Please review the work…
google-labs-jules[bot] Jun 18, 2025
4425353
Create 'scientific' branch for streamlined deployment
google-labs-jules[bot] Jun 18, 2025
6da791c
db
MasumRab Jun 19, 2025
56a6fd2
Merge remote-tracking branch 'origin/jules_wip_3595764944859644510_sc…
MasumRab Jun 23, 2025
7676051
Merge pull request #101 from MasumRab/fix/refactor-email-routes-and-f…
MasumRab Sep 26, 2025
d5d1fb3
Merge branch 'scientific' of https://github.com/MasumRab/EmailIntelli…
MasumRab Sep 26, 2025
e9541ce
Refactor: Remove non-Python dependencies and unify backend
google-labs-jules[bot] Sep 27, 2025
0ae2db5
Merge remote-tracking branch 'origin/feature/remove-non-python-deps' …
MasumRab Sep 27, 2025
31bf847
Add initial project configs and documentation
MasumRab Sep 27, 2025
60186c4
Squashed commit of the following:
MasumRab Sep 27, 2025
5e75bf2
Add GitHub Actions for CI and Dependabot auto-merge
openhands-agent Sep 28, 2025
77a0b9a
Fix critical GitHub Actions workflow issues
openhands-agent Sep 28, 2025
2cd2f6b
Modernize EmailIntelligence: Update dependencies and fix compatibility
openhands-agent Sep 28, 2025
c04d1bc
Merge remote changes with GitHub Actions improvements
openhands-agent Sep 28, 2025
3b96d0a
feat: Allow searching emails within a specific category
google-labs-jules[bot] Sep 28, 2025
535fe72
Merge remote-tracking branch 'origin/fix-search-in-category' into sci…
MasumRab Sep 28, 2025
9199144
Fix multiple bugs and stabilize the Python backend test suite
google-labs-jules[bot] Sep 28, 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
11 changes: 11 additions & 0 deletions .continue/models/new-model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: New model
version: 0.0.1
schema: v1
models:
- provider: anthropic
model: claude-3-7-sonnet-latest
apiKey: ${{ secrets.ANTHROPIC_API_KEY }}
name: Claude 3.7 Sonnet
roles:
- chat
- edit
8 changes: 8 additions & 0 deletions .continue/prompts/new-prompt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: New prompt
version: 0.0.1
schema: v1
prompts:
- name: New prompt
description: New prompt
prompt: Please write a thorough suite of unit tests for this code, making sure
to cover all relevant edge cases
5 changes: 5 additions & 0 deletions .continue/rules/new-rule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: New rule
version: 0.0.1
schema: v1
rules:
- Always give concise responses
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 100
exclude = .git,__pycache__,build,dist
ignore = E203, W503
61 changes: 61 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# GitHub Actions Workflows

This directory contains GitHub Actions workflows for the EmailIntelligence project.

## Workflows

### 1. CI Workflow (`ci.yml`)
- **Trigger**: Push to `main` or `scientific` branches, and pull requests targeting these branches
- **Purpose**: Runs comprehensive tests, linting, and type checking for all code changes
- **Features**:
- Python 3.11 testing
- pytest with coverage reporting
- Code formatting checks (black, isort)
- Linting (flake8)
- Type checking (mypy)

### 2. Dependabot Auto-Merge (`dependabot-auto-merge.yml`)
- **Trigger**: Pull requests opened, synchronized, or reopened
- **Purpose**: Automatically merges Dependabot pull requests when CI passes
- **Safety Features**:
- Only runs for PRs created by `dependabot[bot]`
- Uses GitHub's native PR status checks (no bash JSON parsing)
- Waits for CI workflow completion before proceeding
- Verifies PR is mergeable and not in draft state using GitHub context
- Comprehensive error handling for GitHub CLI operations
- Adds approval comment before enabling auto-merge
- Uses GitHub's auto-merge feature for safety

## Security Considerations

The Dependabot auto-merge workflow includes several safety measures:
1. **Identity Verification**: Only runs for PRs from `dependabot[bot]`
2. **CI Dependency**: Waits for and requires CI workflow success
3. **Native GitHub Checks**: Uses GitHub's built-in PR status instead of fragile parsing
4. **Merge Readiness**: Verifies PR is in a mergeable state using GitHub context
5. **Error Handling**: Comprehensive error handling with graceful degradation
6. **Approval Process**: Automatically approves and adds explanatory comment

## Setup Requirements

For the workflows to function properly, ensure:
1. The repository has the necessary permissions for GitHub Actions
2. The `GITHUB_TOKEN` has sufficient permissions for auto-merge operations
3. Branch protection rules (if any) are compatible with auto-merge
4. All dependencies are properly defined in `pyproject.toml`

## Customization

To modify the auto-merge behavior:
- Edit the conditions in the workflow `if` statement (line 15)
- Adjust the CI check name in the `wait-for-check` action (line 23)
- Modify the merge strategy (currently uses `--merge`, could use `--squash` or `--rebase`)
- Change timeout values for CI wait (currently 600 seconds)
Comment on lines +50 to +53
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.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

Update line references to match actual CI workflow.

The customization section references line numbers that may not align with the actual CI workflow structure. The wait-for-check action and specific line references should be verified against the actual workflow files.


🏁 Script executed:

#!/bin/bash
# Description: Check the actual structure of CI workflow files

find .github/workflows -name "*.yml" -exec echo "=== {} ===" \; -exec cat {} \;

Length of output: 3038


Update README.md workflow customization section to use correct references
In .github/workflows/README.md, replace the hard-coded line numbers for the job-level if clause, the checkName in the wait-for-check step, merge strategy flag, and timeout settings so they align with the actual .github/workflows/dependabot-auto-merge.yml.

🤖 Prompt for AI Agents
.github/workflows/README.md around lines 50 to 53: the README references
hard-coded line numbers, a checkName, merge flag, and timeout that don't match
.github/workflows/dependabot-auto-merge.yml; update the README to reference the
actual job-level if clause location (or remove line-number references entirely),
use the exact checkName string from dependabot-auto-merge.yml for the
wait-for-check step, change the merge strategy flag to match the workflow's
configured strategy (--merge/--squash/--rebase) and set the timeout value to the
same seconds used in the workflow (replace 600 with the workflow's timeout),
ensuring all README examples mirror the live file rather than hard-coded line
numbers.


## Architecture Improvements

The workflows have been optimized for:
- **Reliability**: Native GitHub API usage instead of bash JSON parsing
- **Simplicity**: Single-purpose jobs without unnecessary complexity
- **Error Handling**: Comprehensive error checking with graceful degradation
- **Performance**: Eliminates duplicate test runs by trusting CI results
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [ main, scientific ]
pull_request:
branches: [ main, scientific ]

jobs:
test:
runs-on: ubuntu-latest

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

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
Comment on lines +18 to +20
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 | 🟡 Minor

Update GitHub Actions to use the latest version.

The static analysis tool correctly identified that actions/setup-python@v4 is deprecated. The latest version is v5, which provides better performance and security updates.

Apply this diff to update the action:

-      - name: Set up Python
-        uses: actions/setup-python@v4
-        with:
+      - name: Set up Python
+        uses: actions/setup-python@v5
+        with:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
🧰 Tools
🪛 actionlint (1.7.7)

18-18: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
.github/workflows/ci.yml around lines 18 to 20: update the GitHub Action
reference from actions/setup-python@v4 to actions/setup-python@v5 to use the
latest supported release; modify the uses line accordingly so the workflow uses
actions/setup-python@v5.


- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Install dependencies
run: |
uv sync --dev

- name: Run tests
run: |
uv run pytest backend/ -v --tb=short --cov=backend --cov-report=xml

- name: Run linting
run: |
uv run flake8 backend/
uv run black --check backend/
uv run isort --check-only backend/

- name: Type checking
run: |
uv run mypy backend/ --show-error-codes --no-strict-optional
54 changes: 54 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Dependabot Auto-Merge

on:
pull_request:
types: [opened, synchronize, reopened]

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

jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' && github.event.pull_request.mergeable_state == 'clean' && !github.event.pull_request.draft

Comment on lines +15 to +16
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

Workflow guard skips all Dependabot merges

github.event.pull_request.mergeable_state is usually unknown/blocked on opened and synchronize events (especially while CI is pending), so this job never runs and auto-merge never activates. Let the job execute for Dependabot PRs and rely on the explicit wait + gh checks instead.

-    if: github.actor == 'dependabot[bot]' && github.event.pull_request.mergeable_state == 'clean' && !github.event.pull_request.draft
+    if: github.actor == 'dependabot[bot]' && !github.event.pull_request.draft
🤖 Prompt for AI Agents
.github/workflows/dependabot-auto-merge.yml lines 15-16: the current workflow
guard includes github.event.pull_request.mergeable_state == 'clean', which
prevents the job from running for Dependabot PRs because mergeable_state is
often 'unknown'/'blocked' on opened/synchronize events; remove the
mergeable_state check so the if condition only checks the actor is
dependabot[bot] and that the PR is not a draft, allowing the job to run and rely
on the existing explicit wait and gh checks to determine mergeability.

steps:
- name: Wait for CI checks to complete
uses: fountainhead/action-wait-for-check@v1.2.0
id: wait-for-ci
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: test
ref: ${{ github.event.pull_request.head.sha }}
timeoutSeconds: 600
intervalSeconds: 10

- name: Auto-merge Dependabot PR
if: steps.wait-for-ci.outputs.conclusion == 'success'
run: |
set -e
echo "CI checks passed. Auto-merging Dependabot PR #${{ github.event.pull_request.number }}"

# Approve the PR first
if ! gh pr review ${{ github.event.pull_request.number }} --approve --body "✅ CI checks passed! Auto-merging this Dependabot PR."; then
echo "Failed to approve PR. Exiting."
exit 1
fi

# Enable auto-merge
if ! gh pr merge --auto --merge ${{ github.event.pull_request.number }}; then
echo "Failed to enable auto-merge. Checking if already enabled..."
# Check if auto-merge is already enabled
if gh pr view ${{ github.event.pull_request.number }} --json autoMergeRequest --jq '.autoMergeRequest' | grep -q "null"; then
echo "Auto-merge failed and is not enabled. Manual intervention required."
exit 1
else
echo "Auto-merge is already enabled."
fi
fi

echo "Auto-merge successfully enabled for PR #${{ github.event.pull_request.number }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92 changes: 67 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,45 +1,87 @@
jsons
node_modules
dist
# General
.DS_Store
server/public
Thumbs.db
generated-icon.png

# Logs
logs/
*.log

# Node / frontend
node_modules/
dist/
vite.config.ts.*
*.tar.gz
.vscode/settings.json
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-lock.yaml
package-lock.json
uv.lock
Comment on lines +17 to +19
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

Do not ignore package manager lockfiles.

Filtering out pnpm-lock.yaml, package-lock.json, and uv.lock prevents us from committing the dependency locks that guarantee reproducible installs for both the remaining JS toolchain and the new Python uv workflow. Dropping these files from version control will cause CI/local environments to drift from each other, undermining the PR’s stated goal of stabilizing the backend and the test suite. Please keep these lockfiles tracked (remove the ignore patterns) so installs stay deterministic.

Apply this diff to fix the issue:

- pnpm-lock.yaml
- package-lock.json
- uv.lock
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pnpm-lock.yaml
package-lock.json
uv.lock
🤖 Prompt for AI Agents
In .gitignore around lines 17 to 19, the lockfiles pnpm-lock.yaml,
package-lock.json, and uv.lock are being ignored which prevents committing
dependency lockfiles; remove those three ignore entries (delete the lines or
comment them out) from .gitignore and then add/commit the corresponding
lockfiles to the repo so installs remain deterministic for CI and local
environments.


# Python caches and artifacts
__pycache__/
*.py[cod]
*$py.class
.pytest_cache/
.mypy_cache/
.cache/
htmlcov/

# Python virtual environment created by launch.py
# Virtual environments
venv/
.venv/
env/
ENV/
.Python

# Environment & secret files
.env
.env.*
*.env
!.env.example
jsons/*
token.json
credentials.json
apikey.json

# Ignore configuration and local environment files
*.local.config
*.local.json
*.local.yaml
*.local.yml
config.local.*
# Build / packaging
build/
dist/
*.egg-info/
pip-wheel-metadata/
*.egg
*.whl

# Ignore hidden files and directories, except for specific exceptions
.*
!docs/.gitkeep
# Databases
*.sqlite3
*.db
*.db-journal

# Ignore Python cache and diagnostic files
__pycache__/
# Coverage
.coverage
.coverage.*
coverage.xml
coverage/
*.cover

# IDEs / editors
.vscode/
.vscode/settings.json
.idea/
*.iml
*.sublime-project
*.sublime-workspace
.history

# Misc
diagnosis_message.txt
# Ignore config files generated by local runs
*.local.config
*.local.json
*.local.yaml
*.local.yml
config.local.*
config/*.local.*

# Ignore all dotfiles (hidden files)
.*
# Keep the docs placeholder
!docs/.gitkeep
__pycache__/
diagnosis_message.txt

# Ignore the jsons folder which may contain local data/secrets
jsons/
Loading
Loading