Skip to content

Commit 752b279

Browse files
authored
Run GH-Action PR-Checks on merge; also show GH-Action badges (#113)
* run PR Checks on merge to catch "ships-passing-in-the-night" issues * add Github Action badges for PR Checks and CI-CD workflows * fix broken pandas import into dev environment for generate_conversation/chat.py
1 parent b69ec51 commit 752b279

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

.github/workflows/pr-check.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ name: PR Checks
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
5+
types: [opened, synchronize, reopened, closed]
66

77
jobs:
88
backend-test:
9+
# skip this check for closed PRs that are not merged
10+
if: ${{ github.event.action != 'closed' || github.event.pull_request.merged == true }}
911
runs-on: ubuntu-latest
1012
defaults:
1113
run:
@@ -44,6 +46,8 @@ jobs:
4446
run: uv run pytest -v -s
4547

4648
frontend-build:
49+
# skip this check for closed PRs that are not merged
50+
if: ${{ github.event.action != 'closed' || github.event.pull_request.merged == true }}
4751
runs-on: ubuntu-latest
4852
defaults:
4953
run:

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Live at https://tenantfirstaid.com/
66

77
## Local Development
88

9+
[![PR Checks](https://github.com/codeforpdx/tenantfirstaid/actions/workflows/pr-check.yml/badge.svg)](https://github.com/codeforpdx/tenantfirstaid/actions/workflows/pr-check.yml)
10+
[![CI-CD](https://github.com/codeforpdx/tenantfirstaid/actions/workflows/deploy.yml/badge.svg)](https://github.com/codeforpdx/tenantfirstaid/actions/workflows/deploy.yml)
11+
912
### Prerequisites
1013
- [uv](https://docs.astral.sh/uv/getting-started/installation/)
1114
- [docker](https://www.docker.com/)

backend/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ dependencies = [
1111
"simplejson",
1212
"ipdb>=0.13.13",
1313
"python-dotenv",
14-
]
14+
"pandas>=2.3.0",
15+
]
1516

1617
[tool.setuptools.packages.find]
1718
where = ["."]

backend/scripts/generate_conversation/chat.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
# /// script
2+
# requires-python = "~=3.11"
3+
# dependencies = [
4+
# "openai",
5+
# "pandas",
6+
# ]
7+
# ///
18
from openai import OpenAI
29
import os
310
import ast
411
import argparse
512
from pathlib import Path
613
import pandas as pd
14+
from typing import Self
715

816

917
BOT_INSTRUCTIONS = """Pretend you're a legal expert who giving advice about eviction notices in Oregon.
@@ -36,12 +44,13 @@
3644

3745

3846
class ChatView:
39-
client = OpenAI(
40-
api_key=API_KEY,
41-
base_url=BASE_URL,
42-
)
47+
client: Self
4348

4449
def __init__(self, starting_message, user_facts):
50+
self.client = OpenAI(
51+
api_key=API_KEY,
52+
base_url=BASE_URL,
53+
)
4554
VECTOR_STORE_ID = os.getenv("VECTOR_STORE_ID")
4655
NUM_FILE_SEARCH_RESULTS = os.getenv("NUM_FILE_SEARCH_RESULTS", 10)
4756
self.input_messages = [{"role": "user", "content": starting_message}]

backend/uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)