Skip to content

Commit 313fea5

Browse files
authored
Merge pull request #9 from Governs-AI/test/coverage
Test/coverage
2 parents 9f5396f + c45a18b commit 313fea5

12 files changed

Lines changed: 454 additions & 45 deletions

File tree

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 2
9+
trim_trailing_whitespace = true
10+
11+
[*.py]
12+
indent_size = 4
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[Makefile]
18+
indent_style = tab

.github/labeler.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
area/docs:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- "**/*.md"
5+
- "**/*.mdx"
6+
- "docs/**"
7+
8+
area/frontend:
9+
- changed-files:
10+
- any-glob-to-any-file:
11+
- "app/**"
12+
- "components/**"
13+
- "pages/**"
14+
- "styles/**"
15+
- "public/**"
16+
17+
area/backend:
18+
- changed-files:
19+
- any-glob-to-any-file:
20+
- "app/**"
21+
- "api/**"
22+
- "server/**"
23+
- "src/**"
24+
- "main.py"
25+
26+
area/infra:
27+
- changed-files:
28+
- any-glob-to-any-file:
29+
- "docker-compose*.yml"
30+
- "**/Dockerfile*"
31+
- "infra/**"
32+
- "k8s/**"
33+
- "helm/**"
34+
- "**/*.tf"
35+
36+
area/sdk:
37+
- changed-files:
38+
- any-glob-to-any-file:
39+
- "governs_ai/**"
40+
- "src/**"
41+
- "pyproject.toml"
42+
- "package.json"
43+
- "tsconfig.json"
44+
45+
area/security:
46+
- changed-files:
47+
- any-glob-to-any-file:
48+
- "**/auth/**"
49+
- "**/security/**"
50+
- "manifest.json"
51+
- "**/*policy*"
52+
- "**/*permission*"
53+
54+
kind/ci:
55+
- changed-files:
56+
- any-glob-to-any-file:
57+
- ".github/workflows/**"
58+
- ".github/labeler.yml"
59+
60+
kind/tests:
61+
- changed-files:
62+
- any-glob-to-any-file:
63+
- "tests/**"
64+
- "**/*test*.py"
65+
- "**/*.spec.ts"
66+
- "**/*.test.ts"
67+
- "**/*.test.tsx"
68+
69+
kind/deps:
70+
- changed-files:
71+
- any-glob-to-any-file:
72+
- "package.json"
73+
- "pnpm-lock.yaml"
74+
- "requirements.txt"
75+
- "requirements-dev.txt"
76+
- "pyproject.toml"
77+
- "poetry.lock"

.github/workflows/labeler.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: PR Labeler
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
7+
jobs:
8+
label:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
14+
steps:
15+
- name: Label pull requests
16+
uses: actions/labeler@v5
17+
with:
18+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
19+
sync-labels: true

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Contributing to GovernsAI Precheck
2+
3+
## Setup
4+
5+
```bash
6+
python -m venv .venv
7+
source .venv/bin/activate
8+
pip install -e .[dev]
9+
```
10+
11+
## Development
12+
13+
```bash
14+
uvicorn app.main:app --reload --host 0.0.0.0 --port 8080
15+
```
16+
17+
## Validation
18+
19+
```bash
20+
pytest
21+
```
22+
23+
## Pull Request Checklist
24+
25+
- Add or update tests for policy behavior changes.
26+
- Keep API responses backward compatible unless versioned.
27+
- Document new environment variables and defaults.

PROJECT_SPECS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ GET /api/v1/health
154154
{
155155
"ok": true,
156156
"service": "governsai-precheck",
157-
"version": "0.0.1"
157+
"version": "0.1.0"
158158
}
159159
```
160160

@@ -170,7 +170,7 @@ GET /api/v1/ready
170170
{
171171
"ready": true,
172172
"service": "governsai-precheck",
173-
"version": "0.0.1",
173+
"version": "0.1.0",
174174
"checks": {
175175
"presidio": {"status": "ok", "message": "..."},
176176
"policy": {"status": "ok", "message": "..."},
@@ -284,7 +284,7 @@ GET /api/v1/health
284284
{
285285
"ok": true,
286286
"service": "governsai-precheck",
287-
"version": "0.0.1"
287+
"version": "0.1.0"
288288
}
289289
```
290290

@@ -300,7 +300,7 @@ GET /api/v1/ready
300300
{
301301
"ready": true,
302302
"service": "governsai-precheck",
303-
"version": "0.0.1",
303+
"version": "0.1.0",
304304
"checks": {
305305
"presidio": {
306306
"status": "ok",

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# GovernsAI Precheck
22

3+
[![npm](https://img.shields.io/npm/v/%40governs-ai%2Fsdk?label=npm%20%40governs-ai%2Fsdk)](https://www.npmjs.com/package/@governs-ai/sdk)
4+
[![PyPI](https://img.shields.io/pypi/v/governs-ai-sdk?label=PyPI%20governs-ai-sdk)](https://pypi.org/project/governs-ai-sdk/)
5+
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
6+
37
**Fully Open Source (MIT)** - PII detection and policy evaluation service for AI applications.
48

59
This service provides real-time policy evaluation and PII detection/redaction for AI tool usage. You can use it, modify it, and even offer it as a hosted service - no restrictions.
@@ -263,4 +267,4 @@ Precheck is the core of the GovernsAI ecosystem:
263267
- **Browser Extension** - MIT
264268
- **Platform Console** - ELv2 (source-available for self-hosting)
265269

266-
Learn more: [GovernsAI Licensing](https://docs.governsai.com/licensing)
270+
Learn more: [GovernsAI Licensing](https://docs.governsai.com/licensing)

app/api.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import hashlib
2020
import json
2121
import secrets
22+
import os
2223
from datetime import datetime
2324
from typing import List, Tuple, Optional
2425

@@ -110,7 +111,7 @@ async def health():
110111
return {
111112
"ok": True,
112113
"service": "governsai-precheck",
113-
"version": "0.0.1"
114+
"version": "0.1.0"
114115
}
115116

116117
@router.get("/v1/ready")
@@ -190,7 +191,7 @@ async def ready():
190191
return {
191192
"ready": overall_ready,
192193
"service": "governsai-precheck",
193-
"version": "0.0.1",
194+
"version": "0.1.0",
194195
"checks": checks,
195196
"timestamp": int(time.time())
196197
}
@@ -206,9 +207,9 @@ async def metrics():
206207
"""
207208
# Set service info if not already set
208209
set_service_info(
209-
version="0.0.1",
210-
build_date="2024-01-XX",
211-
git_commit="unknown"
210+
version="0.1.0",
211+
build_date=os.getenv("BUILD_DATE", "unknown"),
212+
git_commit=os.getenv("GIT_COMMIT", "unknown")
212213
)
213214

214215
metrics_data = get_metrics()

app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def create_app() -> FastAPI:
3939
_configure_logging()
4040
app = FastAPI(
4141
title="GovernsAI Precheck",
42-
version="0.0.1",
42+
version="0.1.0",
4343
description="Policy evaluation and PII redaction service for GovernsAI",
4444
lifespan=lifespan
4545
)

0 commit comments

Comments
 (0)