Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 79 additions & 41 deletions .github/workflows/carto-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -619,68 +619,106 @@ jobs:
esac

# Extract key highlights from release notes (first 3 bullet points from Features/Fixes sections)
HIGHLIGHTS=""
HIGHLIGHTS_TEXT=""
if [ -f "release_notes.md" ]; then
# Get CARTO-specific features and fixes (limit to 3 most important)
FEATURES=$(grep -A 5 "### ✨" release_notes.md 2>/dev/null | grep "^-" | head -2 | sed 's/^- /• /' || echo "")
FIXES=$(grep -A 5 "### 🐛" release_notes.md 2>/dev/null | grep "^-" | head -1 | sed 's/^- /• /' || echo "")

if [ -n "$FEATURES" ] || [ -n "$FIXES" ]; then
HIGHLIGHTS=$'\n\n*Key Highlights:*\n'
[ -n "$FEATURES" ] && HIGHLIGHTS+="${FEATURES}"$'\n'
[ -n "$FIXES" ] && HIGHLIGHTS+="${FIXES}"
HIGHLIGHTS_TEXT="\n*Key Highlights:*\n"
[ -n "$FEATURES" ] && HIGHLIGHTS_TEXT+="${FEATURES}\n"
[ -n "$FIXES" ] && HIGHLIGHTS_TEXT+="${FIXES}"
fi
fi

# Build concise Slack message
MESSAGE="━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
${EMOJI} *LiteLLM CARTO Release* \`${RELEASE_TAG}\`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

:label: *Type:* ${TYPE_LABEL}${VERSION_CHANGE:+ ($VERSION_CHANGE)}
:package: *CARTO Version:* ${CARTO_VERSION}
:gear: *Upstream Base:* LiteLLM v${UPSTREAM_VERSION}${HIGHLIGHTS}

:link: <${RELEASE_URL}|View Release Notes>
:whale: \`${DOCKER_IMAGE}\`"
# Determine color based on release type
case "$RELEASE_TYPE" in
upstream_sync) RELEASE_COLOR="#1E88E5" ;;
feature) RELEASE_COLOR="#36a64f" ;;
patch) RELEASE_COLOR="#FFA500" ;;
*) RELEASE_COLOR="#808080" ;;
esac

echo "[Slack] Sending notification to channel ${SLACK_CHANNEL}"
echo "::endgroup::"

echo "::group::Posting to Slack"

# Build Block Kit payload
cat > /tmp/slack_payload.json << EOF
{
"channel": "${SLACK_CHANNEL}",
"attachments": [
{
"color": "${RELEASE_COLOR}",
"fallback": "${EMOJI} LiteLLM CARTO Release ${RELEASE_TAG}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${EMOJI} LiteLLM CARTO Release* — \`${RELEASE_TAG}\`\n${TYPE_LABEL}${VERSION_CHANGE:+ ($VERSION_CHANGE)}${HIGHLIGHTS_TEXT}"
}
},
{
"type": "section",
"fields": [
{ "type": "mrkdwn", "text": "*CARTO Version:*\n${CARTO_VERSION}" },
{ "type": "mrkdwn", "text": "*Upstream Base:*\nv${UPSTREAM_VERSION}" }
]
},
{
"type": "context",
"elements": [
{ "type": "mrkdwn", "text": ":whale: \`${DOCKER_IMAGE}\`" }
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": { "type": "plain_text", "text": "View Release", "emoji": true },
"style": "primary",
"url": "${RELEASE_URL}"
},
{
"type": "button",
"text": { "type": "plain_text", "text": "View Logs", "emoji": true },
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}
]
}
EOF

# Validate JSON
if ! jq empty /tmp/slack_payload.json 2>/dev/null; then
echo "::error::Invalid JSON payload"
cat /tmp/slack_payload.json
exit 1
fi

# Retry logic (up to 3 attempts)
SUCCESS=false
for attempt in 1 2 3; do
echo "[Slack] Attempt ${attempt}/3..."

# Send to Slack API
RESPONSE=$(curl -s -w "\n%{http_code}" \
-F "text=${MESSAGE}" \
-F "channel=${SLACK_CHANNEL}" \
RESPONSE=$(curl -s -X POST https://slack.com/api/chat.postMessage \
-H "Authorization: Bearer ${{ secrets.SLACK_KEY }}" \
-X POST https://slack.com/api/chat.postMessage)

# Extract HTTP code and body
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
BODY=$(echo "$RESPONSE" | head -n-1)

echo "[Slack] HTTP ${HTTP_CODE}"
echo "[Slack] Response: ${BODY}"

# Check if successful
if [ "$HTTP_CODE" = "200" ]; then
# Check Slack API response
if echo "$BODY" | grep -q '"ok":true'; then
echo "✅ [Slack] Release notification sent successfully"
SUCCESS=true
break
else
ERROR=$(echo "$BODY" | grep -o '"error":"[^"]*"' || echo "unknown error")
echo "⚠️ [Slack] Slack API error: ${ERROR}"
fi
-H "Content-Type: application/json" \
-d @/tmp/slack_payload.json)

if echo "$RESPONSE" | jq -e '.ok == true' > /dev/null 2>&1; then
echo "✅ [Slack] Release notification sent successfully"
SUCCESS=true
break
else
echo "⚠️ [Slack] HTTP error: ${HTTP_CODE}"
ERROR=$(echo "$RESPONSE" | jq -r '.error // "unknown"')
echo "⚠️ [Slack] Slack API error: ${ERROR}"
fi

# Wait before retry
Expand Down
24 changes: 4 additions & 20 deletions .github/workflows/carto-slack-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,24 +219,16 @@ jobs:
cat > /tmp/slack_payload.json << EOF
{
"channel": "${{ env.SLACK_CHANNEL }}",
"text": "${EMOJI} ${TYPE}: ${TITLE_ESCAPED}",
"attachments": [
{
"color": "${COLOR}",
"fallback": "${EMOJI} ${TYPE}: ${TITLE_ESCAPED}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${EMOJI} ${TYPE}: PR #${PR_NUM}",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${TITLE_ESCAPED}*"
"text": "*${EMOJI} ${TYPE}:* PR #${PR_NUM} — ${TITLE_ESCAPED}"
}
},
{
Expand Down Expand Up @@ -330,24 +322,16 @@ jobs:
cat > /tmp/slack_payload.json << EOF
{
"channel": "${{ env.SLACK_CHANNEL }}",
"text": "${EMOJI} ${TYPE}: ${TAG}",
"attachments": [
{
"color": "${COLOR}",
"fallback": "${EMOJI} ${TYPE}: ${TAG}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${EMOJI} ${TYPE}: ${TAG}",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${NAME_ESCAPED}*"
"text": "*${EMOJI} ${TYPE}:* ${TAG} — ${NAME_ESCAPED}"
}
},
{
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/carto-upstream-sync-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -816,23 +816,22 @@ jobs:
}'
fi

# Build improved Block Kit payload with colored sidebar and better visual hierarchy
# Build Block Kit payload with colored sidebar
cat > /tmp/slack_payload.json << EOF
{
"channel": "${SLACK_CHANNEL_LITELLM}",
"text": "${TITLE}: ${STEP_TEXT}",
"unfurl_links": false,
"unfurl_media": false,
"attachments": [
{
"color": "${COLOR}",
"fallback": "${TITLE}: ${STEP_TEXT}",
"blocks": [
{
"type": "header",
"type": "section",
"text": {
"type": "plain_text",
"text": "${STEP_EMOJI} ${TITLE}",
"emoji": true
"type": "mrkdwn",
"text": "*${STEP_EMOJI} ${TITLE}*"
}
},
{
Expand Down
27 changes: 7 additions & 20 deletions .github/workflows/carto-upstream-sync-ready-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,45 +186,41 @@ jobs:
# Build compare URL for upstream changes
COMPARE_URL="https://github.com/BerriAI/litellm/releases/tag/${VERSION}"

# Build improved Block Kit payload with colored sidebar
# Build Block Kit payload with colored sidebar
cat > /tmp/slack_payload.json << EOF
{
"channel": "${SLACK_CHANNEL_LITELLM}",
${THREAD_PARAM}
"text": "✅ LiteLLM Upstream Sync: Tests Passed",
"unfurl_links": false,
"unfurl_media": false,
"attachments": [
{
"color": "#1E88E5",
"fallback": "LiteLLM Upstream Sync: Tests Passed (v${VERSION_CLEAN})",
"blocks": [
{
"type": "header",
"type": "section",
"text": {
"type": "plain_text",
"text": "✅ LiteLLM Upstream Sync",
"emoji": true
"type": "mrkdwn",
"text": "*:white_check_mark: LiteLLM Upstream Sync*"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "${PROGRESS} *Step 4 of 4: Tests Passed*"
"text": "${PROGRESS} *Step 4/4: Tests Passed*"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "All CI checks completed successfully. PR is ready for review and merge."
"text": "All CI checks passed. PR ready for review and merge."
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
Expand All @@ -238,15 +234,6 @@ jobs:
}
]
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": ":arrow_right: Review changes and merge to deploy the update."
}
]
},
{
"type": "actions",
"elements": [
Expand Down