Repository: konflux-ci/community-catalog
Pull request #4: feat(RELEASE-1486): add_samples_to_the_tenant_catalog
Author: login: Paul123111
Created: 2025-05-15T12:03:14Z | Merged: 2025-05-20T15:20:33Z

Add notify-slack-on-failure task, along with a sample pipeline to run it. This task makes an app push a notification to slack when a managed pipeline fails.


Diff:
diff --git a/pipelines/notify-slack-on-failure/README.md b/pipelines/notify-slack-on-failure/README.md
new file mode 100644
index 0000000..a6d7ab3
--- /dev/null
+++ b/pipelines/notify-slack-on-failure/README.md
@@ -0,0 +1,13 @@
+# notify-slack-on-failure pipeline
+
+Sends an error message to Slack using postMessage API if managed pipelines fail.
+
+## Parameters
+
+| Name                                | Description                                                                                                                | Optional   | Default value                                             |
+|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------|
+| secretName                          | Name of secret which contains authentication token for app                                                                 | No         | -                                                         |
+| secretKeyName                       | Name of key within secret which contains webhook URL                                                                       | No         | -                                                         |
+| release                             | Namespaced name of release - should be in format "namespace/name"                                                          | No         | -                                                         |
+| taskGitUrl                          | The url to the git repo where the community-catalog tasks to be used are stored                                            | Yes        | https://github.com/konflux-ci/community-catalog.git       |
+| taskGitRevision                     | The revision in the taskGitUrl repo to be used                                                                             | No         | -                                                         |
diff --git a/pipelines/notify-slack-on-failure/notify-slack-on-failure.yaml b/pipelines/notify-slack-on-failure/notify-slack-on-failure.yaml
new file mode 100644
index 0000000..2c2d985
--- /dev/null
+++ b/pipelines/notify-slack-on-failure/notify-slack-on-failure.yaml
@@ -0,0 +1,47 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      type: string
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      type: string
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      type: string
+      description: Namespaced name of release - should be in format "namespace/name"
+    - name: taskGitUrl
+      type: string
+      description: The url to the git repo where the community-catalog tasks to be used are stored
+      default: https://github.com/konflux-ci/community-catalog.git
+    - name: taskGitRevision
+      type: string
+      description: The revision in the taskGitUrl repo to be used
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: $(params.taskGitUrl)
+          - name: revision
+            value: $(params.taskGitRevision)
+          - name: pathInRepo
+            value: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
+      params:
+        - name: secretName
+          value: $(params.secretName)
+        - name: secretKeyName
+          value: $(params.secretKeyName)
+        - name: release
+          value: $(params.release)
diff --git a/tasks/notify-slack-on-failure/README.md b/tasks/notify-slack-on-failure/README.md
new file mode 100644
index 0000000..3a46be3
--- /dev/null
+++ b/tasks/notify-slack-on-failure/README.md
@@ -0,0 +1,11 @@
+# notify-slack-on-failure
+
+Tekton task that sends an error message to Slack using postMessage API if managed pipelines fail.
+
+## Parameters
+
+| Name                                | Description                                                                                                                | Optional   | Default value                                             |
+|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------|
+| secretName                          | Name of secret which contains authentication token for app                                                                 | No         | -                                                         |
+| secretKeyName                       | Name of key within secret which contains webhook URL                                                                       | No         | -                                                         |
+| release                             | Namespaced name of release - should be in format "namespace/name"                                                          | No         | -                                                         |
diff --git a/tasks/notify-slack-on-failure/notify-slack-on-failure.yaml b/tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
new file mode 100644
index 0000000..3d3ec43
--- /dev/null
+++ b/tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
@@ -0,0 +1,72 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      description: Namespaced name of release - should be in format "namespace/name"
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via the 'secretKeyName' pipeline parameter" \
+            "provided in the release-plan"
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the 'secretKeyName'" \
+            "pipeline parameter provided in the release-plan but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        IFS='/' read -r RELEASE_NAMESPACE RELEASE_NAME <<< "$(params.release)"
+        RELEASECONDITIONS=$(kubectl get release "$RELEASE_NAME" -n "$RELEASE_NAMESPACE" \
+          -o jsonpath='{.status.conditions}' | jq '.[] | select(.type == "ManagedPipelineProcessed")')
+        
+        RELEASESTATUS=$(jq -r '.reason' <<< "$RELEASECONDITIONS")
+
+        if [[ "$RELEASESTATUS" == *"Failed"* ]]; then
+          MESSAGE=$(jq -r '.message' <<< "$RELEASECONDITIONS" | awk NF)
+          
+          # need 3 back-ticks around message for code-block
+          MESSAGE=$(echo -n "Managed pipelines failed: \`\`\`$MESSAGE\`\`\`" | jq -Rsa)
+          
+          cat > /tmp/payload.json << EOF
+        {"text": $MESSAGE}
+        EOF
+          # line above needs to be missing indentation
+
+          curl  -H "Content-type: application/json" --data-binary "@/tmp/payload.json"  \
+            "${WEBHOOK_URL}"
+        else
+          echo "All pipelines succeeded."
+        fi
diff --git a/tasks/notify-slack-on-failure/tests/mocks.sh b/tasks/notify-slack-on-failure/tests/mocks.sh
new file mode 100755
index 0000000..ed2f68a
--- /dev/null
+++ b/tasks/notify-slack-on-failure/tests/mocks.sh
@@ -0,0 +1,179 @@
+#!/usr/bin/env bash
+
+# SC2016 - "Expressions don't expand in single quotes, use double quotes for that." 
+# is disabled because line 26 is checking for backticks, so single quotes are being
+# used to prevent ```SAMPLE ERROR MESSAGE``` from being expanded
+
+# shellcheck disable=SC2016
+set -eux
+
+# mocks to be injected into task step scripts
+
+function curl() {
+  echo Mock curl called with: $*
+  echo $* >> /tmp/mock_curl.txt
+
+  if [[ "$*" != "-H Content-type: application/json --data-binary @/tmp/payload.json ABCDEF"* ]]
+  then
+    echo Error: Unexpected call
+    exit 1
+  fi
+
+  # no workspaces to pass information along, but there's only one test that actually uses curl.
+  # if any other test manages to use curl, release is set to 'ns/success' in all other tests
+  # so they won't reproduce the error message and the test will fail
+  if [ "$(cat /tmp/payload.json)" != \
+    '{"text": "Managed pipelines failed: ```SAMPLE ERROR MESSAGE```"}' ]; then
+    echo Error: unexpected message
+    cat /tmp/payload.json
+    exit 1
+  fi
+
+  # makes sure curl is not called multiple times on test-notify-slack-release-failure.yaml
+  if [ "$(wc -l < /tmp/mock_curl.txt)" != 1 ]; then
+    echo Error: curl was expected to be called 1 times. Actual calls:
+    cat /tmp/mock_curl.txt
+    exit 1
+  fi
+}
+
+function kubectl() {
+  if [[ "$*" == *"release"* ]]
+  then
+    if [[ "$*" == *fail* ]]
+    then
+      cat > /tmp/mock-release.json <<EOF
+      {
+      "apiVersion": "appstudio.redhat.com/v1alpha1",
+      "kind": "Release",
+      "metadata": {
+          "name": "my-release"
+      },
+      "status": {
+          "conditions": [
+          {
+              "message": "",
+              "reason": "Succeeded",
+              "status": "True",
+              "type": "Validated"
+          },
+          {
+              "message": "",
+              "reason": "Skipped",
+              "status": "True",
+              "type": "TenantCollectorsPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Skipped",
+              "status": "True",
+              "type": "ManagedCollectorsPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Succeeded",
+              "status": "True",
+              "type": "ManagedPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Succeeded",
+              "status": "True",
+              "type": "TenantPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Succeeded",
+              "status": "True",
+              "type": "ManagedPipelineProcessed"
+          },
+          {
+              "message": "SAMPLE ERROR MESSAGE",
+              "reason": "Failed",
+              "status": "False",
+              "type": "ManagedPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Succeeded",
+              "status": "True",
+              "type": "ManagedPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Progressing",
+              "status": "False",
+              "type": "FinalPipelineProcessed"
+          }
+          ]
+      }
+      }
+EOF
+
+    elif [[ "$*" == *success* ]]
+    then
+      cat > /tmp/mock-release.json <<EOF
+      {
+      "apiVersion": "appstudio.redhat.com/v1alpha1",
+      "kind": "Release",
+      "metadata": {
+          "name": "my-release"
+      },
+      "status": {
+          "conditions": [
+          {
+              "message": "",
+              "reason": "Succeeded",
+              "status": "True",
+              "type": "Validated"
+          },
+          {
+              "message": "",
+              "reason": "Skipped",
+              "status": "True",
+              "type": "TenantCollectorsPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Skipped",
+              "status": "True",
+              "type": "ManagedCollectorsPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Succeeded",
+              "status": "True",
+              "type": "ManagedPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Succeeded",
+              "status": "True",
+              "type": "TenantPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Succeeded",
+              "status": "True",
+              "type": "ManagedPipelineProcessed"
+          },
+          {
+              "message": "",
+              "reason": "Progressing",
+              "status": "False",
+              "type": "FinalPipelineProcessed"
+          }
+          ]
+      }
+      }
+EOF
+    fi
+  fi
+
+  if [[ "$*" == *"-o jsonpath={.status.conditions}"* ]]; then
+    cat /tmp/mock-release.json | jq .status.conditions
+  else
+    cat /tmp/mock-release.json
+  fi
+
+}
diff --git a/tasks/notify-slack-on-failure/tests/pre-apply-task-hook.sh b/tasks/notify-slack-on-failure/tests/pre-apply-task-hook.sh
new file mode 100755
index 0000000..ef94bff
--- /dev/null
+++ b/tasks/notify-slack-on-failure/tests/pre-apply-task-hook.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+set -x
+TASK_PATH="$1"
+SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
+
+# Add mocks to the beginning of task step script
+yq -i '.spec.steps[0].script = load_str("'$SCRIPT_DIR'/mocks.sh") + .spec.steps[0].script' "$TASK_PATH"
+
+# Create a dummy slack-notification-secret secret (and delete it first if it exists)
+kubectl delete secret my-secret --ignore-not-found
+
+kubectl create secret generic my-secret --from-literal=my-team=ABCDEF
diff --git a/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-key-not-found.yaml b/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-key-not-found.yaml
new file mode 100644
index 0000000..854c6a2
--- /dev/null
+++ b/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-key-not-found.yaml
@@ -0,0 +1,22 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-key-not-found
+  annotations:
+    test/assert-task-failure: "run-task"
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify that the task exits 
+    with an error when wrong secretKeyName is provided
+  tasks:
+    - name: run-task
+      taskRef:
+        name: notify-slack-on-failure
+      params:
+        - name: secretName
+          value: "my-secret"
+        - name: secretKeyName
+          value: "missing-key"
+        - name: release
+          value: "ns/success"
diff --git a/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-no-secret.yaml b/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-no-secret.yaml
new file mode 100644
index 0000000..d23ce70
--- /dev/null
+++ b/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-no-secret.yaml
@@ -0,0 +1,19 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-no-secret
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify that the tasks exits when no secretName is provided
+  tasks:
+    - name: run-task
+      taskRef:
+        name: notify-slack-on-failure
+      params:
+        - name: secretName
+          value: "missing-secret"
+        - name: secretKeyName
+          value: ""
+        - name: release
+          value: "ns/success"
diff --git a/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-failure.yaml b/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-failure.yaml
new file mode 100644
index 0000000..7ffdc23
--- /dev/null
+++ b/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-failure.yaml
@@ -0,0 +1,20 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-release-failure
+spec:
+  description: |
+    Run the notify-slack-on-failure task with a release that
+    has failed
+  tasks:
+    - name: run-task
+      taskRef:
+        name: notify-slack-on-failure
+      params:
+        - name: secretName
+          value: "my-secret"
+        - name: secretKeyName
+          value: "my-team"
+        - name: release
+          value: "ns/fail"
diff --git a/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-success.yaml b/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-success.yaml
new file mode 100644
index 0000000..b7130fe
--- /dev/null
+++ b/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-success.yaml
@@ -0,0 +1,20 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-release-success
+spec:
+  description: |
+    Run the notify-slack-on-failure task with a release that
+    has succeeded
+  tasks:
+    - name: run-task
+      taskRef:
+        name: notify-slack-on-failure
+      params:
+        - name: secretName
+          value: "my-secret"
+        - name: secretKeyName
+          value: "my-team"
+        - name: release
+          value: "ns/success"
diff --git a/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-wrong-secret.yaml b/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-wrong-secret.yaml
new file mode 100644
index 0000000..7114975
--- /dev/null
+++ b/tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-wrong-secret.yaml
@@ -0,0 +1,22 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-wrong-secret
+  annotations:
+    test/assert-task-failure: "run-task"
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify that the task exits 
+    with an error when wrong secretName is provided
+  tasks:
+    - name: run-task
+      taskRef:
+        name: notify-slack-on-failure
+      params:
+        - name: secretName
+          value: "missing-secret"
+        - name: secretKeyName
+          value: "my-team"
+        - name: release
+          value: "ns/success"


Reviews:
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:43:34Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:45:04Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:45:39Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:46:20Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:49:08Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:51:17Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:52:36Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:54:15Z
user: login: seanconroy2021
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-05-15T12:56:56Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:57:25Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:57:25Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T12:59:18Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T13:00:34Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T13:01:50Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T13:13:24Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T13:22:08Z
user: login: johnbieren
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T13:45:37Z
user: login: johnbieren
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T13:46:31Z
user: login: johnbieren
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T13:47:13Z
user: login: johnbieren
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T13:47:45Z
user: login: johnbieren
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T13:48:55Z
user: login: johnbieren
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T13:49:14Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T14:14:15Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T14:18:50Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:42:39Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:42:49Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:42:56Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:43:03Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:44:44Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:45:49Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:46:13Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:46:41Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:46:51Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:48:53Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:57:47Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-15T15:58:47Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T09:37:49Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T09:41:22Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T09:43:02Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T09:44:41Z
user: login: seanconroy2021
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-16T09:46:36Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T09:47:23Z
user: login: seanconroy2021
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-16T10:24:34Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T10:25:43Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T10:26:40Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T10:28:29Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T10:30:03Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T10:30:59Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T10:31:06Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T10:33:03Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T11:19:57Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T11:32:50Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T11:33:07Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T11:40:21Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T12:34:32Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T12:37:19Z
user: login: mmalina
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T13:58:18Z
user: login: mmalina
body: Other than the open threads, it looks good to me.
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-16T13:59:06Z
user: login: johnbieren
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T13:54:33Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T14:38:27Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T14:42:02Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T14:42:08Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T14:42:17Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T14:42:26Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T14:45:28Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T14:45:44Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T14:55:34Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T15:22:02Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T15:22:16Z
user: login: johnbieren
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-20T12:56:48Z
user: login: Paul123111
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-20T13:40:51Z
user: login: johnbieren
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-20T14:01:51Z
user: login: seanconroy2021
body: lgtm
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-20T15:11:31Z

Review comments:
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: seanconroy2021
body: ```suggestion
            value: https://github.com/konflux-ci/community-catalog.git
```
It would be better practice to use `taskGitUrl` and `taskGitRevision` as parameters at the top of the pipeline spec.  This approach would allow you to specify all the tasks repo and branch, allowing users to switch between forks or different branches, such as production, without having to modify the pipeline. It will also be needed for testing. An example of this can be seen here 
  https://github.com/konflux-ci/release-service-catalog/blob/ab7f9e593e41d28d7d968f6a10f8b2000da7a148/pipelines/managed/fbc-release/fbc-release.yaml#L50-L56

We shouldn't really be hard-coding in params 
created_at: 2025-05-15T12:37:26Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
+          - name: revision
+            value: development
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: mmalina
body: The pipeline should have the taskGitRevision and taskGitUrl params (as per the [tenant pipeline documentation](https://konflux.pages.redhat.com/docs/users/releasing/tenant-release-pipelines.html#using-a-tenant-pipeline)) and those should be used here.
created_at: 2025-05-15T12:43:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,11 @@
+# notify-slack-on-failure-sample pipeline
+
+Sample Tekton pipeline that runs the "notify-slack-on-failure" task.
+
+## Parameters
+
+| Name                                | Description                                                                                                                | Optional   | Default value                                             |
+|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------|
+| secretName                          | Name of secret which contains authentication token for app                                                                 | No         | -                                                         |
+| secretKeyName                       | Name of key within secret which contains webhook URL                                                                       | No         | -                                                         |
+| RELEASE                             | String representation of Release spec                                                                                      | No         | -                                                         |
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: mmalina
body: This should be lowercase `release`
created_at: 2025-05-15T12:45:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
+          - name: revision
+            value: development
+          - name: pathInRepo
+            value: tasks/notify-failure-on-slack/notify-failure-on-slack.yaml
+      params:
+        - name: secretName
+          value: $(params.secretName)
+        - name: secretKeyName
+          value: $(params.secretKeyName)
+        - name: RELEASE
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: mmalina
body: I would recommend using lower case here as well (and in the task yaml).
created_at: 2025-05-15T12:45:39Z
author_association: CONTRIBUTOR
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: mmalina
body: It seems all of the files are missing newline at the end of the file. I would recommend setting your IDE/editor to do that automatically for you.
created_at: 2025-05-15T12:46:20Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,11 @@
+# notify-slack-on-failure-sample pipeline
+
+Sample Tekton pipeline that runs the "notify-slack-on-failure" task.
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: seanconroy2021
body: I think we could explain the pipeline better here, like what it is actually doing ... like you said below, `Sends an error message to Slack using postMessage API if managed pipelines fail`
created_at: 2025-05-15T12:46:46Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: mmalina
body: This message seems wrong. Here it all comes from the pipeline parameters provided in the RP.
created_at: 2025-05-15T12:49:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: mmalina
body: Again, here it comes from the pipeline parameters in the RP, not from Release data, right?
created_at: 2025-05-15T12:51:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: seanconroy2021
body: This left over? 
created_at: 2025-05-15T12:52:08Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: mmalina
body: Yeah, this will need to be changed, because the release parameter is in the form `namespace/releaseName`.
created_at: 2025-05-15T12:52:36Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
+
+        if [[ "$RELEASESTATUS" == *"Failed"* ]]; then
+          MESSAGE=$(get-resource "release" "$(params.RELEASE)" | jq -r .status.conditions[].message | awk NF)
+          
+          # need 3 back-ticks around message for code-block
+          MESSAGE=$(echo -n "Managed pipelines failed: \`\`\`$MESSAGE\`\`\`" | jq -Rsa)
+          
+          cat > /tmp/release.json << EOF
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: mmalina
body: You likely copied this from the other task, but I would suggest calling this `payload` for example - release doesn't seem like a good name.
created_at: 2025-05-15T12:54:15Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: seanconroy2021
body: ` RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)"`

Instead of calling get-resource twice to retrieve the release, we could fetch it once and store it in a variable. This way, we can iterate over the necessary fields directly from the stored variable, avoiding calling it multiple times.
created_at: 2025-05-15T12:56:26Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: I think that comment was a leftover from before I was using `get-resource` to get the release spec.
created_at: 2025-05-15T12:57:25Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
+
+        if [[ "$RELEASESTATUS" == *"Failed"* ]]; then
+          MESSAGE=$(get-resource "release" "$(params.RELEASE)" | jq -r .status.conditions[].message | awk NF)
+          
+          # need 3 back-ticks around message for code-block
+          MESSAGE=$(echo -n "Managed pipelines failed: \`\`\`$MESSAGE\`\`\`" | jq -Rsa)
+          
+          cat > /tmp/release.json << EOF
+        {"text": $MESSAGE}
+        EOF
+          # line above needs to be missing indentation
+
+          cat /tmp/release.json
+
+          curl  -H "Content-type: application/json" --data-binary "@/tmp/release.json"  \
+            "${WEBHOOK_URL}"
+        else
+          echo "All pipelines succeeded."
+        fi
+  workspaces:
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: mmalina
body: Hmm, I'd say we don't need a workspace here. But I understand testing would be harder without it. Since it's just an example, I don't mind keeping it. But I think testing would still be doable without it - you can achieve a lot in the mocks. But it's definitely more cumbersome.
created_at: 2025-05-15T12:57:25Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: mmalina
body: I see. But with kubectl you still need to do `-n namespace releaseName`, so you will have to parse the two from the param string, right?
created_at: 2025-05-15T12:59:18Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: mmalina
body: Yeah, I added a similar comment a few minutes later :) https://github.com/konflux-ci/community-catalog/pull/4#discussion_r2091087576

Both tenant and final pipelines will be started with taskGitUrl and taskGitRevision as parameters, so we should use those.
created_at: 2025-05-15T13:00:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: I'm not sure which part of this snippet is left over. Is the line directly below the comment in the snippet? If so, yeah, I forgot to remove that comment.
created_at: 2025-05-15T13:01:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: I was originally using `kubectl` to get the release spec, but I started using `get-resource` instead of it, which seems to not require specifying the namespace or name of the release, although I'm not entirely sure what arguments `get-resource` uses - I was basing it off how it's used in `tasks/managed/reduce-snapshot` in the release-service-catalog.
created_at: 2025-05-15T13:13:24Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: mmalina
body: If you wanna use get-resource, than you can use the param as is. This is the script: https://github.com/konflux-ci/release-service-utils/blob/main/utils/get-resource
created_at: 2025-05-15T13:22:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: johnbieren
body: Yes
created_at: 2025-05-15T13:45:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: johnbieren
body: I get a release in a final pipeline here https://github.com/konflux-ci/release-service-catalog/blob/development/tasks/tenant/get-git-sha-image-ref-from-release/get-git-sha-image-ref-from-release.yaml#L29. You can use it as an example if you want
created_at: 2025-05-15T13:46:31Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: johnbieren
body: I think you'd have to specify what condition you want
created_at: 2025-05-15T13:47:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
+
+        if [[ "$RELEASESTATUS" == *"Failed"* ]]; then
+          MESSAGE=$(get-resource "release" "$(params.RELEASE)" | jq -r .status.conditions[].message | awk NF)
+          
+          # need 3 back-ticks around message for code-block
+          MESSAGE=$(echo -n "Managed pipelines failed: \`\`\`$MESSAGE\`\`\`" | jq -Rsa)
+          
+          cat > /tmp/release.json << EOF
+        {"text": $MESSAGE}
+        EOF
+          # line above needs to be missing indentation
+
+          cat /tmp/release.json
+
+          curl  -H "Content-type: application/json" --data-binary "@/tmp/release.json"  \
+            "${WEBHOOK_URL}"
+        else
+          echo "All pipelines succeeded."
+        fi
+  workspaces:
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: johnbieren
body: +1 to no workspace if not needed
created_at: 2025-05-15T13:47:45Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,45 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-no-secret
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify the results
path: tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-no-secret.yaml
user: login: johnbieren
body: needs update
created_at: 2025-05-15T13:48:55Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,26 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-wrong-secret
+  annotations:
+    test/assert-task-failure: "run-task"
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify the results
path: tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-wrong-secret.yaml
user: login: johnbieren
body: needs update
created_at: 2025-05-15T13:49:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: Should the task filter $RELEASESTATUS for managed pipelineruns? I just had it take every condition, although it should probably only take relevant conditions
created_at: 2025-05-15T14:14:15Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: Only just saw your replies here now, thanks for the help!
created_at: 2025-05-15T14:18:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
+          - name: revision
+            value: development
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: Paul123111
body: ~~fixed~~
created_at: 2025-05-15T15:42:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,11 @@
+# notify-slack-on-failure-sample pipeline
+
+Sample Tekton pipeline that runs the "notify-slack-on-failure" task.
+
+## Parameters
+
+| Name                                | Description                                                                                                                | Optional   | Default value                                             |
+|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------|
+| secretName                          | Name of secret which contains authentication token for app                                                                 | No         | -                                                         |
+| secretKeyName                       | Name of key within secret which contains webhook URL                                                                       | No         | -                                                         |
+| RELEASE                             | String representation of Release spec                                                                                      | No         | -                                                         |
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: Paul123111
body: fixed
created_at: 2025-05-15T15:42:49Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
+          - name: revision
+            value: development
+          - name: pathInRepo
+            value: tasks/notify-failure-on-slack/notify-failure-on-slack.yaml
+      params:
+        - name: secretName
+          value: $(params.secretName)
+        - name: secretKeyName
+          value: $(params.secretKeyName)
+        - name: RELEASE
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-15T15:42:56Z
author_association: CONTRIBUTOR
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: Paul123111
body: fixed
created_at: 2025-05-15T15:43:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
+
+        if [[ "$RELEASESTATUS" == *"Failed"* ]]; then
+          MESSAGE=$(get-resource "release" "$(params.RELEASE)" | jq -r .status.conditions[].message | awk NF)
+          
+          # need 3 back-ticks around message for code-block
+          MESSAGE=$(echo -n "Managed pipelines failed: \`\`\`$MESSAGE\`\`\`" | jq -Rsa)
+          
+          cat > /tmp/release.json << EOF
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-15T15:44:44Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,11 @@
+# notify-slack-on-failure-sample pipeline
+
+Sample Tekton pipeline that runs the "notify-slack-on-failure" task.
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: Paul123111
body: fixed
created_at: 2025-05-15T15:45:49Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-15T15:46:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,45 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-no-secret
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify the results
path: tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-no-secret.yaml
user: login: Paul123111
body: fixed - updated description
created_at: 2025-05-15T15:46:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,26 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-wrong-secret
+  annotations:
+    test/assert-task-failure: "run-task"
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify the results
path: tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-wrong-secret.yaml
user: login: Paul123111
body: fixed - updated description
created_at: 2025-05-15T15:46:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,11 @@
+# notify-slack-on-failure-sample pipeline
+
+Sample Tekton pipeline that runs the "notify-slack-on-failure" task.
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: Paul123111
body: I just copied over the description from the task
created_at: 2025-05-15T15:48:53Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: updated description
created_at: 2025-05-15T15:57:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: updated description
created_at: 2025-05-15T15:58:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
+          - name: revision
+            value: development
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: mmalina
body: The pipeline is still missing these parameters. They are added automatically by the operator to the pipelinerun, but you still need to specify them in the pipeline.
created_at: 2025-05-16T09:37:49Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: I unresolved this description by accident, it was already closed
created_at: 2025-05-16T09:41:22Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,74 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via the 'secretKeyName' pipeline parameter \ 
+          provided in the release-plan"
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: mmalina
body: Nit: Indent extra two chars for better visibility. But also, check this out:
```
echo "bla \
dquote>   bla"
bla   bla
```
All the spaces are preserved. So it would be better to do:
```suggestion
          echo "No secret key name provided via the 'secretKeyName' pipeline parameter" \ 
            "provided in the release-plan"
```
created_at: 2025-05-16T09:43:02Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,74 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via the 'secretKeyName' pipeline parameter \ 
+          provided in the release-plan"
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the 'secretKeyName' \
+              pipeline parameter provided in the release-plan but the Secret does not contain the key"
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: mmalina
body: Similar to another place: This way all the indentation on the second line is included in the echo. So it's better to split it into two strings:
```suggestion
          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the 'secretKeyName'" \
              "pipeline parameter provided in the release-plan but the Secret does not contain the key"
```
created_at: 2025-05-16T09:44:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: seanconroy2021
body: That's okay, I was just about to message you. Typically, we allow the reviewer to resolve the comment to ensure nothing gets missed. :) 
created_at: 2025-05-16T09:46:36Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
+          - name: revision
+            value: development
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: Paul123111
body: might need to add taskGitRevision and taskGitUrl to params, looking at the examples again
created_at: 2025-05-16T09:47:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: seanconroy2021
body: Yes, the task should filter release for only the managed PipelineRuns, as we will only send the message if the managed pipeline fails.

IDK if you have done this yet, but it might be handy to look at a release before trying to update the JQ expression 
`oc get release <release-name> -o json `
created_at: 2025-05-16T10:24:34Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
+          - name: revision
+            value: development
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: Paul123111
body: I only just saw your comment now, I couldn't see it when I wrote my previous comment
created_at: 2025-05-16T10:25:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
+          - name: revision
+            value: development
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: Paul123111
body: This should be fixed now, at least
created_at: 2025-05-16T10:26:40Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: Fixed - I changed back to `kubectl`, using Johnny's code as an example.
created_at: 2025-05-16T10:28:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: Martin messaged me on Slack about that, I know not to resolve comments I'm not the author of now :)
created_at: 2025-05-16T10:30:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,74 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via the 'secretKeyName' pipeline parameter \ 
+          provided in the release-plan"
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-16T10:30:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,74 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via the 'secretKeyName' pipeline parameter \ 
+          provided in the release-plan"
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the 'secretKeyName' \
+              pipeline parameter provided in the release-plan but the Secret does not contain the key"
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-16T10:31:06Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: I will probably fix this next
created_at: 2025-05-16T10:33:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
+          - name: revision
+            value: development
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: mmalina
body: Almost there. It needs to be added to the README file as well.
created_at: 2025-05-16T11:19:57Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,42 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sample pipeline that runs the "notify-slack-on-failure" task
+  params:
+    - name: secretName
+      type: string
+    - name: secretKeyName
+      type: string
+    - name: release
+      type: string
+  workspaces:
+    - name: release-workspace
+  tasks:
+    - name: notify-slack-on-failure
+      taskRef:
+        resolver: "git"
+        params:
+          - name: url
+            value: https://github.com/Paul123111/community-catalog.git
+          - name: revision
+            value: development
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-16T11:32:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-16T11:33:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,13 @@
+# notify-slack-on-failure-sample pipeline
+
+Sends an error message to Slack using postMessage API if managed pipelines fail.
+
+## Parameters
+
+| Name                                | Description                                                                                                                | Optional   | Default value                                             |
+|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------|
+| secretName                          | Name of secret which contains authentication token for app                                                                 | No         | -                                                         |
+| secretKeyName                       | Name of key within secret which contains webhook URL                                                                       | No         | -                                                         |
+| release                             | String representation of release spec                                                                                      | No         | -                                                         |
+| taskGitUrl                          | The url to the git repo where the community-catalog tasks to be used are stored                                            | No         | https://github.com/konflux-ci/community-catalog.git       |
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: mmalina
body: This one is optional, becasue it has a default.
created_at: 2025-05-16T11:40:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,13 @@
+# notify-slack-on-failure-sample pipeline
+
+Sends an error message to Slack using postMessage API if managed pipelines fail.
+
+## Parameters
+
+| Name                                | Description                                                                                                                | Optional   | Default value                                             |
+|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------|
+| secretName                          | Name of secret which contains authentication token for app                                                                 | No         | -                                                         |
+| secretKeyName                       | Name of key within secret which contains webhook URL                                                                       | No         | -                                                         |
+| release                             | String representation of release spec                                                                                      | No         | -                                                         |
+| taskGitUrl                          | The url to the git repo where the community-catalog tasks to be used are stored                                            | No         | https://github.com/konflux-ci/community-catalog.git       |
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: Paul123111
body: fixed
created_at: 2025-05-16T12:34:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
+
+        if [[ "$RELEASESTATUS" == *"Failed"* ]]; then
+          MESSAGE=$(get-resource "release" "$(params.RELEASE)" | jq -r .status.conditions[].message | awk NF)
+          
+          # need 3 back-ticks around message for code-block
+          MESSAGE=$(echo -n "Managed pipelines failed: \`\`\`$MESSAGE\`\`\`" | jq -Rsa)
+          
+          cat > /tmp/release.json << EOF
+        {"text": $MESSAGE}
+        EOF
+          # line above needs to be missing indentation
+
+          cat /tmp/release.json
+
+          curl  -H "Content-type: application/json" --data-binary "@/tmp/release.json"  \
+            "${WEBHOOK_URL}"
+        else
+          echo "All pipelines succeeded."
+        fi
+  workspaces:
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: Fixed - Removed workspace, I still managed to keep the testing fairly similar to before:
The main difference is that the check-results tasks that used to exist in some of the tests have been moved to the mock curl function.
created_at: 2025-05-16T12:37:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,73 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: RELEASE
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via 'slack.slack-webhook-notification-secret-keyname' key in Data."
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the Release data \
+              but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        # TODO: make namespace and release parameters
+        RELEASESTATUS=$(get-resource "release" "$(params.RELEASE)" | jq .status.conditions[].reason)
+
+        if [[ "$RELEASESTATUS" == *"Failed"* ]]; then
+          MESSAGE=$(get-resource "release" "$(params.RELEASE)" | jq -r .status.conditions[].message | awk NF)
+          
+          # need 3 back-ticks around message for code-block
+          MESSAGE=$(echo -n "Managed pipelines failed: \`\`\`$MESSAGE\`\`\`" | jq -Rsa)
+          
+          cat > /tmp/release.json << EOF
+        {"text": $MESSAGE}
+        EOF
+          # line above needs to be missing indentation
+
+          cat /tmp/release.json
+
+          curl  -H "Content-type: application/json" --data-binary "@/tmp/release.json"  \
+            "${WEBHOOK_URL}"
+        else
+          echo "All pipelines succeeded."
+        fi
+  workspaces:
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: mmalina
body: Great!
created_at: 2025-05-16T13:58:18Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,47 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: johnbieren
body: I don't think `-sample` should be included here (applies to the file and dir names too). Yes, this is being added as a sample, but I expect (probably many) users to use it in production workflows
created_at: 2025-05-19T13:49:03Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,72 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via the 'secretKeyName' pipeline parameter" \
+            "provided in the release-plan"
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the 'secretKeyName'" \
+            "pipeline parameter provided in the release-plan but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        IFS='/' read -r RELEASE_NAMESPACE RELEASE_NAME <<< "$(params.release)"
+        RELEASECONDITIONS=$(kubectl get release "$RELEASE_NAME" -n "$RELEASE_NAMESPACE" \
+          -o jsonpath='{.status.conditions}' | jq '.[] | select(.type == "ManagedPipelineProcessed")')
+        
+        RELEASESTATUS=$( echo -n "$RELEASECONDITIONS" | jq .reason )
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: johnbieren
body: You should be able to replace this with `jq -r '.reason' <<< "$RELEASECONDITIONS")`
created_at: 2025-05-19T13:50:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,72 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      description: String representation of Release spec
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: johnbieren
body: This isn't what it is. It appears to be the namespaced name of the release
created_at: 2025-05-19T13:50:50Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,11 @@
+# notify-slack-on-failure
+
+Tekton task that sends an error message to Slack using postMessage API if managed pipelines fail.
+
+## Parameters
+
+| Name                                | Description                                                                                                                | Optional   | Default value                                             |
+|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------|
+| secretName                          | Name of secret which contains authentication token for app                                                                 | No         | -                                                         |
+| secretKeyName                       | Name of key within secret which contains webhook URL                                                                       | No         | -                                                         |
+| release                             | String representation of release spec                                                                                      | No         | -                                                         |
path: tasks/notify-slack-on-failure/README.md
user: login: johnbieren
body: same comment as in yaml
created_at: 2025-05-19T13:50:58Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,13 @@
+# notify-slack-on-failure-sample pipeline
+
+Sends an error message to Slack using postMessage API if managed pipelines fail.
+
+## Parameters
+
+| Name                                | Description                                                                                                                | Optional   | Default value                                             |
+|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------|
+| secretName                          | Name of secret which contains authentication token for app                                                                 | No         | -                                                         |
+| secretKeyName                       | Name of key within secret which contains webhook URL                                                                       | No         | -                                                         |
+| release                             | String representation of release spec                                                                                      | No         | -                                                         |
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: johnbieren
body: I don't think this description is accurate
created_at: 2025-05-19T13:51:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,47 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      type: string
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      type: string
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      type: string
+      description: String representation of release spec
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: johnbieren
body: same comment
created_at: 2025-05-19T13:51:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,159 @@
+#!/usr/bin/env bash
+# shellcheck disable=SC2016
path: tasks/notify-slack-on-failure/tests/mocks.sh
user: login: johnbieren
body: why? What is this rule? Can you add a comment explaining?
created_at: 2025-05-19T13:51:52Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,159 @@
+#!/usr/bin/env bash
+# shellcheck disable=SC2016
+set -eux
+
+# mocks to be injected into task step scripts
+
+function curl() {
+  echo Mock curl called with: $*
+  echo $* >> /tmp/mock_curl.txt
+
+  if [[ "$*" != "-H Content-type: application/json --data-binary @/tmp/payload.json ABCDEF"* ]]
+  then
+    echo Error: Unexpected call
+    exit 1
+  fi
+
+  # no workspaces to pass information along, but there's only one test that actually uses curl.
+  # if any other test manages to use curl, release is set to 'ns/success' in all other tests
+  # so they won't reproduce the error message and the test will fail
+  if [ "$(cat /tmp/payload.json)" != \
+    '{"text": "Managed pipelines failed: ```SAMPLE ERROR MESSAGE```"}' ]; then
+    echo Error: unexpected message
+    cat /tmp/payload.json
+    exit 1
+  fi
+
+  # makes sure curl is not called multiple times on test-notify-slack-release-failure.yaml
+  if [ "$(wc -l < /tmp/mock_curl.txt)" != 1 ]; then
+    echo Error: curl was expected to be called 1 times. Actual calls:
+    cat /tmp/mock_curl.txt
+    exit 1
+  fi
+}
+
+function kubectl() {
+  #echo Mock kubectl called with: $*
path: tasks/notify-slack-on-failure/tests/mocks.sh
user: login: johnbieren
body: this and the following line leftover debug?
created_at: 2025-05-19T13:52:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,19 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-release-failure
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify the results when a release fails
path: tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-failure.yaml
user: login: johnbieren
body: this say you will verify the results, but there is no verify task - you are just running the task and that's it
created_at: 2025-05-19T13:53:37Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,19 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-release-success
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify the results when a release succeeds
path: tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-success.yaml
user: login: johnbieren
body: same comment about verifying results
created_at: 2025-05-19T13:53:49Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,47 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-19T14:38:27Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,72 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      description: String representation of Release spec
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-19T14:42:02Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,11 @@
+# notify-slack-on-failure
+
+Tekton task that sends an error message to Slack using postMessage API if managed pipelines fail.
+
+## Parameters
+
+| Name                                | Description                                                                                                                | Optional   | Default value                                             |
+|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------|
+| secretName                          | Name of secret which contains authentication token for app                                                                 | No         | -                                                         |
+| secretKeyName                       | Name of key within secret which contains webhook URL                                                                       | No         | -                                                         |
+| release                             | String representation of release spec                                                                                      | No         | -                                                         |
path: tasks/notify-slack-on-failure/README.md
user: login: Paul123111
body: fixed
created_at: 2025-05-19T14:42:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,13 @@
+# notify-slack-on-failure-sample pipeline
+
+Sends an error message to Slack using postMessage API if managed pipelines fail.
+
+## Parameters
+
+| Name                                | Description                                                                                                                | Optional   | Default value                                             |
+|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------|
+| secretName                          | Name of secret which contains authentication token for app                                                                 | No         | -                                                         |
+| secretKeyName                       | Name of key within secret which contains webhook URL                                                                       | No         | -                                                         |
+| release                             | String representation of release spec                                                                                      | No         | -                                                         |
path: pipelines/notify-slack-on-failure-sample/README.md
user: login: Paul123111
body: fixed
created_at: 2025-05-19T14:42:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,47 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: notify-slack-on-failure-sample
+  labels:
+    app.kubernetes.io/version: "0.1"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: release
+spec:
+  description: Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      type: string
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      type: string
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      type: string
+      description: String representation of release spec
path: pipelines/notify-slack-on-failure-sample/notify-slack-on-failure-sample.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-19T14:42:26Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,159 @@
+#!/usr/bin/env bash
+# shellcheck disable=SC2016
path: tasks/notify-slack-on-failure/tests/mocks.sh
user: login: Paul123111
body: I added a comment explaining why this was added

It was in one of the check-results tasks in the tests before I removed the workspace, and I moved some of that task's script over to the mock curl function to test test-notify-slack-on-failure-release-failure.yaml
created_at: 2025-05-19T14:45:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,159 @@
+#!/usr/bin/env bash
+# shellcheck disable=SC2016
+set -eux
+
+# mocks to be injected into task step scripts
+
+function curl() {
+  echo Mock curl called with: $*
+  echo $* >> /tmp/mock_curl.txt
+
+  if [[ "$*" != "-H Content-type: application/json --data-binary @/tmp/payload.json ABCDEF"* ]]
+  then
+    echo Error: Unexpected call
+    exit 1
+  fi
+
+  # no workspaces to pass information along, but there's only one test that actually uses curl.
+  # if any other test manages to use curl, release is set to 'ns/success' in all other tests
+  # so they won't reproduce the error message and the test will fail
+  if [ "$(cat /tmp/payload.json)" != \
+    '{"text": "Managed pipelines failed: ```SAMPLE ERROR MESSAGE```"}' ]; then
+    echo Error: unexpected message
+    cat /tmp/payload.json
+    exit 1
+  fi
+
+  # makes sure curl is not called multiple times on test-notify-slack-release-failure.yaml
+  if [ "$(wc -l < /tmp/mock_curl.txt)" != 1 ]; then
+    echo Error: curl was expected to be called 1 times. Actual calls:
+    cat /tmp/mock_curl.txt
+    exit 1
+  fi
+}
+
+function kubectl() {
+  #echo Mock kubectl called with: $*
path: tasks/notify-slack-on-failure/tests/mocks.sh
user: login: Paul123111
body: fixed
created_at: 2025-05-19T14:45:44Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,19 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-release-failure
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify the results when a release fails
path: tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-failure.yaml
user: login: Paul123111
body: I moved some of the "check-results" task on that test over to the mock curl function to verify this test's results when I removed the workspace, as it's the only test that actually runs curl.

I could still remove that part of the description, though
created_at: 2025-05-19T14:55:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,72 @@
+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  name: notify-slack-on-failure
+spec:
+  description: >-
+    Sends an error message to Slack using postMessage API if managed pipelines fail
+  params:
+    - name: secretName
+      description: Name of secret which contains authentication token for app
+    - name: secretKeyName
+      description: Name of key within secret which contains webhook URL
+    - name: release
+      description: String representation of Release spec
+  volumes:
+    - name: slack-token
+      secret:
+        secretName: $(params.secretName)
+        optional: true
+  steps:
+    - name: notify-failure
+      image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f
+      volumeMounts:
+        - name: slack-token
+          mountPath: "/etc/secrets"
+          readOnly: true
+      env:
+        - name: KEYNAME
+          value: $(params.secretKeyName)
+      script: |
+        #!/usr/bin/env bash
+        set -eux
+
+        if [ -z "${KEYNAME}" ] ; then
+          echo "No secret key name provided via the 'secretKeyName' pipeline parameter" \
+            "provided in the release-plan"
+          echo "No message will be sent to Slack"
+          exit
+        fi
+
+        if [ -f "/etc/secrets/${KEYNAME}" ]; then
+          WEBHOOK_URL=$(cat "/etc/secrets/${KEYNAME}")
+        else
+          echo "Error: Secret not defined properly. The key to use (${KEYNAME}) is defined in the 'secretKeyName'" \
+            "pipeline parameter provided in the release-plan but the Secret does not contain the key"
+          exit 1
+        fi
+
+        # check for release status and check if a managed pipeline failed
+        IFS='/' read -r RELEASE_NAMESPACE RELEASE_NAME <<< "$(params.release)"
+        RELEASECONDITIONS=$(kubectl get release "$RELEASE_NAME" -n "$RELEASE_NAMESPACE" \
+          -o jsonpath='{.status.conditions}' | jq '.[] | select(.type == "ManagedPipelineProcessed")')
+        
+        RELEASESTATUS=$( echo -n "$RELEASECONDITIONS" | jq .reason )
path: tasks/notify-slack-on-failure/notify-slack-on-failure.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-19T15:22:02Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,19 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-release-success
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify the results when a release succeeds
path: tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-success.yaml
user: login: Paul123111
body: fixed
created_at: 2025-05-19T15:22:16Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,19 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-release-failure
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify the results when a release fails
path: tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-failure.yaml
user: login: johnbieren
body: My point was most of our tests have something like this https://github.com/konflux-ci/release-service-catalog/blob/development/tasks/managed/send-slack-notification/tests/test-send-slack-notification.yaml#L35 which verifies the results. These tests do not seem to, so I don't see how the results are being verified (although the descriptions say they are)
created_at: 2025-05-20T12:56:47Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,19 @@
+---
+apiVersion: tekton.dev/v1
+kind: Pipeline
+metadata:
+  name: test-notify-slack-on-failure-release-failure
+spec:
+  description: |
+    Run the notify-slack-on-failure task and verify the results when a release fails
path: tasks/notify-slack-on-failure/tests/test-notify-slack-on-failure-release-failure.yaml
user: login: Paul123111
body: Fixed:

Looking at that test again, you are correct - I realise now that that test doesn't actually verify the results.

The code in the mock curl function will catch if the incorrect error message is submitted, or if curl is called multiple times, but it has no way of verifying the results if curl is not used (for example, if the failed release was not detected as a failure by the script), as there is no check-results task in the test.
created_at: 2025-05-20T13:40:51Z
author_association: CONTRIBUTOR

PR comments:
user: login: Paul123111
created_at: 2025-05-16T15:01:48Z
body: Mistakenly pushed to this branch, should be the same as before now
author_association: CONTRIBUTOR
user: login: Paul123111
created_at: 2025-05-20T15:21:19Z
body: Merged!
author_association: CONTRIBUTOR