chore(ci): remove Sonar (#355)
Some checks failed
Release / Tag release (push) Successful in 35s
Release / Create Release (push) Successful in 9s
Release / Publish Docker Images (push) Failing after 2m41s
Snyk / security (push) Successful in 2m15s

Reviewed-on: #355
This commit is contained in:
Luke Tainton 2025-05-31 13:08:47 +02:00
parent 800ad92e52
commit 0da568d5eb
4 changed files with 43 additions and 23 deletions

View File

@ -40,6 +40,9 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: uv sync run: uv sync
- name: Check Import Sorting
run: uv run isort --check app/ tests/
- name: Lint - name: Lint
run: | run: |
@ -49,23 +52,44 @@ jobs:
- name: Unit Test - name: Unit Test
run: | run: |
uv run coverage run -m pytest -v --junitxml=testresults.xml uv run coverage run -m pytest -v --junitxml=testresults.xml
uv run coverage xml uv run coverage report
sed -i 's@${{ gitea.workspace }}@/github/workspace@g' coverage.xml # sed -i 's@${{ gitea.workspace }}@/github/workspace@g' coverage.xml
- name: Minimize uv cache - name: Minimize uv cache
run: uv cache prune --ci run: uv cache prune --ci
- name: SonarQube Scan # - name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v5.2.0 # uses: SonarSource/sonarqube-scan-action@v5.2.0
env: # env:
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST_URL }} # SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} # SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
- name: Snyk Vulnerability Scan - name: Set up environment for Snyk
run: |
uv pip freeze > requirements.txt
mv pyproject.toml pyproject.toml.bak
mv uv.lock uv.lock.bak
- name: Snyk SAST Scan
uses: snyk/actions/python@master uses: snyk/actions/python@master
continue-on-error: true # Sometimes vulns aren't immediately fixable
env: env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with: with:
command: snyk # command: snyk
args: test --all-projects args: snyk code test #--all-projects --exclude=.archive
# - name: Snyk Vulnerability Scan
# uses: snyk/actions/python@master
# continue-on-error: true # Sometimes vulns aren't immediately fixable
# env:
# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
# DEBUG: "*snyk*"
# with:
# # command: snyk
# args: snyk test #--all-projects --exclude=.archive
- name: Reverse set up environment for Snyk
run: |
rm -f requirements.txt
mv pyproject.toml.bak pyproject.toml
mv uv.lock.bak uv.lock

4
.gitignore vendored
View File

@ -27,6 +27,7 @@ share/python-wheels/
*.egg *.egg
MANIFEST MANIFEST
.pdm-build/ .pdm-build/
requirements*.txt
# PyInstaller # PyInstaller
# Usually these files are written by a python script from a template # Usually these files are written by a python script from a template
@ -136,3 +137,6 @@ dmypy.json
# IDE # IDE
.vscode .vscode
.idea .idea
# Other
.dccache

View File

@ -4,16 +4,8 @@ import logging
from webex_bot.models.command import Command from webex_bot.models.command import Command
from webex_bot.models.response import Response, response_from_adaptive_card from webex_bot.models.response import Response, response_from_adaptive_card
from webexpythonsdk.models.cards import ( from webexpythonsdk.models.cards import (AdaptiveCard, Column, ColumnSet, Date,
AdaptiveCard, FontSize, FontWeight, Text, TextBlock)
Column,
ColumnSet,
Date,
FontSize,
FontWeight,
Text,
TextBlock,
)
from webexpythonsdk.models.cards.actions import Submit from webexpythonsdk.models.cards.actions import Submit
from app.utils.config import config from app.utils.config import config

View File

@ -20,7 +20,7 @@ def __n8n_post(data: dict) -> bool:
headers=headers, headers=headers,
json=data, json=data,
timeout=10, timeout=10,
verify=False, verify=True,
) )
return bool(resp.status_code == 200) return bool(resp.status_code == 200)
@ -61,7 +61,7 @@ def get_tasks(requestor) -> bool:
url=config.n8n_webhook_url, url=config.n8n_webhook_url,
headers=headers, headers=headers,
timeout=10, timeout=10,
verify=False, verify=True,
params={"requestor": requestor}, params={"requestor": requestor},
) )
_data = bool(resp.status_code == 200) _data = bool(resp.status_code == 200)