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
31 changes: 31 additions & 0 deletions hack/openstack-job-audit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#
# Audits CI configuration files to find OpenStack e2e test jobs and reports
# their run_if_changed and skip_if_only_changed settings.
#
# Usage: ./openstack-job-audit.sh <config_base_path> [output_file]
# config_base_path: Path to ci-operator/config directory
# output_file: Output file path (default: ./report.yaml)
#
# Example: ./openstack-job-audit.sh ci-operator/config ./report.yaml

config_base_path=$1
output_file=${2:-./report.yaml}

true > "$output_file"

grep -RlE 'cluster_profile:.*vexxhost.*' "$config_base_path" | rev | awk -F '/' '{print $2 "/" $3}' | rev | sort -u | while read -r project; do
echo "$project:" >> "$output_file"

grep -RlE 'cluster_profile:.*vexxhost.*' "$config_base_path/$project/" | sort -u | while read -r file; do
yq -r "
\" - \(filename):\" ,
(.tests[]
| select(.steps.cluster_profile | match(\".*vexxhost.*\"))
| \" - \" + .as + \":\" +
\"\n run_if_changed: \" + (.run_if_changed // \"null\") +
\"\n skip_if_only_changed: \" + (.skip_if_only_changed // \"null\")
)
" "$file" >> "$output_file"
done
done