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
4 changes: 3 additions & 1 deletion scripts/konflux_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# Packages from pypi.org go to requirements.source.txt
# Packages from console.redhat.com go to requirements.wheel.txt

set -x

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

head -20 scripts/konflux_requirements.sh && echo "---" && sed -n '85,100p' scripts/konflux_requirements.sh

Repository: lightspeed-core/lightspeed-stack

Length of output: 1312


🏁 Script executed:

wc -l scripts/konflux_requirements.sh && cat -n scripts/konflux_requirements.sh

Repository: lightspeed-core/lightspeed-stack

Length of output: 4965


Add set -e to halt on command failures.

Line 7 enables set -x for tracing but the script lacks set -e. If any of the uv pip compile, sed, or uv run pybuild-deps commands fail, the script continues and prints Done! while leaving incomplete hash files or corrupted Tekton YAML files.

Suggested change
-set -x
+set -e
+set -x
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
set -x
set -e
set -x
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/konflux_requirements.sh` at line 7, The script currently enables
tracing with the existing set -x but doesn't stop on failures; add error-halting
by enabling set -e alongside set -x (e.g., change/replace the existing set -x
line to set -e -x or use set -euxo pipefail) so that any failing command (uv pip
compile, sed, uv run pybuild-deps, etc.) aborts the script instead of continuing
to "Done!" and producing partial/corrupt outputs.


RAW_REQ_FILE="requirements.no_hashes.txt"
SOURCE_FILE="requirements.source.txt"
WHEEL_FILE="requirements.wheel.txt"
Expand Down Expand Up @@ -87,4 +89,4 @@ echo "Done!"
echo "Packages from pypi.org written to: $SOURCE_HASH_FILE ($(wc -l < "$SOURCE_HASH_FILE") packages)"
echo "Packages from console.redhat.com written to: $WHEEL_HASH_FILE ($(wc -l < "$WHEEL_HASH_FILE") packages)"
echo "Build dependencies written to: $BUILD_FILE ($(wc -l < "$BUILD_FILE") packages)"
echo "Remember to commit $SOURCE_HASH_FILE, $WHEEL_HASH_FILE, $BUILD_FILE, pipeline configurations and push the changes"
echo "Remember to commit $SOURCE_HASH_FILE, $WHEEL_HASH_FILE, $BUILD_FILE, pipeline configurations and push the changes"
Loading