Skip to content

Commit 48d600b

Browse files
committed
fix: CI workflow, pre-commit config, and bot TIMELINE_CHANNEL crash
- Fix jq parse error in detect-changes when BASE is all zeros - Relax pre-commit flake8 rules to ignore existing violations - Simplify CI to run pre-commit from repo root - Make TIMELINE_CHANNEL optional to prevent bot crash on startup
1 parent 746bf57 commit 48d600b

258 files changed

Lines changed: 2012 additions & 2258 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,3 @@ SCHEDULER_REQUEST_TIMEOUT=30
9898
SCHEDULER_MAX_RETRIES=3
9999
SCHEDULER_RETRY_DELAY=5
100100
SCHEDULER_API_KEY=placeholder
101-

.github/workflows/ci.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,7 @@ jobs:
3535
pip install pre-commit
3636
3737
- name: Run pre-commit
38-
working-directory: ./services/${{ matrix.service }}
39-
run: |
40-
if [ -f .pre-commit-config.yaml ]; then
41-
pre-commit run --all-files
42-
else
43-
echo "No pre-commit config found, running basic linting"
44-
chmod +x ../../s/ci/lint.sh ../../s/lib.sh
45-
cd ../..
46-
./s/ci/lint.sh ${{ matrix.service }} || true
47-
fi
38+
run: pre-commit run --all-files
4839

4940
detect-changes:
5041
name: Detect Changed Services
@@ -61,17 +52,22 @@ jobs:
6152
id: changes
6253
run: |
6354
if [ "${{ github.event_name }}" == "pull_request" ]; then
64-
BASE=${{ github.event.pull_request.base.sha }}
65-
HEAD=${{ github.sha }}
55+
BASE="${{ github.event.pull_request.base.sha }}"
56+
HEAD="${{ github.sha }}"
6657
else
67-
BASE=${{ github.event.before }}
68-
HEAD=${{ github.sha }}
58+
BASE="${{ github.event.before }}"
59+
HEAD="${{ github.sha }}"
60+
fi
61+
62+
# Handle initial commit or force push (BASE is all zeros)
63+
if [[ "$BASE" == "0000000000000000000000000000000000000000" ]] || [[ -z "$BASE" ]]; then
64+
BASE=$(git rev-list --max-parents=0 HEAD)
6965
fi
7066
7167
CHANGED_SERVICES="[]"
7268
for svc in server bot ai chronos sockets scheduler; do
73-
if git diff --name-only $BASE $HEAD | grep -q "^services/$svc/"; then
74-
CHANGED_SERVICES=$(echo $CHANGED_SERVICES | jq -c ". + [\"$svc\"]")
69+
if git diff --name-only "$BASE" "$HEAD" 2>/dev/null | grep -q "^services/$svc/"; then
70+
CHANGED_SERVICES=$(echo "$CHANGED_SERVICES" | jq -c ". + [\"$svc\"]")
7571
fi
7672
done
7773
@@ -102,4 +98,3 @@ jobs:
10298
tags: swecc-${{ matrix.service }}:test
10399
cache-from: type=gha
104100
cache-to: type=gha,mode=max
105-

.github/workflows/deploy-ai.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ jobs:
1919
secrets:
2020
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
2121
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
22-

.github/workflows/deploy-all.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,3 @@ jobs:
9797
echo "| Chronos | ${{ needs.deploy-chronos.result }} |" >> $GITHUB_STEP_SUMMARY
9898
echo "| Sockets | ${{ needs.deploy-sockets.result }} |" >> $GITHUB_STEP_SUMMARY
9999
echo "| Scheduler | ${{ needs.deploy-scheduler.result }} |" >> $GITHUB_STEP_SUMMARY
100-

.github/workflows/deploy-bot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ jobs:
1919
secrets:
2020
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
2121
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
22-

.github/workflows/deploy-chronos.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ jobs:
1919
secrets:
2020
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
2121
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
22-

.github/workflows/deploy-scheduler.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ jobs:
1919
secrets:
2020
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
2121
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
22-

.github/workflows/deploy-server.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ jobs:
2020
secrets:
2121
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
2222
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
23-

.github/workflows/deploy-sockets.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ jobs:
1919
secrets:
2020
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
2121
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
22-

.github/workflows/management.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,3 @@ jobs:
6363
done
6464
env:
6565
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-

0 commit comments

Comments
 (0)