Skip to content

Commit 512e287

Browse files
Merge remote-tracking branch 'origin/main' into install-script
2 parents 7848564 + 5c1b6a4 commit 512e287

5 files changed

Lines changed: 74 additions & 48 deletions

File tree

.github/workflows/daily-cli-tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,21 @@ jobs:
4848
kosli_reporting_api_token: ${{ secrets.KOSLI_PUBLIC_API_TOKEN }}
4949
kosli_querying_api_token: ${{ secrets.KOSLI_API_TOKEN_PROD }}
5050
sonarqube_token: ${{ secrets.KOSLI_SONARQUBE_TOKEN }}
51+
52+
slack-notification-on-failure:
53+
runs-on: ubuntu-24.04
54+
permissions:
55+
actions: read
56+
contents: read
57+
needs:
58+
[
59+
set-trail-name,
60+
test,
61+
]
62+
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && github.ref == 'refs/heads/master' }}
63+
steps:
64+
- name: Slack Notification on Failure
65+
uses: kosli-dev/reusable-actions/.github/actions/send-ci-failure-slack-message@main
66+
with:
67+
slack_url: ${{ secrets.MERKELY_SLACK_CI_FAILURES_WEBHOOK }}
68+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,23 @@ jobs:
8888
slack_channel: ci-failures
8989
kosli_api_token: ${{ secrets.KOSLI_PUBLIC_API_TOKEN }}
9090
snyk_token: ${{ secrets.SNYK_TOKEN }}
91+
92+
slack-notification-on-failure:
93+
runs-on: ubuntu-24.04
94+
permissions:
95+
actions: read
96+
contents: read
97+
needs:
98+
[
99+
pre-build,
100+
init-kosli,
101+
test,
102+
docker
103+
]
104+
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && github.ref == 'refs/heads/master' }}
105+
steps:
106+
- name: Slack Notification on Failure
107+
uses: kosli-dev/reusable-actions/.github/actions/send-ci-failure-slack-message@main
108+
with:
109+
slack_url: ${{ secrets.MERKELY_SLACK_CI_FAILURES_WEBHOOK }}
110+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,31 @@ jobs:
250250
tag: ${{ needs.pre-build.outputs.tag }}
251251
AWS_ACCOUNT_ID: 585008075785
252252
AWS_REGION: eu-central-1
253+
254+
slack-notification-on-failure:
255+
runs-on: ubuntu-24.04
256+
permissions:
257+
actions: read
258+
contents: read
259+
needs:
260+
[
261+
pre-build,
262+
init-kosli,
263+
never-alone-trail,
264+
test,
265+
docker,
266+
goreleaser,
267+
binary-provenance,
268+
homebrew-pr,
269+
docs-gen,
270+
evidence-reporter-upload-package-and-deploy,
271+
environment-reporter-upload-package-and-deploy,
272+
environment-reporter-upload-layer
273+
]
274+
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && github.ref == 'refs/heads/master' }}
275+
steps:
276+
- name: Slack Notification on Failure
277+
uses: kosli-dev/reusable-actions/.github/actions/send-ci-failure-slack-message@main
278+
with:
279+
slack_url: ${{ secrets.MERKELY_SLACK_CI_FAILURES_WEBHOOK }}
280+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,7 @@ jobs:
9797
--flow ${{ inputs.FLOW_NAME }}
9898
--trail ${{ inputs.TRAIL_NAME }}
9999
--org ${{ inputs.KOSLI_ORG }}
100-
--compliant=${{ steps.lint.outcome == 'success' }}
101-
102-
- name: Slack Notification on Failure
103-
if: ${{ failure() }}
104-
uses: rtCamp/action-slack-notify@v2
105-
env:
106-
SLACK_CHANNEL: ${{ secrets.slack_channel }}
107-
SLACK_COLOR: ${{ job.status }}
108-
SLACK_TITLE: Lint Failed in CLI repository
109-
SLACK_USERNAME: GithubActions
110-
SLACK_WEBHOOK: ${{ secrets.slack_webhook }}
100+
--compliant=${{ steps.lint.outcome == 'success' }}
111101

112102
test:
113103
name: Test
@@ -176,16 +166,6 @@ jobs:
176166
if: ${{ inputs.report_results }}
177167
uses: codecov/codecov-action@v4
178168

179-
- name: Slack Notification on Failure
180-
if: ${{ failure() }}
181-
uses: rtCamp/action-slack-notify@v2
182-
env:
183-
SLACK_CHANNEL: ${{ secrets.slack_channel }}
184-
SLACK_COLOR: ${{ job.status }}
185-
SLACK_TITLE: Test Failed in CLI repository
186-
SLACK_USERNAME: GithubActions
187-
SLACK_WEBHOOK: ${{ secrets.slack_webhook }}
188-
189169
snyk-code-test:
190170
if: ${{ inputs.run_snyk }}
191171
name: Snyk Code Test
@@ -222,16 +202,6 @@ jobs:
222202
# --trail ${{ inputs.TRAIL_NAME }}
223203
# --scan-results snyk-code.json
224204
# --org ${{ inputs.KOSLI_ORG }}
225-
226-
# - name: Slack Notification on Failure
227-
# if: ${{ failure() }}
228-
# uses: rtCamp/action-slack-notify@v2
229-
# env:
230-
# SLACK_CHANNEL: ${{ secrets.slack_channel }}
231-
# SLACK_COLOR: ${{ job.status }}
232-
# SLACK_TITLE: Snyk Code Failed in CLI repository
233-
# SLACK_USERNAME: GithubActions
234-
# SLACK_WEBHOOK: ${{ secrets.slack_webhook }}
235205

236206
snyk-dependency-test:
237207
if: ${{ inputs.run_snyk }}
@@ -269,13 +239,4 @@ jobs:
269239
# --trail ${{ inputs.TRAIL_NAME }}
270240
# --scan-results snyk-dependency.json
271241
# --org ${{ inputs.KOSLI_ORG }}
272-
273-
# - name: Slack Notification on Failure
274-
# if: ${{ failure() }}
275-
# uses: rtCamp/action-slack-notify@v2
276-
# env:
277-
# SLACK_CHANNEL: ${{ secrets.slack_channel }}
278-
# SLACK_COLOR: ${{ job.status }}
279-
# SLACK_TITLE: Snyk Test Failed in CLI repository
280-
# SLACK_USERNAME: GithubActions
281-
# SLACK_WEBHOOK: ${{ secrets.slack_webhook }}
242+

docs.kosli.com/content/tutorials/what_do_i_do_if_kosli_is_down.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ This will break CI workflow pipelines, blocking artifacts from being deployed.
1313
In this situation there is a built-in mechanism to instantly turn Kosli off and keep the pipelines flowing.
1414
When Kosli is back up, you can instantly turn Kosli back on.
1515

16+
{{% hint info %}}
17+
You can check the current status of Kosli services at https://status.app.kosli.com or by running `kosli status` in the CLI.
18+
{{% /hint %}}
19+
1620
## Turning Kosli CLI calls on and off instantly
1721

1822
If the `KOSLI_DRY_RUN` environment variable is set to `true` then all Kosli CLI commands will:
@@ -21,7 +25,7 @@ If the `KOSLI_DRY_RUN` environment variable is set to `true` then all Kosli CLI
2125
* Exit with a zero status code
2226

2327
We recommend creating an Org-level KOSLI_DRY_RUN variable in your CI system and, in all CI workflows,
24-
ensuring there is an environment variable set from it.
28+
ensuring there is an environment variable set from it.
2529

2630
For example, in a [Github Action workflow](https://github.com/cyber-dojo/differ/blob/main/.github/workflows/main.yml):
2731

@@ -32,10 +36,9 @@ env:
3236
KOSLI_DRY_RUN: ${{ vars.KOSLI_DRY_RUN }} # true iff Kosli is down
3337
```
3438
35-
3639
## Turning Kosli API calls on and off instantly
3740
38-
If you are using the Kosli API in your workflows (e.g. using `curl`), we recommend using the same Org-level `KOSLI_DRY_RUN`
41+
If you are using the Kosli API in your workflows (e.g. using `curl`), we recommend using the same Org-level `KOSLI_DRY_RUN`
3942
environment variable and guarding the `curl` call with a simple if statement. For example:
4043

4144
```shell
@@ -54,7 +57,3 @@ kosli_curl()
5457
fi
5558
}
5659
```
57-
58-
59-
60-

0 commit comments

Comments
 (0)