Skip to content

Commit 493e6f4

Browse files
authored
Merge pull request #18 from telexintegrations/ci/cd
fix(ci): fix attempt at installation errors
2 parents 01ea97e + 64ce995 commit 493e6f4

File tree

6 files changed

+126
-74
lines changed

6 files changed

+126
-74
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CD pipeline to auto-deploy on merges to main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
auto-deploy:
10+
runs-on: ubuntu-latest
11+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
12+
13+
steps:
14+
- name: deploy app
15+
uses: appleboy/ssh-action@master
16+
with:
17+
host: ${{ secrets.HOST }}
18+
username: ${{ secrets.USERNAME }}
19+
key: ${{ secrets.KEY }}
20+
script: |
21+
cd commit-quality-monitor
22+
git pull origin main
23+
source ./venv/bin/activate
24+
pip install -r requirements.txt
25+
sudo systemctl restart fastapi
26+
sudo systemctl restart nginx

.github/workflows/pytest.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI pipeline to run pytest on pull requests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- staging
7+
8+
jobs:
9+
pytest:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository for workflow access
13+
uses: actions/checkout@v4
14+
15+
- name: set up python environment
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: '3.12'
19+
20+
- name: install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -r requirements.txt
24+
25+
- name: run tests
26+
run: |
27+
pytest

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Git Commit Quality Monitor analyzes commit messages in real-time, providing inst
1818

1919
### Prerequisites
2020

21-
- Python 3.8+
21+
- Python 3.12
2222
- FastAPI
2323
- scikit-learn
2424
- Git (for development)
@@ -75,7 +75,6 @@ cp .env.example .env
7575
| HOST | Server host | 0.0.0.0 |
7676
| PORT | Server port | 8000 |
7777
| TELEX_WEBHOOK_URL | Telex webhook URL | https://ping.telex.im/v1/webhooks |
78-
| SLACK_URL | Slack webhook URL for notifications | https://hooks.slack.com/... |
7978
| APP_LOGO_URL | URL for app logo | https://example.com/logo.png |
8079
| APP_URL | Application URL | https://your-app.com |
8180
| TARGET_URL | Telex target URL | https://your-app.com/webhook/telex |
@@ -248,9 +247,9 @@ You can customize the analyzer through Telex integration settings:
248247
```json
249248
{
250249
"feat": [
251-
"feat(ui): add dark mode toggle",
252-
"feat(api): implement rate limiting"
253-
]
250+
"feat(auth): implement JWT authentication flow\n\nImplemented JWT-based authentication with token expiration handling to secure user sessions.",
251+
"feat(ui): add dark mode toggle with system preference detection\n\nAdded dark mode toggle that automatically adjusts based on system settings for improved user experience.",
252+
],
254253
}
255254
```
256255

requirements.txt

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
1-
annotated-types==0.7.0
2-
anyio==4.8.0
3-
black==25.1.0
4-
certifi==2025.1.31
5-
click==8.1.8
6-
dnspython==2.7.0
7-
email_validator==2.2.0
8-
fastapi==0.115.8
9-
fastapi-cli==0.0.7
10-
h11==0.14.0
11-
httpcore==1.0.7
12-
httptools==0.6.4
13-
httpx==0.28.1
14-
idna==3.10
15-
iniconfig==2.0.0
16-
itsdangerous==2.2.0
17-
Jinja2==3.1.5
18-
joblib==1.4.2
19-
markdown-it-py==3.0.0
20-
MarkupSafe==3.0.2
21-
mdurl==0.1.2
22-
mypy-extensions==1.0.0
23-
nltk==3.9.1
24-
numpy==2.2.3
25-
orjson==3.10.15
26-
packaging==24.2
27-
pathspec==0.12.1
28-
platformdirs==4.3.6
29-
pluggy==1.5.0
30-
pydantic==2.10.6
31-
pydantic-extra-types==2.10.2
32-
pydantic-settings==2.7.1
33-
pydantic_core==2.27.2
34-
Pygments==2.19.1
35-
pytest==8.3.4
36-
python-dotenv==1.0.1
37-
python-multipart==0.0.20
38-
PyYAML==6.0.2
39-
regex==2024.11.6
40-
rich==13.9.4
41-
rich-toolkit==0.13.2
42-
scikit-learn==1.6.1
43-
scipy==1.15.2
44-
shellingham==1.5.4
45-
sniffio==1.3.1
46-
starlette==0.45.3
47-
textblob==0.19.0
48-
threadpoolctl==3.5.0
49-
tqdm==4.67.1
50-
typer==0.15.1
51-
typing_extensions==4.12.2
52-
ujson==5.10.0
53-
uvicorn==0.34.0
54-
uvloop==0.21.0
55-
watchfiles==1.0.4
56-
websockets==15.0
1+
annotated-types
2+
anyio
3+
black
4+
certifi
5+
click
6+
dnspython
7+
email_validator
8+
fastapi
9+
fastapi-cli
10+
h11
11+
httpcore
12+
httptools
13+
httpx
14+
idna
15+
iniconfig
16+
itsdangerous
17+
Jinja2
18+
joblib
19+
markdown-it-py
20+
MarkupSafe
21+
mdurl
22+
mypy-extensions
23+
nltk
24+
numpy
25+
orjson
26+
packaging
27+
pathspec
28+
platformdirs
29+
pluggy
30+
pydantic
31+
pydantic-extra-types
32+
pydantic-settings
33+
pydantic_core
34+
Pygments
35+
pytest
36+
python-dotenv
37+
python-multipart
38+
PyYAML
39+
regex
40+
rich
41+
rich-toolkit
42+
scikit-learn
43+
scipy
44+
shellingham
45+
sniffio
46+
starlette
47+
textblob
48+
threadpoolctl
49+
tqdm
50+
typer
51+
typing_extensions
52+
ujson
53+
uvicorn
54+
uvloop
55+
watchfiles
56+
websockets

src/config/config.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33

44

55
class Settings(BaseSettings):
6-
allowed_origins: str
7-
allowed_hosts: str
8-
host: str
9-
port: int
10-
reload_value: str
11-
telex_webhook_url: str
6+
allowed_origins: str = "http://test"
7+
allowed_hosts: str = "test"
8+
host: str = "127.0.0.1"
9+
port: int = 8000
10+
reload_value: str = "true"
11+
telex_webhook_url: str = "https://example.com/telex"
1212
curl_command: str | None = "curl" # might require path/to/curl e.g. `/usr/bin/curl`
13-
app_logo_url: str
14-
app_url: str
15-
target_url: str
16-
background_color_hexcode: str
13+
app_logo_url: str = "https://example.com/logo.png"
14+
app_url: str = "https://example.com"
15+
target_url: str = "https://example.com/target"
16+
background_color_hexcode: str = "#FFFFFF"
1717

1818
model_config = SettingsConfigDict(env_file=".env")
1919

src/core/analyzer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ def _apply_data_settings(self):
4747
"""
4848
for setting in self.settings:
4949
if setting["label"] == "commit_types":
50-
self.commit_types.update(ast.literal_eval(setting["default"])) if setting["default"] else self.commit_types
50+
self.commit_types.update(ast.literal_eval(setting["default"].replace("\n", "\\n"))) if setting["default"] else self.commit_types
5151
if setting["label"] == "example_commits":
52-
self.example_commits.update(ast.literal_eval(setting["default"])) if setting["default"] else self.example_commits
52+
self.example_commits.update(ast.literal_eval(setting["default"].replace("\n", "\\n"))) if setting["default"] else self.example_commits
5353
if setting["label"] == "training_data":
54-
self.commit_training_data.update(ast.literal_eval(setting["default"])) if setting["default"] else self.commit_training_data
54+
self.commit_training_data.update(ast.literal_eval(setting["default"].replace("\n", "\\n"))) if setting["default"] else self.commit_training_data
5555
if setting["label"] == "slack_url":
5656
self.slack_url = setting["default"]
5757

0 commit comments

Comments
 (0)