Skip to content

Commit 4ded21a

Browse files
committed
Notify Slack once per breakage; check upstream daily instead of 6-hourly
1 parent 38abba7 commit 4ded21a

2 files changed

Lines changed: 24 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: build
22

33
on:
44
schedule:
5-
- cron: "23 */6 * * *" # pick up new upstream stable releases
5+
- cron: "23 5 * * *" # daily: pick up new upstream stable releases
66
push:
77
branches: [main]
88
paths:
@@ -26,6 +26,8 @@ concurrency:
2626
jobs:
2727
build:
2828
runs-on: ubuntu-latest
29+
outputs:
30+
version: ${{ steps.version.outputs.version }}
2931
strategy:
3032
fail-fast: false
3133
matrix:
@@ -88,12 +90,27 @@ jobs:
8890
${{ env.IMAGE }}:${{ steps.version.outputs.version }}
8991
${{ env.IMAGE }}:latest
9092
91-
- name: Notify Slack on failure
92-
if: failure()
93+
# One Slack message per breakage, not per matrix leg or per scheduled
94+
# retry: skip posting when the previous completed run also failed.
95+
notify:
96+
runs-on: ubuntu-latest
97+
needs: build
98+
if: failure()
99+
steps:
100+
- name: Check previous run conclusion
101+
id: prev
102+
env:
103+
GH_TOKEN: ${{ github.token }}
104+
run: |
105+
PREV="$(gh api "repos/${{ github.repository }}/actions/workflows/build.yml/runs?status=completed&per_page=1" --jq '.workflow_runs[0].conclusion')"
106+
echo "conclusion=$PREV" | tee -a "$GITHUB_OUTPUT"
107+
108+
- name: Post to Slack
109+
if: steps.prev.outputs.conclusion != 'failure'
93110
env:
94111
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
95112
SLACK_CHANNEL_ID: ${{ vars.SLACK_CHANNEL_ID }}
96-
TEXT: ":rotating_light: ${{ matrix.package }} build failed for LiteLLM ${{ steps.version.outputs.version || 'unknown' }} — the patch may no longer apply. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
113+
TEXT: ":rotating_light: litellm-lagoon-base build failed for LiteLLM ${{ needs.build.outputs.version || 'unknown' }} — the patch may no longer apply. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
97114
run: |
98115
curl -fsS -X POST https://slack.com/api/chat.postMessage \
99116
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ release (e.g. `v1.93.0`) plus `latest`:
1818
every `patch/*.patch` onto the installed `litellm` site-package with
1919
`git apply --include='litellm/*'` (tests/UI-source paths in a patch are
2020
skipped — the images ship prebuilt UI assets).
21-
- `.github/workflows/build.yml` runs every 6 hours, resolves the latest
21+
- `.github/workflows/build.yml` runs once a day, resolves the latest
2222
**stable** (non-prerelease) LiteLLM release, and builds/pushes both variants
2323
if not already published. Pushes to `main` touching `Dockerfile` or `patch/`
2424
republish the current version. `workflow_dispatch` accepts an explicit
2525
version.
2626
- If a build fails (usually: patch no longer applies to a new release), a
27-
message is posted to Slack — and re-posted every 6 hours until the patch is
28-
fixed.
27+
single message is posted to Slack — repeat failures stay quiet until a run
28+
succeeds again.
2929

3030
## Current patches
3131

0 commit comments

Comments
 (0)