fix(ci): lint errors, remove webhook deploy, add ArgoCD GitOps k8s manifest update

- Fix ruff format: add blank line before nested function in app/views/filemanager.py
- Fix ruff format: use double-quote escaping in tests/test_config.py
- Remove deploy job (Portainer webhook) from ci.yml
- Add update-k8s-manifest job: after main-branch build, updates
  apps/docuelevate/preprod/docuelevate-stack.yaml in christianlouis/k8s-cluster-state
  with the new GHCR image tag (ghcr.io/christianlouis/docuelevate:main-<short-sha>)
  using mikefarah/yq@v4.44.6 and GH_PAT secret for cross-repo write access

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-21 09:40:52 +00:00
parent e4c50ce3c9
commit 895585c1e8
3 changed files with 39 additions and 6 deletions
+37 -5
View File
@@ -210,16 +210,48 @@ jobs:
cache-to: type=gha,mode=max
# ══════════════════════════════════════════════════════════════════════════
# Stage 4: Deploy (only after build succeeds, only on main branch)
# Stage 4: Update preprod K8s manifest (ArgoCD GitOps, only on main)
# ══════════════════════════════════════════════════════════════════════════
deploy:
name: Deploy to Production
update-k8s-manifest:
name: Update Preprod K8s Manifest
runs-on: ubuntu-latest
needs: [build]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: Call Deployment Webhook
- name: Compute image tag
id: tag
run: |
curl -X POST https://docker2.kuechenserver.org/api/stacks/webhooks/960c7d8e-97ec-4175-a8dc-73f037b02349
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
echo "image=ghcr.io/${{ github.repository_owner }}/docuelevate:main-${SHORT_SHA}" >> "$GITHUB_OUTPUT"
echo "tag=main-${SHORT_SHA}" >> "$GITHUB_OUTPUT"
- name: Checkout k8s-cluster-state
uses: actions/checkout@v4
with:
repository: christianlouis/k8s-cluster-state
token: ${{ secrets.GH_PAT }}
path: k8s-cluster-state
- name: Update image tag in preprod manifest
uses: mikefarah/yq@v4.44.6
env:
IMAGE: ${{ steps.tag.outputs.image }}
with:
cmd: |
yq -i '(.. | select(tag == "!!str") | select(test("^(ghcr\\.io/christianlouis/docuelevate|christianlouis/docuelevate):"))) = strenv(IMAGE)' \
k8s-cluster-state/apps/docuelevate/preprod/docuelevate-stack.yaml
- name: Commit and push
run: |
cd k8s-cluster-state
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add apps/docuelevate/preprod/docuelevate-stack.yaml
if git diff --staged --quiet; then
echo "No changes to commit -- image tag already up to date"
else
git commit -m "chore(preprod): update docuelevate image to ${{ steps.tag.outputs.tag }}"
git push
fi
+1
View File
@@ -172,6 +172,7 @@ def _db_records(db: Session, workdir_base: Path) -> List[Dict[str, Any]]:
"""
rows = []
for rec in db.query(FileRecord).order_by(FileRecord.id.desc()).all():
def _check(p: str | None) -> Dict[str, Any]:
if not p:
return {"path": None, "exists": None, "rel": None}
+1 -1
View File
@@ -352,7 +352,7 @@ class TestOuterQuoteStripping:
def test_mismatched_quotes_not_stripped(self):
"""Mismatched quotes (open with one type, close with another) are NOT stripped."""
raw = '"sqlite:///test.db\''
raw = "\"sqlite:///test.db'"
config = Settings(
database_url=raw,
**_BASE_KWARGS,