Skip to content
Draft
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
29 changes: 28 additions & 1 deletion .github/workflows/jellyfish-deploy-notification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,43 @@ jobs:
notify-jellyfish:
runs-on: ubuntu-latest
steps:
- name: Parse rt tag (if applicable)
id: parse
env:
IMAGE_TAG: ${{ inputs.image_tag }}
run: |
# Extract train_date + iter for RT v2 tags so the Jellyfish event
# carries enough information for the captain-handbook dashboard to
# plot iter@promotion per train. v1 legacy and plain semver also
# supported.
if [[ "$IMAGE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc\.([0-9]{4}-[0-9]{2}-[0-9]{2})\.([0-9]+)$ ]]; then
TRAIN="${BASH_REMATCH[1]}"
ITER="${BASH_REMATCH[2]}"
echo "format=v2" >> "$GITHUB_OUTPUT"
echo "train_date=$TRAIN" >> "$GITHUB_OUTPUT"
echo "iter=$ITER" >> "$GITHUB_OUTPUT"
echo "name_suffix= (train $TRAIN · rc.$ITER)" >> "$GITHUB_OUTPUT"
elif [[ "$IMAGE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc\.([0-9]+)$ ]]; then
ITER="${BASH_REMATCH[1]}"
echo "format=v1" >> "$GITHUB_OUTPUT"
echo "iter=$ITER" >> "$GITHUB_OUTPUT"
echo "name_suffix= (rc.$ITER legacy)" >> "$GITHUB_OUTPUT"
else
echo "format=plain" >> "$GITHUB_OUTPUT"
echo "name_suffix=" >> "$GITHUB_OUTPUT"
fi

- name: Dynamically set timestamp var
run: echo TIMESTAMP_NOW=$(date --iso-8601=seconds) >> $GITHUB_ENV

- name: Notify Jellyfish of deployment
run: |
curl -i -X POST \
-H 'Content-Type: application/json' \
-H 'X-jf-api-token: ${{ secrets.jellyfish_api_token }}' \
-d '{
"reference_id": "${{ github.event.repository.name }}-${{ inputs.image_tag }}-${{ github.run_id }}",
"name": "${{ github.event.repository.name }} deployment of ${{ inputs.image_tag }} to ${{ inputs.environment }} complete",
"name": "${{ github.event.repository.name }} deployment of ${{ inputs.image_tag }}${{ steps.parse.outputs.name_suffix }} to ${{ inputs.environment }} complete",
"deployed_at": "${{ env.TIMESTAMP_NOW }}",
"repo_name": "${{ github.repository }}",
"commit_shas": ["${{ github.sha }}"],
Expand Down
36 changes: 34 additions & 2 deletions .github/workflows/slack-deploy-notification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,38 @@ jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Parse rt tag (if applicable)
id: parse
env:
IMAGE_TAG: ${{ inputs.image_tag }}
run: |
# Surface train identifier + iter for RT-style tags so captains
# see "rc.3 of train 2026-06-18" in #releases, not just the full
# tag string. Two formats supported:
# v2 (RT v2): vX.Y.Z-rc.<YYYY-MM-DD>.<iter>
# v1 legacy: vX.Y.Z-rc.<iter>
# Anything else (clean semver, custom suffix) gets a neutral
# summary so the notification still goes out.
if [[ "$IMAGE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc\.([0-9]{4}-[0-9]{2}-[0-9]{2})\.([0-9]+)$ ]]; then
TRAIN="${BASH_REMATCH[1]}"
ITER="${BASH_REMATCH[2]}"
echo "format=v2" >> "$GITHUB_OUTPUT"
echo "train_date=$TRAIN" >> "$GITHUB_OUTPUT"
echo "iter=$ITER" >> "$GITHUB_OUTPUT"
echo "summary=train $TRAIN · rc.$ITER" >> "$GITHUB_OUTPUT"
elif [[ "$IMAGE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc\.([0-9]+)$ ]]; then
ITER="${BASH_REMATCH[1]}"
echo "format=v1" >> "$GITHUB_OUTPUT"
echo "iter=$ITER" >> "$GITHUB_OUTPUT"
echo "summary=rc.$ITER (legacy v1)" >> "$GITHUB_OUTPUT"
elif [[ "$IMAGE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "format=plain" >> "$GITHUB_OUTPUT"
echo "summary=clean release" >> "$GITHUB_OUTPUT"
else
echo "format=unknown" >> "$GITHUB_OUTPUT"
echo "summary=${IMAGE_TAG}" >> "$GITHUB_OUTPUT"
fi

- name: Send deployment notification
uses: slackapi/slack-github-action@v1.24.0
env:
Expand All @@ -36,13 +68,13 @@ jobs:
with:
payload: |
{
"text": "${{ github.event.repository.name }} deployed",
"text": "${{ github.event.repository.name }} deployed — ${{ steps.parse.outputs.summary }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ github.event.repository.name }} deployed by ${{ github.triggering_actor }}*\n\tView the <${{ inputs.dashboard_url }}|Deployment>\n\tView the <${{ inputs.apm_url }}|Service APM>"
"text": "*${{ github.event.repository.name }} deployed* — _${{ steps.parse.outputs.summary }}_\nby ${{ github.triggering_actor }}\n\tView the <${{ inputs.dashboard_url }}|Deployment>\n\tView the <${{ inputs.apm_url }}|Service APM>"
},
"accessory": {
"type": "button",
Expand Down