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
@@ -0,0 +1,40 @@
base_images:
base:
name: "4.22"
namespace: ocp
tag: base
ocp_builder_rhel-9-golang-1.25-openshift-4.22:
name: builder
namespace: ocp
tag: rhel-9-golang-1.25-openshift-4.22
build_root:
image_stream_tag:
name: builder
namespace: ocp
tag: rhel-9-golang-1.25-openshift-4.22
resources:
'*':
limits:
memory: 4Gi
requests:
cpu: 100m
memory: 200Mi
tests:
- as: build
steps:
test:
- as: test
commands: |
git clone --branch master --single-branch https://github.com/openshift/promu.git openshift-promu
cd openshift-promu/
GOBIN=/go/src/github.com/openshift/prometheus-community-windows_exporter go install .
cd /go/src/github.com/openshift/prometheus-community-windows_exporter
GOOS=windows ./promu build -v
Comment on lines +28 to +32
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 -euo pipefail

echo "Default branch ref:"
git ls-remote --symref https://github.com/openshift/promu.git HEAD

echo
echo "Existing branch refs (master/main):"
git ls-remote --heads https://github.com/openshift/promu.git master main || true

echo
echo "Recent tags to choose a pinned version from:"
git ls-remote --tags https://github.com/openshift/promu.git | tail -n 20

Repository: openshift/release

Length of output: 1069


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check if the file exists
FILE="ci-operator/config/openshift/prometheus-community-windows_exporter/openshift-prometheus-community-windows_exporter-release-4.22.yaml"
if [ -f "$FILE" ]; then
  echo "File exists. Extracting lines 25-35 for context:"
  sed -n '25,35p' "$FILE" | cat -n
  echo
  echo "Full file for complete context:"
  cat -n "$FILE"
else
  echo "File does not exist at: $FILE"
  echo "Listing available CI configs in the directory:"
  find ci-operator/config/openshift -name "*prometheus*windows*" -o -name "*windows_exporter*" 2>/dev/null | head -20
fi

Repository: openshift/release

Length of output: 1941


Pin openshift/promu to an immutable revision.

Line 28 clones master, which makes this job non-reproducible and can break when upstream changes. Pin to a tag or commit SHA (stable versions v0.1.0 through v0.6.1 are available).

Suggested change
-        git clone --branch master --single-branch https://github.com/openshift/promu.git openshift-promu
-        cd openshift-promu/
-        GOBIN=/go/src/github.com/openshift/prometheus-community-windows_exporter go install .
-        cd /go/src/github.com/openshift/prometheus-community-windows_exporter
+        GOBIN=/go/src/github.com/openshift/prometheus-community-windows_exporter \
+          go install github.com/openshift/promu@<tag-or-commit-sha>
+        cd /go/src/github.com/openshift/prometheus-community-windows_exporter
         GOOS=windows ./promu build -v
🤖 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/config/openshift/prometheus-community-windows_exporter/openshift-prometheus-community-windows_exporter-release-4.22.yaml`
around lines 28 - 32, The job currently clones openshift/promu using "git clone
--branch master" which is non-reproducible; change the git clone command to pin
a specific immutable revision (a tag or commit SHA) instead of master (replace
the "git clone --branch master https://github.com/openshift/promu.git
openshift-promu" line), then continue to install and run promu as before (the
subsequent commands
GOBIN=/go/src/github.com/openshift/prometheus-community-windows_exporter go
install . and GOOS=windows ./promu build -v remain unchanged) so the build uses
a known stable promu version.

from: src
resources:
requests:
cpu: 100m
zz_generated_metadata:
branch: release-4.22
org: openshift
repo: prometheus-community-windows_exporter