Skip to content

Add CI validation for hook ordering prefixes#744

Open
abays wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
abays:validate_hook_order
Open

Add CI validation for hook ordering prefixes#744
abays wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
abays:validate_hook_order

Conversation

@abays
Copy link
Copy Markdown
Contributor

@abays abays commented Apr 17, 2026

CIFMW's run_hook module sorts hooks alphabetically by name before executing them. When a pre_stage_run or post_stage_run stage has two or more hooks, this alphabetical sorting can silently alter the intended execution order unless each hook name carries a zero-padded numeric prefix (e.g. "01 Install operator", "02 Create site").

Add .ci/validate-hook-ordering.py to enforce that:

  • Every hook in a multi-hook stage has a numeric prefix.
  • Prefixes are sequential with no gaps or duplicates.

Wire the script into the GitHub Actions workflow
(.github/workflows/automation-schema.yaml) by renaming the files_exist job to validate_automation and adding a step to run the new validator.

Co-author: Claude Opus 4.6

Depends-On: #745

@openshift-ci openshift-ci Bot requested review from fultonj and leifmadsen April 17, 2026 17:54
@abays abays force-pushed the validate_hook_order branch from ad31e37 to 7ee51cf Compare April 22, 2026 14:37
Copy link
Copy Markdown
Contributor

@fultonj fultonj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Andrew. This looks good. I was about to merge but wanted to point out something claude code discovered in case you want to add it first.

Comment thread .ci/validate-hook-ordering.py
The ci-framework's run_hook module sorts hooks alphabetically by name
before executing them. When a pre_stage_run or post_stage_run stage has
two or more hooks, this alphabetical sorting can silently alter the
intended execution order unless each hook name carries a zero-padded
numeric prefix (e.g. "01 Install operator", "02 Create site").

Add .ci/validate-hook-ordering.py to enforce that:
- Every hook in a multi-hook stage has a numeric prefix.
- Prefixes are sequential with no gaps or duplicates.

Wire the script into the GitHub Actions workflow
(.github/workflows/automation-schema.yaml) by renaming the files_exist
job to validate_automation and adding a step to run the new validator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@abays abays force-pushed the validate_hook_order branch from 7ee51cf to d7101e4 Compare April 22, 2026 21:32
Copy link
Copy Markdown
Contributor

@fultonj fultonj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@softwarefactory-project-zuul
Copy link
Copy Markdown
Contributor

Build succeeded (gate pipeline).
https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/85c65c987fdb4bd1b6a0344a419adbcf

✔️ noop SUCCESS in 0s

@softwarefactory-project-zuul
Copy link
Copy Markdown
Contributor

Pull request merge failed: Resource not accessible by integration, You may need to manually rebase your PR and retry.

@fultonj fultonj removed the request for review from leifmadsen April 23, 2026 13:32
@fultonj
Copy link
Copy Markdown
Contributor

fultonj commented Apr 24, 2026

/lgtm
/approve

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 24, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, fultonj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants