Skip to content

Move slack-webhook-notification task from build-definitions - #312

Merged
flacatus merged 2 commits into
konflux-ci:mainfrom
slimreaper35:slack-webhook-notification
Aug 10, 2026
Merged

Move slack-webhook-notification task from build-definitions#312
flacatus merged 2 commits into
konflux-ci:mainfrom
slimreaper35:slack-webhook-notification

Conversation

@slimreaper35

Copy link
Copy Markdown
Member

No description provided.

@slimreaper35
slimreaper35 requested a review from a team as a code owner July 31, 2026 11:53
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 31, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 11:54 AM UTC · Ended 12:00 PM UTC
Commit: d5d3758 · View workflow run →

@qodo-app-for-konflux-ci

Copy link
Copy Markdown

PR Summary by Qodo

Import Slack webhook notification Tekton tasks into this catalog

✨ Enhancement 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Add slack-webhook-notification Tekton Task for posting messages via Slack incoming webhooks.
• Add OCI Trusted Artifact variant that consumes SOURCE_ARTIFACT instead of a source workspace.
• Document task parameters and provide a recipe-based derivation for the OCI-TA variant.
Diagram

graph TD
  P["Pipeline / PipelineRun"] --> Tstd["Task: slack-webhook-notification"] --> Sec[("K8s Secret")] --> Runner["Step: task-runner"] --> Slack{{"Slack Webhook"}}
  P --> Toci["Task: slack-webhook-notification-oci-ta"] --> TA[["Trusted Artifact use"]] --> Workdir["EmptyDir workdir"] --> Sec --> Runner --> Slack

  subgraph Legend
    direction LR
    _comp["Tekton component"] ~~~ _sec[("Secret/volume")] ~~~ _ta[["Trusted artifact step"]] ~~~ _ext{{"External system"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Reference tasks directly from build-definitions (vendoring/automation)
  • ➕ Avoids duplicated task logic across repositories
  • ➕ Easier to consume upstream updates/fixes automatically
  • ➖ Adds coupling to another repo’s release/branching model
  • ➖ May not fit catalog expectations for in-repo, versioned task artifacts
2. Generate the OCI-TA YAML at release time from recipe only
  • ➕ Single source-of-truth reduces drift between recipe and rendered YAML
  • ➕ Less boilerplate committed to the repo
  • ➖ Requires guaranteed build/release automation to render artifacts
  • ➖ Harder for users to consume the task YAML directly from the repo

Recommendation: The current approach (copying the tasks into this catalog and keeping a recipe + rendered YAML for the OCI-TA variant) is appropriate for a catalog repo that aims to provide self-contained, versioned Tekton task definitions. The only strategic follow-up worth considering is tightening automation around recipe → rendered YAML to prevent divergence, but keeping the rendered YAML in-tree remains the most user-friendly default.

Files changed (5) +561 / -0

Enhancement (2) +515 / -0
slack-webhook-notification-oci-ta.yamlAdd slack-webhook-notification-oci-ta Tekton Task definition +265/-0

Add slack-webhook-notification-oci-ta Tekton Task definition

• Defines a Tekton Task that fetches source via Trusted Artifacts into an emptyDir workdir, then runs the same Slack-posting logic with support for file dumps, submodule logs, and user/group mentions. Adds upstream-usable label and configures secret mounting for webhook URL retrieval.

tasks/slack-webhook-notification-oci-ta/0.1/slack-webhook-notification-oci-ta.yaml

slack-webhook-notification.yamlAdd slack-webhook-notification Tekton Task definition +250/-0

Add slack-webhook-notification Tekton Task definition

• Introduces the base Tekton Task that composes a Slack message (optionally including file content and submodule logs) and posts it via an incoming webhook stored in a mounted secret. Marks the task as upstream-usable and keeps the source workspace optional.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml

Documentation (2) +37 / -0
README.mdDocument OCI Trusted Artifact Slack notification task parameters +16/-0

Document OCI Trusted Artifact Slack notification task parameters

• Adds README documenting the slack-webhook-notification-oci-ta task and its parameters, including SOURCE_ARTIFACT and optional mention/file/submodule features.

tasks/slack-webhook-notification-oci-ta/0.1/README.md

README.mdDocument Slack webhook notification task usage and workspace +21/-0

Document Slack webhook notification task usage and workspace

• Adds README describing the base slack-webhook-notification task, its parameters (message, secret/key, mentions, dumps), and the optional source workspace.

tasks/slack-webhook-notification/0.1/README.md

Other (1) +9 / -0
recipe.yamlAdd recipe to derive OCI-TA variant from base task +9/-0

Add recipe to derive OCI-TA variant from base task

• Introduces a recipe that bases the OCI-TA task on the standard slack-webhook-notification task, swaps in Trusted Artifact usage, removes the source workspace, and adjusts the workspace path mapping.

tasks/slack-webhook-notification-oci-ta/0.1/recipe.yaml

@qodo-app-for-konflux-ci

qodo-app-for-konflux-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (7) 📘 Rule violations (3) 📜 Skill insights (3)

Grey Divider


Action required

1. Symlink bypasses workspace check ✓ Resolved 🐞 Bug ⛨ Security
Description
In dumpFile, the workspace containment check canonicalizes only the parent directory and then
appends the basename; a file inside the workspace that is a symlink to an out-of-workspace target
will still pass the prefix check and cat will exfiltrate the symlink target’s contents. This
defeats the intended “refuse outside workspace” protection for files dumping.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R121-123]

+          workspace_root=$(pwd -P)
+          resolved=$(cd "$(dirname "${filePath}")" && pwd -P)/$(basename "${filePath}")
+          case "${resolved}" in
Relevance

●●● Strong

Concrete security bug; team often accepts small bash hardening fixes in tasks.

PR-#193

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
resolved is built from a canonicalized directory plus the original basename, so it does not
reflect the real target when the basename is a symlink; the subsequent cat follows that symlink to
its target.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[121-129]
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[131-136]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`dumpFile` tries to prevent reading files outside the bound workspace, but its current canonicalization only resolves the directory path. If `${filePath}` is a symlink (e.g., `leak -> /etc/passwd`), `resolved` remains under the workspace prefix while `cat` follows the symlink and reads the external target.

### Issue Context
The code computes `workspace_root` via `pwd -P` and computes `resolved` by `cd`-ing into `dirname` and appending `basename`. This does not resolve symlinks on the final path component.

### Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[121-135]

### Suggested fix
- Canonicalize the *entire* file path including the final component (e.g., `realpath -e -- "${filePath}"` or `readlink -f -- "${filePath}"`).
- Perform the workspace-prefix check against that fully-resolved path.
- Optionally reject symlinks explicitly (`[[ -L "${filePath}" ]]`) if you want to forbid symlink reads even when they resolve inside the workspace.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Missing tests/ for task 📜 Skill insight ▣ Testability
Description
The new Tekton Task tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml is added
without a tests/ directory containing a positive test pipeline
(test-slack-webhook-notification-pass.yaml). This violates the repo requirement and will prevent
the task from being validated by the expected test runner.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R1-15]

+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  labels:
+    app.kubernetes.io/version: "0.1"
+    upstream-usable: "true"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: "konflux"
+  name: slack-webhook-notification
+spec:
+  description: >-
+    Sends message to slack using incoming webhook
+  params:
+    - name: message
Relevance

●●● Strong

Repo testing framework expects per-task tests/ (PR #262); reviewers requested adding tests
previously (PR #295).

PR-#262
PR-#295

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2763 requires every Tekton task version directory to include tests/ with a
positive test file test-<name>-pass.yaml. The PR adds the task at
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml but the version directory
does not include the required test assets.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[1-15]
Skill: running-task-tests

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A new Tekton task version was added under `tasks/slack-webhook-notification/0.1/` but there is no `tests/` directory and no positive test pipeline file named `test-slack-webhook-notification-pass.yaml`.

## Issue Context
Per repo compliance, every Tekton task version directory must include `tests/` with at least one passing test pipeline so CI can execute task validation.

## Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[1-250]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Bash script missing strict flags 📜 Skill insight ☼ Reliability
Description
The embedded bash script does not enable errexit, nounset, and pipefail, increasing the risk
of silent failures and partial execution. This violates the repository requirement for strict bash
error handling.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R81-87]

+      script: |
+        #!/usr/bin/env bash
+
+        # ---------
+        #  HELPERS
+        # ---------
+
Relevance

●●● Strong

Strict bash flags (set -euo pipefail) have been accepted in past task-script reviews.

PR-#196

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2774 requires set -o errexit -o nounset -o pipefail near the top of bash scripts;
in the cited scripts, the inline bash begins with #!/usr/bin/env bash but does not set these
flags, demonstrating non-compliance with the strict-mode requirement.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[81-87]
tasks/slack-webhook-notification-oci-ta/0.1/slack-webhook-notification-oci-ta.yaml[92-99]
Skill: pr-definition-of-done

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The inline bash scripts start with a bash shebang but do not enable strict error handling (`set -o errexit -o nounset -o pipefail`).

## Issue Context
PR Compliance ID 2774 requires strict mode near the top of bash scripts, and strict mode prevents hidden failures in CI/task execution.

## Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[81-87]
- tasks/slack-webhook-notification-oci-ta/0.1/slack-webhook-notification-oci-ta.yaml[92-98]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View action required (3)
4. Args loop can hang ✓ Resolved 🐞 Bug ☼ Reliability
Description
The argument parsing while loop never advances (shift) on unknown tokens and the inner loops
treat any ^-- token as an option boundary, so a files/submodules value that begins with --
can cause an infinite loop.
When triggered, the step can hang indefinitely and block the Task/PipelineRun from completing.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R154-185]

+        while [[ $# -gt 0 ]]; do
+          case $1 in
+          --files)
+            shift
+            while [[ $# -gt 0 ]] && ! [[ "$1" =~ ^--.* ]]; do
+              FILES+=("$1")
+              shift
+            done
+            ;;
+          --submodules)
+            shift
+            while [[ $# -gt 0 ]] && ! [[ "$1" =~ ^--.* ]]; do
+              SUBMODULES+=("$1")
+              shift
+            done
+            ;;
+          --user-ids)
+            shift
+            while [[ $# -gt 0 ]] && ! [[ "$1" =~ ^--.* ]]; do
+              USER_IDS+=("$1")
+              shift
+            done
+            ;;
+          --group-ids)
+            shift
+            while [[ $# -gt 0 ]] && ! [[ "$1" =~ ^--.* ]]; do
+              GROUP_IDS+=("$1")
+              shift
+            done
+            ;;
+          esac
+        done
Relevance

●● Moderate

Similar shell correctness fixes are accepted (PR #193), but no historical finding specifically about
arg-parsing infinite loops.

PR-#193

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The parser’s case statement has no default branch, and the outer loop only shifts inside
recognized options. If $1 ever becomes an unrecognized token (including a value that starts with
--), $# never decreases and the loop repeats forever.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[154-185]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The args parser can get stuck in an infinite loop because:
- The outer `while [[ $# -gt 0 ]]` loop has no `*)` default branch to `shift`/error.
- The inner loops stop on any `^--` token, so a legitimate value like a file path `--foo` becomes an “unknown option” that the outer loop then cannot consume.

### Issue Context
This Task passes Tekton array params into args. File paths/submodule names are user-controlled inputs and can legally start with `--`.

### Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[154-185]

### Suggested fix
- Add a `*)` case that prints an error and exits (or at minimum `shift`s) to prevent infinite loops.
- Change the inner-loop boundary check from `^--.*` to “is one of the known flags” (e.g., `--files|--submodules|--user-ids|--group-ids`) so values starting with `--` are still treated as values unless they match a known flag.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. tekton.dev/tags not in labels 📜 Skill insight ≡ Correctness
Description
The Task currently sets tekton.dev/tags under metadata.annotations instead of metadata.labels,
so the required Kubernetes label is missing. This can break label-based discovery/compliance tooling
for Konflux tasks.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R4-9]

+  labels:
+    app.kubernetes.io/version: "0.1"
+    upstream-usable: "true"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: "konflux"
Relevance

●● Moderate

No prior review evidence about tekton.dev/tags label-vs-annotation enforcement in this repo.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2770 requires tekton.dev/tags to be set under metadata.labels, but in the
modified Task YAML it appears only under metadata.annotations while metadata.labels contains
only app.kubernetes.io/version and upstream-usable, demonstrating the label is missing in the
required location.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[4-9]
tasks/slack-webhook-notification-oci-ta/0.1/slack-webhook-notification-oci-ta.yaml[5-11]
Skill: pr-definition-of-done

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`tekton.dev/tags` is required as a Kubernetes label under `metadata.labels`, but it is currently placed under `metadata.annotations`.

## Issue Context
Compliance requires `app.kubernetes.io/version`, `upstream-usable`, and `tekton.dev/tags: konflux` to be present in `metadata.labels`.

## Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[4-10]
- tasks/slack-webhook-notification-oci-ta/0.1/slack-webhook-notification-oci-ta.yaml[4-12]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Optional workspace breaks task ⊘ Outdated 🐞 Bug ≡ Correctness
Description
The slack-webhook-notification Task sets workingDir to $(workspaces.source.path)/source while
declaring workspace source as optional, so TaskRuns that omit the workspace can fail to start or
run in a non-existent directory. This breaks current callers like deploy-fbc-operator’s finally
slack notification, which does not bind any workspace.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R246-250]

+      workingDir: $(workspaces.source.path)/source
+  workspaces:
+    - name: source
+      description: Workspace containing the source code to build.
+      optional: true
Relevance

●● Moderate

Only weak/undetermined prior workspace-compat concerns; no clear accepted precedent for optional
workspace + workingDir.

PR-#199

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The task marks the source workspace optional but still hard-depends on it by setting workingDir
to the workspace path. The deploy-fbc-operator pipelines invoke this task in finally with params
only and no workspace bindings, so this mismatch will prevent notifications from running.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[246-250]
pipelines/deploy-fbc-operator/0.1/deploy-fbc-operator.yaml[944-973]
pipelines/deploy-fbc-operator/0.2/deploy-fbc-operator.yaml[947-973]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`tasks/slack-webhook-notification` declares workspace `source` as optional but unconditionally uses it via `workingDir: $(workspaces.source.path)/source`. Pipelines that call this task without binding the workspace (common for `finally` notifications) will fail, preventing Slack notifications.

### Issue Context
This task is referenced by existing pipelines without any workspace binding, so it must be runnable without a workspace when `files`/`submodules` features aren’t used.

### Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[246-250]
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[81-186]

### Suggested fix approach
- Remove the `workingDir` field from the step (so the step can start without a workspace).
- In the script, conditionally `cd` only when the workspace is actually bound (use `$(workspaces.source.bound)`), e.g.:
 - If bound: `cd "$(workspaces.source.path)/source"`
 - If not bound:
   - Allow execution when `FILES` and `SUBMODULES` are empty.
   - Fail fast with a clear error if `FILES` or `SUBMODULES` were provided but the workspace isn’t bound.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

7. Empty secret key crashes mount 🐞 Bug ☼ Reliability ⭐ New
Description
The Task substitutes $(params.key-name) directly into secret.items[].key; if a caller supplies an
empty string for key-name, the generated Pod spec can be invalid or mount no
/etc/secrets/webhook-url, causing the step to fail before sending any Slack notification. This
failure can happen before the script’s own secret-file validation runs.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R46-48]

+        items:
+          - key: $(params.key-name)
+            path: webhook-url
Relevance

●●● Strong

Team has accepted fail-fast validation improvements in tasks; this prevents
mount-time/missing-secret-file failures.

PR-#193

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The secret volume mounts a specific key using the parameter value, but the script later assumes a
fixed file path exists. If the key substitution is empty/invalid, the file won’t exist and the Task
may fail at mount/admission time or immediately when checking for /etc/secrets/webhook-url.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[22-24]
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[41-48]
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[231-236]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Task uses a Secret volume `items` entry with `key: $(params.key-name)`. If `key-name` is provided as an empty string (e.g., propagated from upstream params/when-logic), Kubernetes may reject the Pod spec or mount no key file, and the Task can fail before it posts to Slack.

## Issue Context
- `key-name` is a required Tekton param (no default), but callers can still explicitly set it to `""`.
- Because the secret key is embedded in the Pod spec (volume items), the failure can occur at Pod creation/mount time, before the script can print a clear validation error.

## Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[22-48]
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[231-236]

## Suggested fix approach
1. Mount the entire secret at `/etc/secrets` (remove `items:` block).
2. In the script, validate `$(params.key-name)` is non-empty and only then read `/etc/secrets/${KEY_NAME}`.
3. Keep the existing "file missing/empty" error handling, but make the error message include the requested key-name for easier debugging.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. realpath option parsing 🐞 Bug ☼ Reliability
Description
In dumpFile, realpath "${filePath}" is called without an end-of-options marker, so a workspace
file whose name begins with - (e.g. -notes.txt) can be interpreted as a realpath option and
cause the step to fail under errexit. This breaks Slack notifications when users try to dump such
a file via the files parameter.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R121-123]

+          workspace_root=$(pwd -P)
+          resolved=$(realpath "${filePath}")
+          case "${resolved}" in
Relevance

●●● Strong

Low-risk bash hardening for user input; team commonly accepts reliability fixes in task scripts.

PR-#193

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The code shows filePath is a user-provided value (from the files param) that is validated only
for absolute paths and .., then passed directly to realpath without --. This leaves
leading-dash filenames unprotected and can cause realpath to misinterpret the input and abort the
script due to errexit.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[37-40]
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[106-123]
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[282-287]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`dumpFile` resolves a user-supplied relative path with `realpath "${filePath}"`. If `filePath` starts with `-`, many standard CLI parsers treat it as an option rather than a path, which can make `realpath` fail (or print usage) and abort the whole step due to `set -o errexit`.

### Issue Context
The `files` parameter is user-controlled input; `dumpFile` currently blocks absolute paths and `..` traversal but does not guard against leading-dash filenames.

### Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[111-123]

### Suggested fix
- Change to `resolved=$(realpath -- "${filePath}")` to stop option parsing.
- (Optional hardening) explicitly reject `filePath` values starting with `-` if you prefer to disallow them: `[[ "${filePath}" == -* ]] && ...`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Curl config syntax injection 🐞 Bug ⛨ Security
Description
The webhook URL from the mounted secret is written into a curl --config file without sanitizing
characters meaningful to curl’s config syntax (notably " and line breaks). A malformed/malicious
secret value can break out of the intended url = "..." value and inject additional curl
directives, changing request behavior.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R301-304]

+        curl_config="$(mktemp)"
+        trap 'rm -f "${curl_config}"' EXIT
+        printf 'url = "%s"\n' "${WEBHOOK_URL}" >"${curl_config}"
+        chmod 600 "${curl_config}"
Relevance

●●● Strong

Clear injection risk; team tends to accept defensive validation improvements in task scripts.

PR-#193

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
WEBHOOK_URL is sourced directly from the secret file and then interpolated into a curl config
directive. Without validation, curl will parse any injected config syntax present in the secret
value.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[231-240]
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[300-304]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The task writes `${WEBHOOK_URL}` (read from a Kubernetes Secret) into a curl config file. Because the value is not validated/escaped for curl-config syntax, special characters (e.g., `"`, `\r`, `\n`) can alter how curl parses the config file.

### Issue Context
The URL is treated as data but embedded into an option language (curl config). Even if the secret is usually trusted, hardening prevents surprising behavior if the secret is malformed.

### Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[231-240]
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[300-304]

### Suggested fix
- Validate the URL before writing it (e.g., reject any value containing control chars or whitespace; optionally enforce `^https://hooks\.slack\.com/services/` prefix).
- Write the config using an unquoted form after validation (e.g., `printf 'url = %s\n' "$WEBHOOK_URL"`) so there’s no quote-termination vector.
- If quoting must remain, implement escaping appropriate for curl config files and still reject newlines/CR.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View review recommended (9)
10. Submodule lookup exits early ✓ Resolved 🐞 Bug ☼ Reliability
Description
In dumpSubmodule, previous_commit is computed via a git diff | grep | head | awk pipeline
under set -o errexit -o pipefail; if HEAD~1 is unavailable or grep finds no match, the command
substitution fails and the whole step exits. This aborts the task before the final curl posts the
Slack message whenever submodules is used in those conditions.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R122-124]

+          current_commit=$(git -C "${path}" rev-parse HEAD)
+          previous_commit=$(git diff HEAD~1 "${path}" | grep commit | head -n 1 | awk '{print $3;}')
+          if [ "${previous_commit}" = "" ]; then
Relevance

●●● Strong

Team has accepted bash reliability fixes for strict-mode edge cases (quoting empty params,
preserving exit codes).

PR-#191
PR-#207

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The script enables strict error handling (errexit + pipefail) and then runs a pipeline in
command substitution to derive previous_commit; a non-zero from git diff or grep can terminate
the script before reaching the Slack curl call.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[83-85]
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[122-126]
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[241-242]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`dumpSubmodule` computes `previous_commit` with a `git diff ... | grep ...` pipeline inside command substitution while `errexit` and `pipefail` are enabled. If that pipeline returns non-zero (missing `HEAD~1`, empty diff, or no matching line), the script exits before sending the Slack webhook.

## Issue Context
This only impacts runs where `--submodules` is provided, but when it triggers it prevents any Slack notification from being sent.

## Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[83-131]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


11. pipelines.minVersion not string 📘 Rule violation ≡ Correctness
Description
The Task sets tekton.dev/pipelines.minVersion to an unquoted numeric value (0.12.1), which YAML
parses as a number rather than the required non-empty string. This can break tooling that expects a
string annotation value for version comparisons/validation.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[10]

+    tekton.dev/pipelines.minVersion: 0.12.1
Relevance

●● Moderate

No historical evidence found about quoting tekton.dev/pipelines.minVersion; file path shows no prior
repo history.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2689 requires tekton.dev/pipelines.minVersion to be present with a non-empty
string value. The Task sets it to 0.12.1 without quotes, making it a numeric value in YAML rather
than a string.

Rule 2689: Include tekton.dev/pipelines.minVersion annotation on Task YAML definitions
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[10-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`metadata.annotations.tekton.dev/pipelines.minVersion` is currently set as a numeric literal (`0.12.1`) instead of a string, violating the requirement that it be a non-empty string.

## Issue Context
YAML will parse `0.12.1` as a number unless quoted, which can cause schema/validation tooling to mis-handle the annotation.

## Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[10-10]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


12. Task path missing category 📘 Rule violation ⚙ Maintainability
Description
The new task definition is placed at
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml, which does not follow the
required tasks/<category>/<name>/<version>/<name>.yaml convention. Tooling that discovers and
validates tasks by the prescribed directory layout may not detect this task correctly.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R1-4]

+---
+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
Relevance

●● Moderate

No historical review evidence found enforcing tasks/<category>/<name>/<version> layout; similar
suggestions not present in history.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2743 requires task definitions to be located under
tasks/<category>/<name>/<version>/ with filename <name>.yaml. The added task definition is
located at tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml, which lacks the
<category>/ path segment.

Rule 2743: Task definition files must follow the prescribed directory and filename convention
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[1-4]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The task definition file does not follow the required directory convention `tasks/<category>/<name>/<version>/<name>.yaml`.

## Issue Context
This repo uses category-based task paths (e.g., `tasks/linters/yamllint/0.1/yamllint.yaml`). The current task is under `tasks/slack-webhook-notification/0.1/`, missing the `<category>/` segment.

## Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[1-4]
- tasks/slack-webhook-notification/0.1/README.md[1-15]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


13. curl has no timeouts 🐞 Bug ☼ Reliability
Description
The Slack webhook request uses curl without connect/overall timeouts, so a stalled connection can
keep the step running indefinitely.
This can delay or block Task/PipelineRun completion in network-degraded conditions.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R243-245]

+        data=$(jq --compact-output --null-input --arg message "$slack_message" '{text: $message}')
+
+        curl -X POST -H 'Content-type: application/json' --data "${data}" "$WEBHOOK_URL"
Relevance

●● Moderate

No historical evidence found of reviewers requiring curl timeouts in tasks; only general reliability
fixes accepted.

PR-#193

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The Task’s final webhook delivery is a plain curl call with no timeouts. Elsewhere in the repo,
tasks use explicit timeout to bound potentially long waits, indicating time bounding is an
expected reliability practice.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[243-245]
tasks/rosa/hosted-cp/rosa-hcp-provision/0.3/rosa-hcp-provision.yaml[111-126]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The webhook POST uses `curl` without any timeout flags, which can cause indefinite hangs if DNS/TLS/connect/response stalls.

### Issue Context
This repository already uses explicit time bounding (`timeout ...`) in other tasks for long waits.

### Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[243-245]

### Suggested fix
Add time limits, for example:
- `--connect-timeout 5` (or similar)
- `--max-time 30` (or similar)
Optionally add a small retry policy if desired.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


14. Submodule data not validated ✓ Resolved 🐞 Bug ≡ Correctness
Description
dumpSubmodule uses .gitmodules lookups without validating that path/url are present, so
requesting a non-existent submodule can lead to failing git commands and malformed/empty Slack
output.
This makes notifications misleading and hides configuration/input errors.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R121-125]

+          path=$(git config -f .gitmodules --get submodule."${name}".path)
+          url=$(git config -f .gitmodules --get submodule."${name}".url)
+
+          current_commit=$(git -C "${path}" rev-parse HEAD)
+          previous_commit=$(git diff HEAD~1 "${path}" | grep commit | head -n 1 | awk '{print $3;}')
Relevance

●● Moderate

Team often accepts bash robustness/validation fixes (PR #193), but no specific precedent for
.gitmodules submodule validation.

PR-#193

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The script reads path/url from .gitmodules and immediately uses path in `git -C "${path}"
...` without any validation/guardrails, so missing entries result in command failures and
incorrect/missing content.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[118-133]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`dumpSubmodule` assumes the provided submodule name exists in `.gitmodules`. If it doesn’t, `git config ... --get` returns empty, and subsequent `git -C "${path}" ...` calls fail; the script then generates invalid/misleading message content.

### Issue Context
The `submodules` param is user-controlled input; mistakes are common and should be handled explicitly.

### Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[118-141]

### Suggested fix
- After reading `path` and `url`, check they are non-empty and that `path` exists (and is a git repo).
- If validation fails, either:
 - fail fast with a clear error message, or
 - skip that submodule with a clear warning appended to the Slack message/logs.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


15. MinVersion annotation mismatch 🐞 Bug ≡ Correctness
Description
The Task declares tekton.dev/pipelines.minVersion: "0.12.1" while using `apiVersion:
tekton.dev/v1`, which can mislead catalog/automation into advertising compatibility with Tekton
installations that may not support this API version.
This can cause failed application/instantiation on older clusters despite the declared minVersion.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R1-9]

+apiVersion: tekton.dev/v1
+kind: Task
+metadata:
+  labels:
+    app.kubernetes.io/version: "0.1"
+    upstream-usable: "true"
+  annotations:
+    tekton.dev/pipelines.minVersion: "0.12.1"
+    tekton.dev/tags: "konflux"
Relevance

●● Moderate

No clear prior reviews enforcing minVersion↔apiVersion alignment; only general task-metadata edits
seen.

PR-#262

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The slack task explicitly sets tekton.dev/pipelines.minVersion: "0.12.1" while also declaring
apiVersion: tekton.dev/v1. In-repo precedent shows v1 tasks that declare a minVersion use a much
newer value, indicating this one is likely stale/incorrect metadata.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[1-10]
tasks/konflux-ci/deploy/0.3/deploy-konflux-ci.yaml[1-13]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The Task uses `apiVersion: tekton.dev/v1` but advertises an extremely old `tekton.dev/pipelines.minVersion` (0.12.1). This makes compatibility metadata unreliable for any tooling/catalog consumers that use it.

### Issue Context
Other v1 tasks in this repo that do set `tekton.dev/pipelines.minVersion` use a much newer baseline.

### Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[1-10]

### Suggested fix
Update `tekton.dev/pipelines.minVersion` to a version baseline consistent with `tekton.dev/v1` usage in this repo (e.g., align with other v1 tasks that set it), or remove the annotation if it’s not intended to be maintained.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


16. Unrestricted file dumping risk 🐞 Bug ⛨ Security
Description
The tasks accept a files parameter and cat each provided path into the Slack message without
restricting to a workspace subtree, so a caller who can influence parameters can disclose sensitive
in-container files (e.g., serviceaccount token or mounted secrets) to Slack. This is a
data-disclosure risk in any environment where Task params are influenced by untrusted or
semi-trusted inputs.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R103-112]

+        function dumpFile {
+          filePath=$1
+
+          cat << EOM
+        *${filePath}:*
+        \`\`\`
+        $(cat "${filePath}")
+        \`\`\`
+        EOM
+        }
Relevance

●● Moderate

No historical evidence found for restricting param-driven file reads/dumps in task scripts.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The implementation reads the caller-provided path verbatim via cat, and the README explicitly
documents files as a user-provided list of files whose contents will be included in the Slack
message.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[103-112]
tasks/slack-webhook-notification/0.1/README.md[9-16]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`files` is used to read arbitrary paths and embed their contents into a Slack message. Without path validation/allowlisting, this can expose sensitive runtime files if a caller can set `files`.

### Issue Context
This feature may be intended for dumping repo files, but the implementation allows absolute paths and path traversal because it directly uses `cat "$filePath"`.

### Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[103-123]
- tasks/slack-webhook-notification-oci-ta/0.1/slack-webhook-notification-oci-ta.yaml[114-123]
- tasks/slack-webhook-notification/0.1/README.md[9-16]

### Suggested fix approach
- Restrict `files` to a safe base directory (e.g., the repo root when workspace/source is available):
 - Reject absolute paths (`/…`).
 - Reject traversal segments (`..`).
 - Optionally enforce a prefix allowlist (e.g., only under the workspace checkout directory).
- If `files` is meant to support only repository content, document that constraint in the README and enforce it in code.
- Consider failing with a clear error when an invalid path is provided.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


17. HTTP failures not detected 🐞 Bug ☼ Reliability
Description
The Slack webhook call uses curl without --fail (and without checking HTTP status), so Slack
returning HTTP 4xx/5xx can still exit 0 and mark the Task successful even though the notification
wasn’t delivered. This reduces reliability/observability for failure notifications.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R243-245]

+        data=$(jq --compact-output --null-input --arg message "$slack_message" '{text: $message}')
+
+        curl -X POST -H 'Content-type: application/json' --data "${data}" "$WEBHOOK_URL"
Relevance

●● Moderate

No historical evidence found that reviewers require curl --fail / HTTP status checks in task
scripts.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The script ends with a plain curl POST that does not fail on HTTP error responses, and the task’s
scripts don’t use the strict error-handling pattern that is used elsewhere in this repository.

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[82-83]
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[243-246]
tasks/export-logs/0.1/export-logs-to-quay.yaml[52-54]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The task’s Slack webhook POST can silently succeed when Slack returns an HTTP error response. As a result, pipelines may report the notification step as successful even when the message was rejected.

### Issue Context
Other tasks in this repo commonly use strict bash settings (`set -euo pipefail`) to fail fast on errors.

### Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[82-83]
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[243-245]
- tasks/slack-webhook-notification-oci-ta/0.1/slack-webhook-notification-oci-ta.yaml[93-94]
- tasks/slack-webhook-notification-oci-ta/0.1/slack-webhook-notification-oci-ta.yaml[254-256]

### Suggested fix approach
- Add `set -euo pipefail` near the start of the script.
- Update the curl invocation to fail on HTTP errors, e.g. `curl --fail --show-error --silent ...` (or `--fail-with-body` if you want the response body in logs).
- Optionally log the HTTP status/body on failure for easier debugging.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


18. runAsUser: 0 configured 📘 Rule violation ⛨ Security
Description
The Task explicitly runs its container as UID 0 (root), which is disallowed by policy. Running as
root increases the blast radius of any container breakout or unintended filesystem changes.
Code

tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[R56-58]

+      securityContext:
+        runAsUser: 0
+        runAsNonRoot: false
Relevance

●● Moderate

Repo has merged tasks using runAsUser:0 (e.g., hadolint clone-refs), suggesting inconsistent
enforcement.

PR-#227

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2718 disallows setting securityContext.runAsUser to 0, and the modified Task
configuration shows runAsUser: 0 specified in the step securityContext, demonstrating a direct
violation of the non-root execution requirement.

Rule 2718: Disallow Kubernetes task securityContext.runAsUser set to 0
tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[56-58]
tasks/slack-webhook-notification-oci-ta/0.1/slack-webhook-notification-oci-ta.yaml[263-265]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Task sets `securityContext.runAsUser: 0`, which violates the non-root execution requirement.

## Issue Context
Update the task to run as a non-root UID (and ideally set `runAsNonRoot: true`) unless root is strictly necessary.

## Fix Focus Areas
- tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml[56-58]
- tasks/slack-webhook-notification-oci-ta/0.1/slack-webhook-notification-oci-ta.yaml[263-265]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 46 rules

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

[Comment truncated to fit github's 65,536-char limit.]

Comment thread tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml Outdated
Comment thread tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml Outdated
@slimreaper35
slimreaper35 force-pushed the slack-webhook-notification branch from d690d5a to b919a9a Compare July 31, 2026 11:59
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 31, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:00 PM UTC · Completed 12:19 PM UTC
Commit: d5d3758 · View workflow run →

@slimreaper35 slimreaper35 changed the title Move slack-webhook-notification tasks from build-definitions Move slack-webhook-notification task from build-definitions Jul 31, 2026
@qodo-app-for-konflux-ci

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit b919a9a

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review

Findings

Medium

  • [missing-tests] tasks/slack-webhook-notification/0.1/ — Task has no functional tests. CLAUDE.md documents adding tests under tests/ as part of the new task workflow. However, only 1 existing task in the repo currently has functional tests, and testing a webhook notification task is inherently difficult since it requires external Slack infrastructure. Consider adding at least a negative test that validates failure behavior (e.g., missing secret).

Low

  • [missing-authorization] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — PR adds a new task (314 lines) with no linked issue and no PR body. The PR title states it is a move from build-definitions, which provides some context, but the migration rationale and coordination plan are undocumented. Consider adding a PR description explaining the migration context.

  • [architectural-misalignment] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — Task placed at tasks/slack-webhook-notification/0.1/ without a category subdirectory. The repository uses both patterns: categorized (linters/, rosa/, sprayproxy/, triggers/) and flat (test-metadata, init-quay, pre-pull-images, export-logs, pull-request-comment, etc.). Consider organizing under a category subdirectory for consistency, but this is optional given existing precedent.

  • [scope-creep] tasks/slack-webhook-notification/0.1/README.md — PR title says "Move" but the diff only shows additions. Coordination with build-definitions (deprecation, migration pointers) would be out of scope for this PR but worth tracking separately.

  • [error-handling] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:164 — In dumpSubmodule, if git config -f .gitmodules --get submodule."${name}".path fails because the submodule name does not exist in .gitmodules, the function exits the entire script due to set -o errexit with an opaque error message. A guard or descriptive error would improve debuggability.

  • [edge-case] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:295 — The curl config file uses double-quote delimiters around the webhook URL. Standard Slack webhook URLs use only URL-safe characters so this is unlikely to cause issues in practice.

  • [input-validation] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:198 — User ID and Group ID array values are interpolated into Slack mrkdwn markup without format validation. Impact is limited because the parameters are set by pipeline authors in YAML, not by untrusted end-users.

Previous run

Review

Findings

Medium

  • [edge-case] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:232 — The for user_id in "${USER_IDS[@]}" and for group_id in "${GROUP_IDS[@]}" loops iterate over these arrays without the ${#array[@]} -ne 0 length guard used for FILES and SUBMODULES. Under set -o nounset on bash < 4.4, empty array expansion causes an unbound variable error. The container image likely ships bash >= 5.x, but the inconsistency is fragile if the base image changes.
    Remediation: Wrap both loops in length checks matching the existing pattern: if [ ${#USER_IDS[@]} -ne 0 ]; then ... fi.

Low

  • [test-adequacy] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — No functional tests included. The task directory has no tests/ subdirectory, so CI will not run test gates for this task. The task has non-trivial logic (path traversal checks, submodule diffing, argument parsing) that would benefit from test coverage.

  • [edge-case] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:183 — The argument parser uses ! [[ "$1" =~ ^-- ]] to detect flag boundaries. Values starting with -- would be misinterpreted as flags, though this is unlikely for Slack IDs or typical filenames.

  • [injection] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:283 — The webhook URL is written to a curl config file with double-quote delimiters (printf 'url = "%s"\n'). A URL containing a literal double-quote could break out and inject curl config directives. Risk is very low since the URL comes from an administrator-controlled Kubernetes Secret.

  • [missing-authorization] — Non-trivial change (367 lines, new task with embedded bash) has no linked issue and no PR description. Consider creating an issue to document the migration rationale.

  • [scope-traceability] — PR title claims to "Move slack-webhook-notification task from build-definitions" but provides no reference to the source repository or original implementation.

  • [directory-structure-inconsistency] tasks/slack-webhook-notification/0.1/ — Task placed without a category subdirectory. CLAUDE.md documents tasks/<category>/<name>/<version>/ but the repository shows mixed usage (both patterns are established).

  • [documentation-style] tasks/slack-webhook-notification/0.1/README.md:1 — README title uses lowercase (# slack-webhook-notification task). Established codebase convention uses title case (e.g., "ShellCheck Task", "Hadolint Task").

  • [documentation-completeness] tasks/slack-webhook-notification/0.1/README.md:55 — README is missing the closing "### Suitable for upstream communities" section present in all other task READMEs in this repository.

Previous run (2)

Review

Findings

High

  • [error-handling] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:262 — The curl invocation uses || echo "Failed to send message to Slack" which swallows the curl failure. Under set -o errexit, the || echo short-circuits the error: if curl fails, the echo succeeds, and the script exits 0. The task reports SUCCESS even when the Slack message was never delivered — a significant logic error for a notification task.
    Remediation: Remove the || echo ... suffix so curl failures propagate as task failures.

  • [error-handling] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:120 — In dumpSubmodule, the command previous_commit=$(git diff HEAD~1 "${path}" | grep commit | head -n 1 | awk '{print $3;}') will abort the script when grep finds no matches. With set -o errexit -o pipefail, grep returning exit code 1 makes the pipeline non-zero, triggering immediate abort. The fallback if [ "${previous_commit}" = "" ] is dead code — never reached when grep produces no output. Any newly-added submodule or single-commit repo will crash the entire task.
    Remediation: Append || true to the grep pipeline.

Medium

  • [fragile-parsing] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:120 — The grep commit pattern is overly broad, matching any line containing "commit" rather than just submodule diff headers (Subproject commit <sha>). Could produce incorrect commit ranges if diff output contains "commit" in other contexts.
    Remediation: Use grep '^-Subproject commit ' to match only the removed submodule commit line.

  • [path-traversal] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:97 — The dumpFile function passes user-supplied file paths directly to cat without validation. A path with ../ sequences could read files outside the workspace (e.g., /etc/secrets/webhook-url), and the content would be sent to the Slack webhook.
    Remediation: Validate file paths do not escape the workspace root. Reject paths containing .. or starting with /.

Low

  • [test-adequacy] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — No tests/ directory for this new task, so it will not be covered by the CI test gate.

  • [command-injection] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:106 — The previous_commit variable in dumpSubmodule is extracted from git diff output via awk and used unvalidated in a git log range expression.

  • [secrets-handling] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:262 — The webhook URL is passed as a command-line argument to curl, making it visible in /proc/<pid>/cmdline.

  • [missing-authorization] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — Non-trivial change with no linked issue explaining the migration decision from build-definitions.

  • [scope-boundary-violation] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — Consider whether a generic notification utility aligns with the repo's documented purpose of integration testing infrastructure.

  • [missing-category] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — Task placed at tasks/slack-webhook-notification/ without a category parent directory, though this follows a pattern used by several other tasks.

  • [upstream-usable-justification] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — Task is labeled upstream-usable: "true" but the submodules/files features have undocumented prerequisites.

  • [readme-format-inconsistency] tasks/slack-webhook-notification/0.1/README.md:1 — README lacks version info and uses lowercase heading, differing from other task READMEs.

  • [readme-structure] tasks/slack-webhook-notification/0.1/README.md — README missing Usage and Results sections found in other task READMEs.

  • [naming-convention] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:29 — Parameter description says "Key in the key in secret" — appears to be a typo (should be "Key in the secret").


Labels: PR introduces a path traversal vulnerability in the dumpFile function that could leak mounted secrets via Slack webhook


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (3)

Review

Findings

Medium

  • [error-handling] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:260 — The final curl command uses || echo "Failed to send message to Slack" which swallows the curl failure. With set -o errexit, the || prevents the non-zero exit from curl --fail from propagating. The task will report success even when the Slack notification was not delivered, making delivery failures invisible to pipeline operators.
    Remediation: Remove the || echo fallback so the task fails when the webhook call fails, or capture and emit the failure status as a task result.

  • [bash-function-naming] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — Bash functions use camelCase (dumpFile, dumpSubmodule, dumpSeparator) instead of the snake_case convention used consistently across existing tasks in this repo (config_aws_creds, print_debug_info, wait_for, mask_credential, etc.).
    Remediation: Rename to snake_case: dump_file, dump_submodule, dump_separator.

Low

  • [missing-authorization] — Non-trivial change (283 lines) with no linked issue and empty PR body. The PR title indicates a migration from build-definitions but provides no rationale or cross-repo coordination details.
    Remediation: Add a PR description explaining the migration rationale.

  • [edge-case] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:134 — In dumpSubmodule, git diff HEAD~1 will fail if the repository has only one commit. With errexit and pipefail active, this aborts the entire script.
    Remediation: Guard with git rev-parse --verify HEAD~1.

  • [defense-in-depth] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:96dumpFile reads file paths from the files parameter without validating they are within the workspace directory.
    Remediation: Validate paths are relative and resolve with realpath to confirm containment.

  • [fragile-parsing] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:136git diff HEAD~1 "${path}" | grep commit uses a loose pattern that could match unrelated lines containing the word "commit".
    Remediation: Use grep '^-Subproject commit' for precision.


Labels: PR adds a new Tekton task to the catalog


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (4)

Review

Findings

High

  • [error-handling] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:81 — The script does not include set -o errexit -o nounset -o pipefail. Without these, failures in intermediate commands (e.g., git config, cat, curl) are silently ignored and the task reports success. This also violates the project's security conventions documented in CLAUDE.md.
    Remediation: Add set -o errexit -o nounset -o pipefail immediately after the shebang line.

  • [error-handling] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:247curl is invoked without --fail, so HTTP error responses (4xx, 5xx) from the Slack API are silently swallowed — curl returns exit code 0 for HTTP-level errors by default. Even with set -e, the task would still report success when Slack rejects the webhook payload.
    Remediation: Use curl --fail --silent --show-error -X POST -H 'Content-type: application/json' --data "${data}" "$WEBHOOK_URL".

Medium

  • [edge-case] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:249 — The workingDir is set to $(workspaces.source.path)/source, but the source workspace is declared as optional: true. When the workspace is not bound, Tekton cannot resolve $(workspaces.source.path) and the step will fail to start, making the task unusable for the simple message-only case.
    Remediation: Either remove workingDir, make the workspace non-optional, or guard workspace usage with $(workspaces.source.bound).

  • [logic-error] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — The argument-parsing while/case loop has no default (*) case. If an unrecognized argument is encountered, $1 is never consumed and the loop runs forever, hanging the task pod.
    Remediation: Add a default case: *) shift ;;.

  • [missing-tests] tasks/slack-webhook-notification/0.1 — The task has no tests/ directory. Per CLAUDE.md, adding functional tests is part of the task addition process.
    Remediation: Add a tests/ directory with at least one positive test.

Low

  • [logic-error] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — In dumpSubmodule, bare grep commit could match unintended lines. Use grep '^Subproject commit ' for precision.

  • [edge-case] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yamlgit diff HEAD~1 will fail if the repository has only one commit. If set -e is added, this needs a guard.

  • [path-traversal] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:168KEY_NAME is used unsanitized in a file path. Pipeline-author-controlled input limits practical risk, but defense-in-depth validation is recommended.

  • [path-traversal] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — The files parameter accepts arbitrary file paths. Pipeline-author-controlled, but workspace-boundary validation is recommended.

  • [privilege-escalation] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml:63 — The step runs as root (runAsUser: 0). Notification tasks do not require root privileges.

  • [scope-clarity] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — Empty PR body provides no migration context or rationale.

  • [documentation-consistency] tasks/slack-webhook-notification/0.1/README.md — README structure is minimal; consider adding Description and Usage sections.

  • [documentation-accuracy] tasks/slack-webhook-notification/0.1/README.md:21 — Workspace description is copy-pasted from another task and inaccurate for a notification task.

  • [architectural-misalignment] tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml — The task-runner:2.0.0 image is not documented in CLAUDE.md's Key Images table.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@flacatus

flacatus commented Aug 3, 2026

Copy link
Copy Markdown
Member

can we solve the bots comments?

@slimreaper35
slimreaper35 force-pushed the slack-webhook-notification branch from b919a9a to 3e5406e Compare August 3, 2026 13:28
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 3, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 1:29 PM UTC · Ended 1:40 PM UTC
Commit: 701e62a · View workflow run →

@qodo-app-for-konflux-ci

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 3e5406e

@slimreaper35
slimreaper35 force-pushed the slack-webhook-notification branch from 3e5406e to f226b3b Compare August 3, 2026 13:39
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 3, 2026

Copy link
Copy Markdown

🤖 Review · ❌ Terminated · Started 1:40 PM UTC · Ended 1:56 PM UTC
Commit: 701e62a · View workflow run →

@qodo-app-for-konflux-ci

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit f226b3b

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the enhancement New feature or request label Aug 3, 2026
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:40 PM UTC · Completed 1:55 PM UTC
Commit: 701e62a · View workflow run →

@slimreaper35
slimreaper35 force-pushed the slack-webhook-notification branch from f226b3b to e7b8f08 Compare August 3, 2026 14:11
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 3, 2026

Copy link
Copy Markdown

🤖 Review · ❌ Terminated · Started 2:12 PM UTC · Ended 2:30 PM UTC
Commit: 701e62a · View workflow run →

@qodo-app-for-konflux-ci

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit e7b8f08

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:12 PM UTC · Completed 2:30 PM UTC
Commit: 701e62a · View workflow run →

@slimreaper35

Copy link
Copy Markdown
Member Author

can we solve the bots comments?

Fixed the first wave of comments. Here it is another one :)

@slimreaper35
slimreaper35 force-pushed the slack-webhook-notification branch from e7b8f08 to 49bb680 Compare August 6, 2026 08:35
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 6, 2026

Copy link
Copy Markdown

🤖 Review · ❌ Terminated · Started 8:36 AM UTC · Ended 8:52 AM UTC
Commit: 701e62a · View workflow run →

@qodo-app-for-konflux-ci

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 49bb680

@fullsend-ai-review
fullsend-ai-review Bot dismissed stale reviews from themself August 6, 2026 08:52

Superseded by updated review

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Aug 6, 2026
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:36 AM UTC · Completed 8:52 AM UTC
Commit: 701e62a · View workflow run →

@slimreaper35
slimreaper35 force-pushed the slack-webhook-notification branch from 49bb680 to 7403ad4 Compare August 6, 2026 09:02
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 6, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 9:03 AM UTC · Ended 9:10 AM UTC
Commit: 701e62a · View workflow run →

@qodo-app-for-konflux-ci

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7403ad4

@slimreaper35
slimreaper35 force-pushed the slack-webhook-notification branch from 7403ad4 to 3a4b4d7 Compare August 6, 2026 09:10
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 6, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 9:12 AM UTC · Ended 9:24 AM UTC
Commit: 701e62a · View workflow run →

@qodo-app-for-konflux-ci

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 3a4b4d7

The task is "owned" by build-maintainers in the build-definitions repo.
However, it is not used in the build pipelines. Transfer the ownership
to tekton-integration-catalog repo.

No change in the task or script.

```
diff -r tasks/slack-webhook-notification .../build-definitions/task/slack-webhook-notification
```

--
https://github.com/konflux-ci/build-definitions/tree/main/task/slack-webhook-notification/0.1
https://github.com/konflux-ci/build-definitions/tree/main/task/slack-webhook-notification-oci-ta/0.1
https://redhat.atlassian.net/browse/STONEBLD-4938

Signed-off-by: Michal Šoltis <msoltis@redhat.com>
Fix various issues that have been discovered during the review process
including outdated descriptions, better validation of parameters, YAML
indentation, no root, consistency with other tasks in the repo...

Signed-off-by: Michal Šoltis <msoltis@redhat.com>
@slimreaper35
slimreaper35 force-pushed the slack-webhook-notification branch from 3a4b4d7 to 51a0c50 Compare August 6, 2026 09:23
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 6, 2026

Copy link
Copy Markdown

🤖 Review · ❌ Terminated · Started 9:25 AM UTC · Ended 9:41 AM UTC
Commit: 701e62a · View workflow run →

@qodo-app-for-konflux-ci

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 51a0c50

@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:25 AM UTC · Completed 9:41 AM UTC
Commit: 701e62a · View workflow run →

@flacatus
flacatus merged commit b6cf15f into konflux-ci:main Aug 10, 2026
9 checks passed
@slimreaper35
slimreaper35 deleted the slack-webhook-notification branch August 10, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Possible security concern requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants