From 8e75a65fb619c023f757487117d9bd55bd062b7f Mon Sep 17 00:00:00 2001 From: Thomas Enjalbert Date: Thu, 11 Jun 2026 10:58:05 +0200 Subject: [PATCH 1/2] fix: update Azure App Service app names for staging and production deployments --- .github/workflows/cicd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 8f40536..e9cedad 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -39,14 +39,14 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.11" - + - name: Installer les dépendances run: pip install -r ressources/requirements.txt - name: Déployer sur Azure App Service (staging) uses: azure/webapps-deploy@v3 with: - app-name: "ten-nexacloud-api-staging-27050" + app-name: "ten-nexacloud-api-staging-28547" publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_STAGING }} package: ressources/ @@ -77,7 +77,7 @@ jobs: - name: Déployer sur Azure App Service (production) uses: azure/webapps-deploy@v3 with: - app-name: "ten-nexacloud-api-production-29408" + app-name: "ten-nexacloud-api-production-7220" publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PRODUCTION }} package: ressources/ From 11fa4f8bdddd6c6679cedcb95d3449e986a37746 Mon Sep 17 00:00:00 2001 From: Thomas Enjalbert Date: Thu, 11 Jun 2026 11:09:13 +0200 Subject: [PATCH 2/2] feat: add endpoint /logs/stats --- ressources/app.py | 9 +++++++++ ressources/test_app.py | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ressources/app.py b/ressources/app.py index d7e75f2..eee358d 100644 --- a/ressources/app.py +++ b/ressources/app.py @@ -38,5 +38,14 @@ def logs_critical(): return jsonify({"critical_count": seuil, "alerte": alerte}) +@app.route("/logs/stats") +def logs_stats(): + total = sum(LOG_SUMMARY.values()) + return jsonify({ + "total": total, + "breakdown": LOG_SUMMARY + }) + + if __name__ == "__main__": app.run(debug=True, port=5001) diff --git a/ressources/test_app.py b/ressources/test_app.py index 8a7f955..a886678 100644 --- a/ressources/test_app.py +++ b/ressources/test_app.py @@ -58,4 +58,12 @@ def test_logs_critical_alerte(client): assert "alerte" in data assert data["alerte"] is True -# no change + +def test_logs_stats(client): + """La route /logs/stats retourne le total et le détail.""" + response = client.get("/logs/stats") + assert response.status_code == 200 + data = response.get_json() + assert "total" in data + assert "breakdown" in data + assert data["total"] == 185 # 142 + 28 + 12 + 3