From edf13b7102099b44181d0ce7ef4e8f92089bf2e3 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Mon, 26 Jan 2026 10:40:10 +0100 Subject: [PATCH] revert: fix CI by reverting Telegram notifications Reverting 618c58c5 which broke the CI workflow. Will re-add notifications after fixing the issue. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 318 ----------- docker/grafana/dashboards/ci-cd.json | 774 --------------------------- docker/prometheus/prometheus.yml | 8 - 3 files changed, 1100 deletions(-) delete mode 100644 docker/grafana/dashboards/ci-cd.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a92d98a3..c53a976e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -328,150 +328,6 @@ jobs: echo "| storage-web | ${{ steps.changes.outputs.storage-web }} |" >> $GITHUB_STEP_SUMMARY echo "| telegram-stats-bot | ${{ steps.changes.outputs.telegram-stats-bot }} |" >> $GITHUB_STEP_SUMMARY - # =========================================== - # Notify Build Start - # =========================================== - notify-start: - name: Notify Build Start - runs-on: ubuntu-latest - needs: detect-changes - if: needs.detect-changes.outputs.any-changes == 'true' - steps: - - name: Count services to build - id: count - run: | - COUNT=0 - SERVICES="" - - if [ "${{ needs.detect-changes.outputs.mana-core-auth }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• mana-core-auth\n" - fi - if [ "${{ needs.detect-changes.outputs.manacore-web }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• manacore-web\n" - fi - if [ "${{ needs.detect-changes.outputs.chat-backend }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• chat-backend\n" - fi - if [ "${{ needs.detect-changes.outputs.chat-web }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• chat-web\n" - fi - if [ "${{ needs.detect-changes.outputs.todo-backend }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• todo-backend\n" - fi - if [ "${{ needs.detect-changes.outputs.todo-web }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• todo-web\n" - fi - if [ "${{ needs.detect-changes.outputs.calendar-backend }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• calendar-backend\n" - fi - if [ "${{ needs.detect-changes.outputs.calendar-web }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• calendar-web\n" - fi - if [ "${{ needs.detect-changes.outputs.clock-backend }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• clock-backend\n" - fi - if [ "${{ needs.detect-changes.outputs.clock-web }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• clock-web\n" - fi - if [ "${{ needs.detect-changes.outputs.contacts-backend }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• contacts-backend\n" - fi - if [ "${{ needs.detect-changes.outputs.contacts-web }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• contacts-web\n" - fi - if [ "${{ needs.detect-changes.outputs.presi-backend }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• presi-backend\n" - fi - if [ "${{ needs.detect-changes.outputs.presi-web }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• presi-web\n" - fi - if [ "${{ needs.detect-changes.outputs.storage-backend }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• storage-backend\n" - fi - if [ "${{ needs.detect-changes.outputs.storage-web }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• storage-web\n" - fi - if [ "${{ needs.detect-changes.outputs.telegram-stats-bot }}" == "true" ]; then - COUNT=$((COUNT + 1)) - SERVICES="${SERVICES}• telegram-stats-bot\n" - fi - - # Estimate build time (roughly 3-5 min per service, parallel execution) - if [ $COUNT -le 3 ]; then - ESTIMATE="~3-5 min" - elif [ $COUNT -le 8 ]; then - ESTIMATE="~5-8 min" - else - ESTIMATE="~8-12 min" - fi - - echo "count=$COUNT" >> $GITHUB_OUTPUT - echo "services<> $GITHUB_OUTPUT - echo -e "$SERVICES" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - echo "estimate=$ESTIMATE" >> $GITHUB_OUTPUT - - - name: Send Telegram notification - env: - TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} - TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} - run: | - MESSAGE="🔨 *CI Build Started* - -📦 *${{ steps.count.outputs.count }} services* building: -${{ steps.count.outputs.services }} -⏱️ Estimated: ${{ steps.count.outputs.estimate }} -🔗 [View Build](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" - - curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ - -d chat_id="${TELEGRAM_CHAT_ID}" \ - -d text="${MESSAGE}" \ - -d parse_mode="Markdown" \ - -d disable_web_page_preview="true" || true - - - name: Push build-started metrics to Prometheus - env: - PUSHGATEWAY_URL: ${{ secrets.PUSHGATEWAY_URL }} - run: | - # Skip if no Pushgateway URL configured - if [ -z "$PUSHGATEWAY_URL" ]; then - echo "PUSHGATEWAY_URL not configured, skipping metrics push" - exit 0 - fi - - START_EPOCH=$(date +%s) - - # Push build-in-progress metric - cat </dev/null || date +%s) - END_EPOCH=$(date +%s) - DURATION_SECONDS=$((END_EPOCH - START_EPOCH)) - DURATION_MINUTES=$((DURATION_SECONDS / 60)) - DURATION_REMAINDER=$((DURATION_SECONDS % 60)) - - echo "duration=${DURATION_MINUTES}m ${DURATION_REMAINDER}s" >> $GITHUB_OUTPUT - - # Count successful and failed builds - SUCCESS=0 - FAILED=0 - SKIPPED=0 - FAILED_SERVICES="" - SUCCESS_SERVICES="" - - check_job() { - local job_name=$1 - local result=$2 - if [ "$result" == "success" ]; then - SUCCESS=$((SUCCESS + 1)) - SUCCESS_SERVICES="${SUCCESS_SERVICES}✅ ${job_name}\n" - elif [ "$result" == "failure" ]; then - FAILED=$((FAILED + 1)) - FAILED_SERVICES="${FAILED_SERVICES}❌ ${job_name}\n" - elif [ "$result" == "skipped" ]; then - SKIPPED=$((SKIPPED + 1)) - fi - } - - check_job "mana-core-auth" "${{ needs.build-mana-core-auth.result }}" - check_job "manacore-web" "${{ needs.build-manacore-web.result }}" - check_job "chat-backend" "${{ needs.build-chat-backend.result }}" - check_job "chat-web" "${{ needs.build-chat-web.result }}" - check_job "todo-backend" "${{ needs.build-todo-backend.result }}" - check_job "todo-web" "${{ needs.build-todo-web.result }}" - check_job "calendar-backend" "${{ needs.build-calendar-backend.result }}" - check_job "calendar-web" "${{ needs.build-calendar-web.result }}" - check_job "clock-backend" "${{ needs.build-clock-backend.result }}" - check_job "clock-web" "${{ needs.build-clock-web.result }}" - check_job "contacts-backend" "${{ needs.build-contacts-backend.result }}" - check_job "contacts-web" "${{ needs.build-contacts-web.result }}" - check_job "presi-backend" "${{ needs.build-presi-backend.result }}" - check_job "presi-web" "${{ needs.build-presi-web.result }}" - check_job "storage-backend" "${{ needs.build-storage-backend.result }}" - check_job "storage-web" "${{ needs.build-storage-web.result }}" - check_job "telegram-stats-bot" "${{ needs.build-telegram-stats-bot.result }}" - - echo "success=$SUCCESS" >> $GITHUB_OUTPUT - echo "failed=$FAILED" >> $GITHUB_OUTPUT - - if [ $FAILED -gt 0 ]; then - echo "status=❌ FAILED" >> $GITHUB_OUTPUT - echo "emoji=🔴" >> $GITHUB_OUTPUT - else - echo "status=✅ SUCCESS" >> $GITHUB_OUTPUT - echo "emoji=🟢" >> $GITHUB_OUTPUT - fi - - echo "failed_services<> $GITHUB_OUTPUT - echo -e "$FAILED_SERVICES" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - - name: Send Telegram notification - env: - TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} - TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} - run: | - FAILED_INFO="" - if [ "${{ steps.result.outputs.failed }}" != "0" ]; then - FAILED_INFO=" -❌ *Failed:* -${{ steps.result.outputs.failed_services }}" - fi - - MESSAGE="${{ steps.result.outputs.emoji }} *CI Build Complete* - -${{ steps.result.outputs.status }} - -📊 *Results:* -✅ Success: ${{ steps.result.outputs.success }} -❌ Failed: ${{ steps.result.outputs.failed }} - -⏱️ Duration: ${{ steps.result.outputs.duration }} -${FAILED_INFO} -🔗 [View Build](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" - - curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ - -d chat_id="${TELEGRAM_CHAT_ID}" \ - -d text="${MESSAGE}" \ - -d parse_mode="Markdown" \ - -d disable_web_page_preview="true" || true - - - name: Push metrics to Prometheus - if: always() - env: - PUSHGATEWAY_URL: ${{ secrets.PUSHGATEWAY_URL }} - run: | - # Skip if no Pushgateway URL configured - if [ -z "$PUSHGATEWAY_URL" ]; then - echo "PUSHGATEWAY_URL not configured, skipping metrics push" - exit 0 - fi - - # Calculate duration in seconds for metrics - START_EPOCH=$(date -d "${{ github.event.head_commit.timestamp }}" +%s 2>/dev/null || date +%s) - END_EPOCH=$(date +%s) - DURATION_SECONDS=$((END_EPOCH - START_EPOCH)) - - # Determine build status (1 = success, 0 = failed) - if [ "${{ steps.result.outputs.failed }}" == "0" ]; then - BUILD_STATUS=1 - else - BUILD_STATUS=0 - fi - - # Push metrics to Pushgateway - cat <