Skip to content

Commit bae9d33

Browse files
stuggiclaude
andcommitted
Convert feature_branch_repos to YAML with configurable options
Replace feature_branch_repos.txt with feature_branch_repos.yaml to allow per-repository configuration. Added skip_makefile_changes option to skip BRANCH variable updates in Makefile for specific repositories. Changes: - Create feature_branch_repos.yaml with structured repo configuration - Add skip_makefile_changes flag for prometheus-podman-exporter and sg-core - Update create-release-branch-v1.yml to read from YAML format - Skip Makefile BRANCH variable updates when skip_makefile_changes is true - Enhanced logging to indicate when Makefile changes are skipped - Remove old feature_branch_repos.txt file Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
1 parent 689dd45 commit bae9d33

3 files changed

Lines changed: 58 additions & 43 deletions

File tree

.github/workflows/create-release-branch-v1.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
# 'The name of the OpenStack K8s tag variable in the Makefile (for install_yamls).'
6262
OPENSTACK_K8S_TAG_VARIABLE: 'OPENSTACK_K8S_TAG'
6363
# 'The relative path to the file containing the list of repositories to process.'
64-
REPO_LIST_FILE: 'feature_branch_repos.txt'
64+
REPO_LIST_FILE: 'feature_branch_repos.yaml'
6565
# 'The branch to create the new branch from.'
6666
SOURCE_BRANCH: 'main'
6767
# 'Timeout for git operations (in seconds)'
@@ -315,8 +315,8 @@ jobs:
315315
exit 1
316316
fi
317317

318-
# Read repositories from file, filtering out empty lines and comments
319-
repos=$(grep -v '^#' "${REPO_LIST_FILE}" | grep -v '^[[:space:]]*$' | tr '\n' ' ')
318+
# Read repositories from YAML file
319+
repos=$(yq e '.repos[].name' "${REPO_LIST_FILE}" | tr '\n' ' ')
320320

321321
if [ -z "$repos" ]; then
322322
echo "No repositories found in '${REPO_LIST_FILE}'."
@@ -381,8 +381,11 @@ jobs:
381381
handle_repo_error "${repo_name}" "Failed to create new branch '${BRANCH_NAME}'" "$TEMP_DIR"
382382
fi
383383

384+
# Check if we should skip BRANCH variable changes for this repo
385+
skip_makefile_changes=$(yq e ".repos[] | select(.name == \"${repo_name}\") | .skip_makefile_changes // false" "${REPO_LIST_FILE}")
386+
384387
BRANCH_PUSHED=false
385-
if [ -f "Makefile" ]; then
388+
if [ -f "Makefile" ] && [ "$skip_makefile_changes" != "true" ]; then
386389
echo "Makefile found. Checking for variables to update on new branch..."
387390
if grep -qE "^${BRANCH_VARIABLE}\s*(\?=|=)" Makefile; then
388391
if ! sed -i -E "s/^(${BRANCH_VARIABLE}\s*(\?=|=)\s*).*/\1${BRANCH_NAME}/" Makefile; then
@@ -396,7 +399,7 @@ jobs:
396399
fi
397400
fi
398401
fi
399-
402+
400403
# Check if there are changes to commit and push
401404
if ! git diff --quiet -- Makefile; then
402405
# FAIL if commit and push fails
@@ -408,7 +411,11 @@ jobs:
408411
echo "No changes detected in Makefile."
409412
fi
410413
else
411-
echo "No Makefile found."
414+
if [ "$skip_makefile_changes" = "true" ]; then
415+
echo "Skipping Makefile changes for ${repo_name} (configured in ${REPO_LIST_FILE})."
416+
else
417+
echo "No Makefile found."
418+
fi
412419
fi
413420

414421
# Special handling for openstack-operator: update default_images.yaml

feature_branch_repos.txt

Lines changed: 0 additions & 37 deletions
This file was deleted.

feature_branch_repos.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Configuration for repositories to create feature branches in
2+
# Each repository can have the following options:
3+
# - name: (required) The repository name
4+
# - skip_makefile_changes: (optional) If true, skip updating BRANCH variable in Makefile
5+
#
6+
# Example:
7+
# - name: my-repo
8+
# skip_makefile_changes: true
9+
10+
repos:
11+
- name: architecture
12+
- name: barbican-operator
13+
- name: ci-framework
14+
- name: cinder-operator
15+
- name: data-plane-adoption
16+
- name: designate-operator
17+
- name: edpm-ansible
18+
- name: glance-operator
19+
- name: heat-operator
20+
- name: horizon-operator
21+
- name: infra-operator
22+
- name: install_yamls
23+
- name: ironic-operator
24+
- name: keystone-operator
25+
- name: lib-common
26+
- name: manila-operator
27+
- name: mariadb-operator
28+
- name: mysqld_exporter
29+
- name: neutron-operator
30+
- name: nova-operator
31+
- name: octavia-operator
32+
- name: openstack-baremetal-operator
33+
- name: openstack-must-gather
34+
- name: openstack-network-exporter
35+
- name: openstack-operator
36+
- name: ovn-operator
37+
- name: placement-operator
38+
- name: prometheus-podman-exporter
39+
skip_makefile_changes: true
40+
- name: sg-core
41+
skip_makefile_changes: true
42+
- name: swift-operator
43+
- name: telemetry-operator
44+
- name: test-operator
45+
- name: watcher-operator

0 commit comments

Comments
 (0)