Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/incluster-comp-pr-merged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,24 @@ jobs:
if: ${{ github.run_attempt == 1 }}
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
REQUIRED_TESTS_JSON: ${{ inputs.REQUIRED_TESTS }}
CORRELATION_ID: ${{ steps.dispatch-info.outputs.correlation_id }}
run: |
echo "Dispatching E2E tests with correlation_id: ${CORRELATION_ID}"
echo "Using test group: NODE_AGENT_E2E"

gh api "repos/armosec/shared-workflows/dispatches" \
-f event_type="e2e-test-trigger" \
-f "client_payload[correlation_id]=${{ steps.dispatch-info.outputs.correlation_id }}" \
-f "client_payload[correlation_id]=${CORRELATION_ID}" \
-f "client_payload[github_repository]=${GITHUB_REPOSITORY}" \
-f "client_payload[environment]=production" \
-f "client_payload[tests]=${REQUIRED_TESTS_JSON}" \
-f "client_payload[tests_groups]=NODE_AGENT_E2E" \
Comment on lines +193 to +201
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if REQUIRED_TESTS or TEST_NAMES is referenced elsewhere in the repository
echo "=== Checking for REQUIRED_TESTS usage ==="
rg -n "REQUIRED_TESTS" --type yaml

echo ""
echo "=== Checking for TEST_NAMES usage ==="
rg -n "TEST_NAMES" --type yaml

Repository: kubescape/node-agent

Length of output: 144


🏁 Script executed:

#!/bin/bash
# Read the workflow file to verify the lines mentioned in the review
echo "=== Checking workflow file structure ==="
wc -l .github/workflows/incluster-comp-pr-merged.yaml

echo ""
echo "=== Lines 36-39 (REQUIRED_TESTS input) ==="
sed -n '36,39p' .github/workflows/incluster-comp-pr-merged.yaml

echo ""
echo "=== Lines 69 (TEST_NAMES output) ==="
sed -n '69p' .github/workflows/incluster-comp-pr-merged.yaml

echo ""
echo "=== Lines 156-163 (export_tests_to_env step) ==="
sed -n '156,163p' .github/workflows/incluster-comp-pr-merged.yaml

echo ""
echo "=== Lines 191-201 (dispatch with correlation_id) ==="
sed -n '191,201p' .github/workflows/incluster-comp-pr-merged.yaml

Repository: kubescape/node-agent

Length of output: 1383


REQUIRED_TESTS input is declared as required but not used in the dispatch.

The workflow input REQUIRED_TESTS (lines 36-39) is marked as required and exported to TEST_NAMES (lines 156-163 and line 69), but the dispatch command hardcodes tests_groups=NODE_AGENT_E2E instead of using the input value.

If the hardcoded test group is intentional, remove the unused REQUIRED_TESTS input (or make it optional) and remove the export_tests_to_env step and TEST_NAMES output declaration. Otherwise, update the dispatch to use the input value.

🤖 Prompt for AI Agents
In @.github/workflows/incluster-comp-pr-merged.yaml around lines 193 - 201, The
workflow declares a required input REQUIRED_TESTS and exports it as TEST_NAMES
via the export_tests_to_env step, but the GH dispatch hardcodes
tests_groups=NODE_AGENT_E2E instead of using that input; either remove the
UNUSED input and its export/output (REQUIRED_TESTS, export_tests_to_env,
TEST_NAMES) if NODE_AGENT_E2E is intentional, or modify the dispatch payload to
use the exported/available variable (TEST_NAMES/REQUIRED_TESTS) for
client_payload[tests_groups] so the dispatch uses the declared tests input.

-f "client_payload[systests_branch]=${{ inputs.SYSTEM_TESTS_BRANCH }}" \
-f "client_payload[in_cluster_chart_branch]=${{ inputs.HELM_BRANCH }}" \
-f "client_payload[ks_branch]=release" \
-f "client_payload[charts_name]=kubescape-operator" \
-f "client_payload[charts_repo]=${GITHUB_REPOSITORY}"

echo "Dispatch completed"

- name: Find E2E workflow run
id: find-run
Expand Down