Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -300,23 +300,25 @@ cp *.csv *.xml *.json *.txt *.html "${ARTIFACT_DIR}/" 2>/dev/null || true

# Experimental: run orion with original e-divisive binary (safe block, never breaks main execution)
(
EXP_DIR="${ARTIFACT_DIR}/orion-original-edivisive"
EXP_DIR="/tmp/orion-original-edivisive"
mkdir -p "$EXP_DIR"
EXP_BINARY="/tmp/orion-original-edivisive"
pushd "$EXP_DIR"
git clone -q --branch orig-edivisive-exp $ORION_REPO --depth 1
pushd orion
pip install -q -r requirements.txt
pip install -q .

echo "Downloading experimental orion binary..."
if ! curl -fsSL "https://github.com/cloud-bulldozer/orion/releases/download/orig-edivisive-exp/orion-amd64" -o "$EXP_BINARY"; then
echo "Failed to download experimental orion binary, skipping."
exit 0
fi
chmod +x "$EXP_BINARY"

echo "Running experimental orion (original e-divisive)..."
"$EXP_BINARY" --node-count ${IGNORE_JOB_ITERATIONS} --config ${ORION_CONFIG} ${EXTRA_FLAGS} --viz | tee "$EXP_DIR/${FILENAME}.txt" || true
# Strip JIRA flags for experimental run
EXTRA_FLAGS_NO_JIRA="${EXTRA_FLAGS//" --jira-ack --jira-auto-create"/}"
orion --node-count ${IGNORE_JOB_ITERATIONS} --config ${ORION_CONFIG} ${EXTRA_FLAGS_NO_JIRA} --viz | tee orion-exp-output.txt || true

# Copy all results except .xml files into the experimental artifacts subdirectory
cp *.csv *.json *.txt *.html "$EXP_DIR/" 2>/dev/null || true

mkdir -p "$ARTIFACT_DIR/orion-original-edivisive"
cp *.csv *.json *.txt *.html "$ARTIFACT_DIR/orion-original-edivisive/" 2>/dev/null || true
Comment on lines 317 to +319
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 | 🟡 Minor | ⚡ Quick win

This artifact glob also copies checked-in repo files.

Line 319 runs from the cloned repo root, so *.txt will include requirements.txt, and any checked-in *.json/*.html files will be copied into the experimental artifact directory as if they were Orion outputs. Narrow this to the actual generated filenames or stage generated artifacts in a dedicated directory first.

🧰 Tools
🪛 Shellcheck (0.11.0)

[info] 319-319: Use ./glob or -- glob so names with dashes won't become options.

(SC2035)


[info] 319-319: Use ./glob or -- glob so names with dashes won't become options.

(SC2035)


[info] 319-319: Use ./glob or -- glob so names with dashes won't become options.

(SC2035)


[info] 319-319: Use ./glob or -- glob so names with dashes won't become options.

(SC2035)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh`
around lines 317 - 319, The current cp command in the orion script (creating
"$ARTIFACT_DIR/orion-original-edivisive" and running cp *.csv *.json *.txt
*.html "$ARTIFACT_DIR/orion-original-edivisive/") can pick up checked-in files;
instead, restrict the source to the actual generated artifacts or stage outputs
first: update the script to collect generated files into a dedicated output
directory (e.g., a temp build dir) or change the glob to the concrete generated
filenames/prefixes produced by the Orion steps, then copy only from that
directory into "$ARTIFACT_DIR/orion-original-edivisive/"; reference the mkdir -p
line, the cp invocation, and the "$ARTIFACT_DIR/orion-original-edivisive" target
when making the change.

popd
Comment on lines +303 to +320
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 | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
(
  false
  echo "subshell continued past failure"
) || echo "outer caught failure"

Repository: openshift/release

Length of output: 93


🏁 Script executed:

fd -t f "openshift-qe-orion-commands.sh"

Repository: openshift/release

Length of output: 137


🏁 Script executed:

wc -l ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh

Repository: openshift/release

Length of output: 141


🏁 Script executed:

sed -n '290,330p' ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh

Repository: openshift/release

Length of output: 1488


🏁 Script executed:

sed -n '1,50p' ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh

Repository: openshift/release

Length of output: 1698


🏁 Script executed:

grep -n "EXTRA_FLAGS" ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh | head -20

Repository: openshift/release

Length of output: 966


🏁 Script executed:

sed -n '200,205p' ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh

Repository: openshift/release

Length of output: 245


🏁 Script executed:

sed -n '303,325p' ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh | cat -n

Repository: openshift/release

Length of output: 1170


🏁 Script executed:

sed -n '1,5p' ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh

Repository: openshift/release

Length of output: 125


Commands in the experimental clone/install block can fail without failing the outer shell.

Because the subshell (lines 303–321) sits on the left-hand side of ||, set -e is suppressed for its body. A failed git clone or pip install will not cause the subshell to exit, allowing execution to continue to the later echo and masking the failure as success.

Move the set -e inside the subshell and capture the exit status to properly detect failures:

Suggested fix
-(
+set +e
+(
+    set -e
     EXP_DIR="/tmp/orion-original-edivisive"
     mkdir -p "$EXP_DIR"
     pushd "$EXP_DIR"
     git clone -q --branch orig-edivisive-exp $ORION_REPO --depth 1
     pushd orion
     pip install -q -r requirements.txt
     pip install -q .

     echo "Running experimental orion (original e-divisive)..."
     EXTRA_FLAGS_NO_JIRA="${EXTRA_FLAGS//" --jira-ack --jira-auto-create"/}"
     orion --node-count ${IGNORE_JOB_ITERATIONS} --config ${ORION_CONFIG} ${EXTRA_FLAGS_NO_JIRA} --viz | tee orion-exp-output.txt || true

     mkdir -p "$ARTIFACT_DIR/orion-original-edivisive"
     cp *.csv *.json *.txt *.html "$ARTIFACT_DIR/orion-original-edivisive/" 2>/dev/null || true
     popd
     popd
     echo "Experimental orion run complete."
-)
+)
+exp_orion_status=$?
+set -e
+if [[ $exp_orion_status -ne 0 ]]; then
+    echo "Experimental orion block failed, continuing."
+fi
🧰 Tools
🪛 Shellcheck (0.11.0)

[info] 306-306: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 315-315: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 315-315: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 315-315: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 319-319: Use ./glob or -- glob so names with dashes won't become options.

(SC2035)


[info] 319-319: Use ./glob or -- glob so names with dashes won't become options.

(SC2035)


[info] 319-319: Use ./glob or -- glob so names with dashes won't become options.

(SC2035)


[info] 319-319: Use ./glob or -- glob so names with dashes won't become options.

(SC2035)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci-operator/step-registry/openshift-qe/orion/openshift-qe-orion-commands.sh`
around lines 303 - 320, The experimental clone/install block using EXP_DIR and
commands like git clone --branch orig-edivisive-exp, pip install -r
requirements.txt / pip install ., and the orion invocation runs in a subshell
where failures are masked by the outer "||", so add set -e at the start of the
subshell (immediately after pushd "$EXP_DIR" or at the top of that group) so any
failing command (git clone, pip install, orion) will cause the subshell to exit,
then capture its exit status ($?) after the subshell completes and if non-zero
propagate/fail the outer script (e.g., exit with that status) to ensure failures
are detected and not silently ignored; ensure references to EXTRA_FLAGS_NO_JIRA
and ARTIFACT_DIR handling remain unchanged.

popd
echo "Experimental orion run complete."
) || echo "Experimental orion block failed, continuing."

Expand Down