Skip to content

Commit a2c57df

Browse files
authored
Add ML worker CI and PR template
Adds the ML worker CI workflow, updates the default PR template, and aligns README and contributing guidance with the pytest workflow.
1 parent 1a8e8f1 commit a2c57df

5 files changed

Lines changed: 78 additions & 32 deletions

File tree

.github/pull_request_template.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
## Summary
22

3-
- what changed
4-
- why it changed
5-
- what areas are affected
3+
-
64

75
## Linked Issue
86

9-
- closes #
7+
Closes #
108

11-
## Checklist
9+
## What Changed
1210

13-
- [ ] I did not push directly to `main`
14-
- [ ] This branch has small logical commits
15-
- [ ] I reviewed my own diff before requesting merge
16-
- [ ] `app` compiles with `npx tsc --noEmit`
17-
- [ ] `backend` tests pass with `mvn test`
18-
- [ ] Any architecture-impacting changes are documented
11+
-
1912

20-
## Screens / API Notes
13+
## Verification
2114

22-
- frontend changes:
23-
- backend changes:
24-
- AI / reasoning changes:
25-
- ML worker changes:
15+
- [ ] `cd app && npx tsc --noEmit`
16+
- [ ] `cd backend && mvn test`
17+
- [ ] `cd ml-worker && pytest`
18+
- [ ] Other:
2619

27-
## Review Focus
20+
## Review Notes
2821

29-
- what should reviewers check most closely?
22+
- Areas to check:
23+
- Data, API, or ML worker contract changes:
3024

31-
## Risks
25+
## Risks And Follow-Up
3226

33-
- known gaps:
34-
- follow-up work:
27+
-

.github/workflows/ml-worker.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: ML Worker
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/ml-worker.yml"
7+
- "ml-worker/**"
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- ".github/workflows/ml-worker.yml"
13+
- "ml-worker/**"
14+
workflow_dispatch:
15+
16+
jobs:
17+
test:
18+
name: Python ${{ matrix.python-version }}
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
python-version:
24+
- "3.11"
25+
- "3.12"
26+
27+
steps:
28+
- name: Check out repository
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
cache: pip
36+
cache-dependency-path: |
37+
ml-worker/pyproject.toml
38+
ml-worker/requirements*.txt
39+
40+
- name: Install worker
41+
working-directory: ml-worker
42+
run: python -m pip install -e ".[dev]"
43+
44+
- name: Run tests
45+
working-directory: ml-worker
46+
run: pytest

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Avoid mixing UI redesign, backend behavior, and infra changes in a single commit
3737

3838
- Use the issue templates for bug reports and feature requests.
3939
- A PR should close or clearly reference one tracked issue unless the change is emergency-only.
40+
- Use `.github/pull_request_template.md` for every PR. Keep the summary short, link the issue, and list the verification commands that actually ran.
4041
- The PR description should call out the exact frontend, backend, or ML worker surface touched.
4142
- If a change is intentionally partial, note the follow-up issue in the PR body.
4243

@@ -48,6 +49,7 @@ Before merging a PR, check:
4849
- architecture impact is documented
4950
- API contracts are explicit
5051
- tests pass
52+
- ML worker changes include `cd ml-worker && pytest` output or a clear reason it was not run
5153
- mobile build still compiles
5254
- no dead demo-only code path was introduced silently
5355
- performance-sensitive reads and renders are considered

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The app should stay simple and cheap to run:
5656

5757
- Node.js 16+ for frontend
5858
- Java 17+ for backend
59-
- Python 3.8+ for ML worker
59+
- Python 3.11+ for ML worker
6060

6161
### Frontend
6262

@@ -76,9 +76,12 @@ mvn spring-boot:run
7676

7777
```bash
7878
cd ml-worker
79-
python3 -m unittest discover -s tests
79+
python -m pip install -e ".[dev]"
80+
pytest
8081
```
8182

83+
The same worker test command runs in GitHub Actions for pull requests that touch `ml-worker` or the worker workflow.
84+
8285
## Notes
8386

8487
- The OCR worker now emits a payload shape that the Spring Boot backend can consume.

ml-worker/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Sentri OCR Worker
22

3-
[![CI](https://github.com/yourusername/sentri/workflows/CI/badge.svg)](https://github.com/yourusername/sentri/actions)
3+
[![ML Worker](https://github.com/SahilKumar75/sentri/actions/workflows/ml-worker.yml/badge.svg)](https://github.com/SahilKumar75/sentri/actions/workflows/ml-worker.yml)
44
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
55
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
66
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
@@ -9,13 +9,13 @@ Zero-budget OCR and timetable parsing worker for Sentri. Designed to sit behind
99

1010
## Features
1111

12-
- 🔍 **OCR Processing** - Extract text from timetable images using Tesseract
13-
- 📊 **Intelligent Parsing** - Convert raw OCR text into structured timetable entries
14-
- 🎯 **High Accuracy** - Deterministic parsing logic with fuzzy matching
15-
- 🔧 **Configurable** - Tuning profiles for customization
16-
- 📈 **Metrics** - Built-in performance monitoring and evaluation
17-
- 🐳 **Docker Ready** - Containerized deployment with Docker Compose
18-
- **Well Tested** - Comprehensive test suite with high coverage
12+
- OCR processing with Tesseract when the binary is available
13+
- Deterministic parsing from raw OCR text and cell-like table input
14+
- Fuzzy matching for common timetable OCR errors
15+
- Tuning profiles for subject, faculty, and parser behavior
16+
- Metrics and fixture evaluation for parser quality checks
17+
- Docker support for repeatable local runs
18+
- Pytest coverage for parser, worker, cache, validation, and utility code
1919

2020
## Quick Start
2121

@@ -117,7 +117,7 @@ pre-commit install
117117

118118
```bash
119119
# Run all tests
120-
make test
120+
pytest
121121

122122
# Run with coverage
123123
make test-cov
@@ -126,6 +126,8 @@ make test-cov
126126
pytest tests/test_parser.py -v
127127
```
128128

129+
GitHub Actions runs `pytest` on Python 3.11 and 3.12 whenever a pull request changes worker files.
130+
129131
### Code Quality
130132

131133
```bash

0 commit comments

Comments
 (0)