Skip to content

chore(lightspeed): update lightspeed sync workflow to handle release branch#397

Open
Jdubrick wants to merge 1 commit into
redhat-developer:mainfrom
Jdubrick:update-lightspeed-workflow
Open

chore(lightspeed): update lightspeed sync workflow to handle release branch#397
Jdubrick wants to merge 1 commit into
redhat-developer:mainfrom
Jdubrick:update-lightspeed-workflow

Conversation

@Jdubrick
Copy link
Copy Markdown

@Jdubrick Jdubrick commented May 14, 2026

Description of the change

  • Adds handling so the sync scripts target main and release branch, syncing with the proper branch from lightspeed-configs

Which issue(s) does this PR fix or relate to

N/A

How to test changes / Special notes to the reviewer

Checklist

  • For each Chart updated, version bumped in the corresponding Chart.yaml according to Semantic Versioning.
  • For each Chart updated, variables are documented in the values.yaml and added to the corresponding README.md. The pre-commit utility can be used to generate the necessary content. Run pre-commit run --all-files to run the hooks and then push any resulting changes. The pre-commit Workflow will enforce this and warn you if needed.
  • JSON Schema template updated and re-generated the raw schema via the pre-commit hook.
  • Tests pass using the Chart Testing tool and the ct lint command.
  • If you updated the orchestrator-infra chart, make sure the versions of the Knative CRDs are aligned with the versions of the CRDs installed by the OpenShift Serverless operators declared in the values.yaml file. See Installing Knative Eventing and Knative Serving CRDs for more details.

…branch

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@Jdubrick Jdubrick requested a review from a team as a code owner May 14, 2026 20:13
@rhdh-qodo-merge
Copy link
Copy Markdown

rhdh-qodo-merge Bot commented May 14, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0)

Grey Divider


Remediation recommended

1. Release branches not synced 🐞 Bug ≡ Correctness
Description
The sync matrix only targets main and release-1.10, so other release branches that the repo
still runs in nightly tests (release-1.9 and release-1.8) will not get automated Lightspeed config
sync PRs. This increases the likelihood those maintained branches drift from the upstream Lightspeed
config source.
Code

.github/workflows/sync-lightspeed-configs.yaml[R15-19]

+      matrix:
+        branch:
+          - main
+          - release-1.10
+
Relevance

⭐⭐⭐ High

Repo recently expanded workflows to cover supported release branches (release-1.9/1.8); missing them
likely flagged.

PR-#346

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The sync workflow’s matrix hard-codes only main and release-1.10, while the nightly test
workflow’s matrix still includes release-1.9 and release-1.8, demonstrating there are additional
active release branches not covered by the sync workflow.

.github/workflows/sync-lightspeed-configs.yaml[13-19]
.github/workflows/nightly.yaml[14-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`sync-lightspeed-configs.yaml` only syncs Lightspeed configs for `main` and `release-1.10`, but `nightly.yaml` indicates `release-1.9` and `release-1.8` are still active/tested branches. As a result, those release branches will not receive automated Lightspeed config sync PRs.

## Issue Context
The repo already maintains a branch list elsewhere for nightly testing; this workflow introduces a separate hard-coded list.

## Fix Focus Areas
- .github/workflows/sync-lightspeed-configs.yaml[13-19]
- .github/workflows/nightly.yaml[14-24]

### Suggested fix approach
- Decide the authoritative set of maintained branches (e.g., match `nightly.yaml`).
- Update the sync matrix to include the same maintained release branches, or centralize the branch list (e.g., reusable workflow or a single workflow input/variable used by both).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

2. Dispatch always fans out 🐞 Bug ☼ Reliability
Description
Because the job uses a fixed branch matrix, a workflow_dispatch run will always execute for both
main and release-1.10 and can create/force-push PRs to both base branches. There is no dispatch
input/guard to limit the run to a single target branch.
Code

.github/workflows/sync-lightspeed-configs.yaml[R13-19]

+    strategy:
+      fail-fast: false
+      matrix:
+        branch:
+          - main
+          - release-1.10
+
Relevance

⭐ Low

Team already merged workflow_dispatch + static branch matrix fan-out in nightly workflow (no branch
guard).

PR-#346

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The workflow defines workflow_dispatch and also defines a static matrix of two branches; GitHub
Actions will fan out the job across all matrix entries for both scheduled and manually dispatched
runs.

.github/workflows/sync-lightspeed-configs.yaml[3-23]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workflow supports `workflow_dispatch`, but the added fixed `strategy.matrix.branch` means a manual run will always execute for *all* matrix branches (currently `main` and `release-1.10`). This can unintentionally create/update multiple PRs when an operator wants to sync just one branch.

## Issue Context
This behavior is introduced by adding a matrix without any conditional narrowing for `workflow_dispatch`.

## Fix Focus Areas
- .github/workflows/sync-lightspeed-configs.yaml[3-23]

### Suggested fix approach
- Add `workflow_dispatch` inputs (e.g., `target_branch` with choices `main`, `release-1.10`, `all`).
- Build the matrix dynamically:
 - If `inputs.target_branch == 'all'` (or on `schedule`), include both.
 - Otherwise include only the selected branch.
- Optionally add a guard to prevent accidental multi-branch dispatch (e.g., require explicit `all`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@Jdubrick Jdubrick changed the title chore(lightspeed): update lightspeed sync workflow to handle release … chore(lightspeed): update lightspeed sync workflow to handle release branch May 14, 2026
@sonarqubecloud
Copy link
Copy Markdown

@Jdubrick
Copy link
Copy Markdown
Author

/cc @rm3l

@openshift-ci openshift-ci Bot requested a review from rm3l May 14, 2026 20:13
@rhdh-qodo-merge
Copy link
Copy Markdown

Review Summary by Qodo

Add multi-branch support to Lightspeed sync workflow

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Adds matrix strategy to sync Lightspeed configs for multiple branches
• Moves concurrency configuration to job level with branch-specific grouping
• Updates checkout step to use matrix branch reference
• Passes branch parameter to sync script and PR creation logic
• Includes target branch in PR body and branch naming for clarity
Diagram
flowchart LR
  A["Workflow Trigger"] --> B["Matrix Strategy<br/>main + release-1.10"]
  B --> C["Checkout Branch<br/>ref: matrix.branch"]
  C --> D["Run Sync Script<br/>--ref matrix.branch"]
  D --> E["Create/Update PR<br/>base: matrix.branch"]
  E --> F["PR with Branch Info<br/>in Title & Body"]
Loading

Grey Divider

File Changes

1. .github/workflows/sync-lightspeed-configs.yaml ✨ Enhancement +19/-10

Multi-branch Lightspeed sync workflow with matrix strategy

• Removed workflow-level concurrency and added job-level concurrency with matrix branch grouping
• Added matrix strategy to run sync for both main and release-1.10 branches
• Updated checkout step to reference the matrix branch via ref: ${{ matrix.branch }}
• Modified sync script invocation to pass --ref ${{ matrix.branch }} parameter
• Updated PR creation logic to use TARGET_BRANCH environment variable for base branch and branch
 naming
• Enhanced PR body to include target branch reference in the lightspeed-configs repository link

.github/workflows/sync-lightspeed-configs.yaml


Grey Divider

Qodo Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant