Skip to content

Commit f6ac932

Browse files
committed
Squash merge better-slack-notifications
commit 99969d3 Author: Jocelyn Vernay <jocelyn@giskard.ai> Date: Thu Feb 1 14:16:54 2024 +0100 Update slack steps names commit ffa2410 Author: Jocelyn Vernay <jocelyn@giskard.ai> Date: Thu Feb 1 13:03:35 2024 +0100 Trim post-release commit e226ab2 Author: vjern <jocelyn@giskard.ai> Date: Thu Feb 1 11:46:05 2024 +0100 Update release start message commit 4f75209 Author: vjern <jocelyn@giskard.ai> Date: Thu Feb 1 11:42:58 2024 +0100 Fix `@channel` mention in create-release commit 3cf411e Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 18:48:25 2024 +0100 Add more slack notif ideas commit b53ce12 Merge: 69901b5 c5da6cf Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 16:59:06 2024 +0100 Merge remote-tracking branch 'origin/feature/gsk-2574-improve-release-step' into feature/gsk-2574-better-slack-notifications commit c5da6cf Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 16:47:20 2024 +0100 Make slack channel id a repo Actions variable commit 5d3f2ce Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 16:29:01 2024 +0100 Fix `@channel` mention in post-release slack notif commit 69901b5 Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 16:00:08 2024 +0100 Enable reploy_broadcast in post-release slack msg commit c494b43 Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 15:57:44 2024 +0100 Expect and use slack thread id in post-release commit c5706de Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 15:57:30 2024 +0100 Add release author to release start message commit f07a3f4 Merge: 402acf4 931f00e Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 15:46:13 2024 +0100 Merge branch 'feature/gsk-2574-improve-release-step' into feature/gsk-2574-better-slack-notifications commit 931f00e Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 15:20:32 2024 +0100 Fix @channel slack message commit b96f21f Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 12:00:37 2024 +0100 Add release pat token to post-release checkout commit 973f548 Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 11:48:40 2024 +0100 Set wheel artifact retention period & err behavior commit f3ea326 Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 11:44:35 2024 +0100 Name rc wheel artifact after input version number commit 402acf4 Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 10:44:15 2024 +0100 Add release process start slack notification commit d942b8d Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Wed Jan 31 10:41:49 2024 +0100 Send success slack notif after publishing to pypi commit d1211af Merge: f4bd867 5ff5cd3 Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Tue Jan 30 18:05:49 2024 +0100 Merge branch 'feature/gsk-2574-improve-release-step' of github.com:Giskard-AI/giskard into feature/gsk-2574-improve-release-step commit f4bd867 Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Tue Jan 30 18:05:06 2024 +0100 Reset build-python commit 5ff5cd3 Merge: 15386e3 1b724c6 Author: Jocelyn Vernay <59055698+vjern@users.noreply.github.com> Date: Tue Jan 30 14:38:34 2024 +0100 Merge branch 'main' into feature/gsk-2574-improve-release-step commit 15386e3 Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Tue Jan 30 14:33:00 2024 +0100 Restore step ifs and remove dev comments commit deb70a8 Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Tue Jan 30 14:26:45 2024 +0100 Restore other diff spans unrelated to feature commit 439e7df Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Tue Jan 30 14:24:05 2024 +0100 Restore org member check steps commit 1867aae Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Tue Jan 30 14:23:33 2024 +0100 Remove do-release commit b86a9e4 Author: BotReleaser <bot.releaser@users.noreply.github.com> Date: Tue Jan 30 14:22:00 2024 +0100 Reset README
1 parent 29402e8 commit f6ac932

6 files changed

Lines changed: 50 additions & 84 deletions

File tree

.github/workflows/build-python.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ on:
66
push:
77
branches:
88
- main
9-
paths-ignore:
10-
- .github/**
119
pull_request:
1210
workflow_dispatch:
1311
inputs:
@@ -168,8 +166,7 @@ jobs:
168166
PYTEST_XDIST_AUTO_NUM_WORKERS: 2
169167

170168
- name: SonarCloud Scan
171-
if: false
172-
# if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' && !matrix.langchain_minimal && !matrix.pandas_v1 && !matrix.pydantic_v1 && (github.event.ref == 'refs/heads/main' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)}}
169+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' && !matrix.langchain_minimal && !matrix.pandas_v1 && !matrix.pydantic_v1 && (github.event.ref == 'refs/heads/main' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)}}
173170
uses: SonarSource/sonarcloud-github-action@v2.1.1
174171
env:
175172
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/create-release.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
required: true
99
type: string
1010

11+
1112
jobs:
1213
build:
1314
runs-on: ubuntu-latest
@@ -20,12 +21,12 @@ jobs:
2021
username: ${{ github.actor }}
2122
token: ${{ secrets.GITHUB_TOKEN }}
2223

23-
# - name: Interrupt job
24-
# if: ${{ steps.is_organization_member.outputs.result == 'false' }}
25-
# shell: bash
26-
# run: |
27-
# echo "Job failed due to user not being a member of Giskard-AI organization and the 'safe for build' label not being set on the PR"
28-
# exit 1
24+
- name: Interrupt job
25+
if: ${{ steps.is_organization_member.outputs.result == 'false' }}
26+
shell: bash
27+
run: |
28+
echo "Job failed due to user not being a member of Giskard-AI organization and the 'safe for build' label not being set on the PR"
29+
exit 1
2930
3031
- name: Checkout code
3132
uses: actions/checkout@v4.1.0
@@ -47,16 +48,25 @@ jobs:
4748
run: pdm build
4849

4950
- name: Upload RC wheel artifact
50-
# Upload needs to be done only once by workflo run, so we need to select one only in the matrix
51-
# FIXME are these all the defaults in the current workflow ?
52-
# if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' && !matrix.langchain_minimal && !matrix.pandas_v1 && !matrix.pydantic_v1 }}
5351
uses: actions/upload-artifact@v4
5452
with:
5553
name: rc-wheel-${{ inputs.version }}
5654
path: dist/*whl
5755
if-no-files-found: error
5856
retention-days: 1
5957

58+
- name: "@slack Release process started"
59+
id: slack
60+
uses: slackapi/slack-github-action@v1.24.0
61+
with:
62+
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
63+
slack-message: |
64+
<!channel> New release **v${{ inputs.version }}** has been triggered by @${{ github.actor }} :rocket:
65+
env:
66+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
67+
if-no-files-found: error
68+
retention-days: 1
69+
6070
- name: Trigger release process in giskard-hub
6171
uses: peter-evans/repository-dispatch@v2
6272
with:
@@ -65,5 +75,6 @@ jobs:
6575
repository: ${{ github.repository_owner }}/giskard-hub
6676
client-payload: |
6777
{
68-
"version_name": "v${{ inputs.version }}"
78+
"version_name": "v${{ inputs.version }}",
79+
"slack_thread_id": "${{ steps.slack.outputs.thread_ts }}"
6980
}

.github/workflows/do-release.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/nightly-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Nightly test
22
on:
3-
# schedule:
4-
# - cron: '0 1 * * *' # Always run at 1:00 a.m.
3+
schedule:
4+
- cron: '0 1 * * *' # Always run at 1:00 a.m.
55
workflow_dispatch:
66

77
jobs:

.github/workflows/post-release.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- post-release
77
# Client payload should contain
88
# version_name: vX.Y.Z (with prefix)
9+
# slack_thread_id: (Also named thread_ts == thread timestamp == timestamp of the first message)
910
permissions:
1011
contents: write
1112

@@ -105,16 +106,30 @@ jobs:
105106
- name: Push to Pipy
106107
if: false
107108
run: pdm publish --no-build --username "${{ secrets.PIPY_USERNAME }}" --password "${{ secrets.PIPY_PASSWORD }}"
108-
109-
- name: Post to a Slack channel
110-
id: slack
109+
110+
- name: Set job success env var
111+
run: |
112+
echo "JOB_SUCCESS=true" >> $GITHUB_ENV
113+
114+
- name: "@slack Share release process completion"
115+
# # cancellable always() https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
116+
if: !cancelled()
111117
uses: slackapi/slack-github-action@v1.24.0
112-
with:
113-
# Slack channel id, channel name, or user id to post message.
114-
# See also: https://api.slack.com/methods/chat.postMessage#channels
115-
# On special mentions: https://api.slack.com/reference/surfaces/formatting#special-mentions
116-
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
117-
slack-message: "<!channel> New release: ${{ env.VERSION_NAME }} is being made !:tada:\nRelease notes there: ${{ steps.github-release.outputs.url }}"
118-
# For posting a rich message using Block Kit
119118
env:
120119
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
120+
ON_SUCCESS: |
121+
<!channel>
122+
Release **${{ env.VERSION_NAME }}** has been published ! :tada:
123+
[Release notes](${{ steps.github-release.outputs.url }}) | [PyPI](https://pypi.org/project/giskard/${{ env.VERSION_NUMBER }})
124+
ON_FAILURE: |
125+
"<!channel> Release ${{ env.VERSION_NAME }} failed on post-release :cross:
126+
[Logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
127+
with:
128+
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
129+
slack-message: ${{ env.JOB_SUCCESS == 'true' && env.ON_SUCCESS || env.ON_FAILURE }}
130+
# reploy_broadcast == also send to channel
131+
payload: |
132+
{
133+
"thread_ts": "${{ inputs.slack_thread_id }}",
134+
"reply_broadcast": true
135+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p align="center">
1+
<p align="center">
22
<img alt="giskardlogo" src="readme/giskard_logo.png#gh-light-mode-only">
33
<img alt="giskardlogo" src="readme/giskard_logo_green.png#gh-dark-mode-only">
44
</p>

0 commit comments

Comments
 (0)