Skip to content

aws-account-operator: Add prek validation to PROW CI#78697

Open
BATMAN-JD wants to merge 1 commit intoopenshift:mainfrom
BATMAN-JD:aws-account-operator-prek-ci
Open

aws-account-operator: Add prek validation to PROW CI#78697
BATMAN-JD wants to merge 1 commit intoopenshift:mainfrom
BATMAN-JD:aws-account-operator-prek-ci

Conversation

@BATMAN-JD
Copy link
Copy Markdown
Contributor

@BATMAN-JD BATMAN-JD commented May 1, 2026

Add prek-based pre-commit validation to aws-account-operator CI pipeline.

Changes

  • Add prek-runner image that builds on top of aws-account-operator image
    • Installs git and prek from release pinned in .prek-version
  • Add prek test that runs hack/ci.sh (or falls back to prek run --all-files)
  • Configure test to skip for documentation-only changes

Dependencies

Testing

The prek test will run automatically in CI once this PR is merged and aws-account-operator has the prek infrastructure in place.

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Summary by CodeRabbit

  • Chores
    • Enhanced CI to add a dedicated runner image and streamline test execution for more reliable builds.
  • Tests
    • Added a new CI test step that prepares a workspace and executes the project's test script or a fallback test runner to ensure broader test coverage.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

Warning

Rate limit exceeded

@BATMAN-JD has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 12 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: a4408412-a112-448e-ba6d-631fb7520825

📥 Commits

Reviewing files that changed from the base of the PR and between 57fdc7e and 1f187c2.

⛔ Files ignored due to path filters (1)
  • ci-operator/jobs/openshift/aws-account-operator/openshift-aws-account-operator-master-presubmits.yaml is excluded by !ci-operator/jobs/**
📒 Files selected for processing (1)
  • ci-operator/config/openshift/aws-account-operator/openshift-aws-account-operator-master.yaml

Walkthrough

CI adds a prek-runner container image (based on aws-account-operator) with git, tar, and a downloaded prek binary (version from .prek-version, fallback v0.3.9), plus a new prek test step that prepares a git workspace and runs hack/ci.sh or prek run --all-files.

Changes

Cohort / File(s) Summary
CI Configuration
ci-operator/config/openshift/aws-account-operator/openshift-aws-account-operator-master.yaml
Add prek-runner image derived from aws-account-operator that installs git, tar, and a prek binary (reads .prek-version, falls back to v0.3.9); add as: prek test step that initializes a temporary git repo, conditionally executes hack/ci.sh if executable, otherwise runs prek run --all-files inside prek-runner.

Sequence Diagram(s)

sequenceDiagram
participant CI as CI Orchestrator
participant Image as prek-runner (container)
participant Repo as Temp Git Workspace
participant Remote as Prek Release Server

CI->>Image: Start container with mounted workspace
CI->>Repo: Create temp git repo, add files
Image->>Remote: Read .prek-version (or use v0.3.9) and download prek binary
Remote-->>Image: Return prek tarball
Image->>Image: Extract /usr/local/bin/prek
CI->>Image: If hack/ci.sh executable -> run it
alt hack/ci.sh not executable
CI->>Image: Run `prek run --all-files`
end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'aws-account-operator: Add prek validation to PROW CI' accurately and concisely summarizes the main change: adding prek-based pre-commit validation to the aws-account-operator CI pipeline in PROW.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR modifies CI configuration only, not Ginkgo test code. Test step identifiers in CI configuration are static and deterministic, not subject to Ginkgo naming check.
Test Structure And Quality ✅ Passed Custom check for Ginkgo test code quality is not applicable to CI configuration YAML files.
Microshift Test Compatibility ✅ Passed PR modifies only CI operator configuration to add a pre-commit validation step using prek. No Ginkgo e2e tests are introduced.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This pull request does not add any new Ginkgo e2e tests. The changes are limited to CI configuration in openshift-aws-account-operator-master.yaml, specifically adding a prek-runner container image and a prek validation test step. The prek test is a pre-commit validation/static code analysis tool, not a Ginkgo e2e test.
Topology-Aware Scheduling Compatibility ✅ Passed Pull request modifies only PROW CI test configuration without introducing deployment manifests, operator code, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed This PR modifies only CI configuration YAML files and does not contain any Go source code, OTE binary code, or test implementations.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not introduce any Ginkgo e2e tests. The changes are limited to CI/CD configuration that adds a prek-runner container image and a code validation test step.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 11 minutes and 12 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from AlexSmithGH and joshbranham May 1, 2026 17:09
@BATMAN-JD
Copy link
Copy Markdown
Contributor Author

/pj-rehearse

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@BATMAN-JD: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@geowa4
Copy link
Copy Markdown
Contributor

geowa4 commented May 1, 2026

/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 1, 2026
items:
- dockerfile_path: build/Dockerfile
to: aws-account-operator
- dockerfile_literal: |
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.

Why not just include all this in the boilerplate image so we don't need per-repo config to handle running this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is actually a really good point. Let me look into boilerplate.

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.

first goal is to show something that works and then generalize. if we can add to a central location and not break everyone, that works for me.

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.

Makes sense to me, just wanted to float the option to save some PRs and config drift possibilities.

@BATMAN-JD BATMAN-JD force-pushed the aws-account-operator-prek-ci branch from 0bed2e3 to a46038f Compare May 1, 2026 17:51
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label May 1, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 1, 2026

New changes are detected. LGTM label has been removed.

@BATMAN-JD
Copy link
Copy Markdown
Contributor Author

/retest

@BATMAN-JD BATMAN-JD force-pushed the aws-account-operator-prek-ci branch from a46038f to 0014018 Compare May 1, 2026 18:00
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 1, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BATMAN-JD, geowa4
Once this PR has been reviewed and has the lgtm label, please assign abyrne55 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@BATMAN-JD
Copy link
Copy Markdown
Contributor Author

/pj-rehearse

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@BATMAN-JD: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@BATMAN-JD BATMAN-JD force-pushed the aws-account-operator-prek-ci branch 2 times, most recently from 1bd0043 to 57fdc7e Compare May 1, 2026 19:16
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 8314f404-1651-42d6-a589-8d8841c75035

📥 Commits

Reviewing files that changed from the base of the PR and between 0014018 and 57fdc7e.

⛔ Files ignored due to path filters (1)
  • ci-operator/jobs/openshift/aws-account-operator/openshift-aws-account-operator-master-presubmits.yaml is excluded by !ci-operator/jobs/**
📒 Files selected for processing (1)
  • ci-operator/config/openshift/aws-account-operator/openshift-aws-account-operator-master.yaml

Comment on lines +13 to +16
RUN PREK_VERSION="$(tr -d '[:space:]' < .prek-version 2>/dev/null || true)" \
&& PREK_VERSION="${PREK_VERSION:-v0.3.9}" \
&& curl -fsSL "https://github.com/j178/prek/releases/download/${PREK_VERSION}/prek-x86_64-unknown-linux-gnu.tar.gz" \
| tar xzf - --strip-components=1 -C /usr/local/bin/ prek-x86_64-unknown-linux-gnu/prek
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

🧩 Analysis chain

🏁 Script executed:

# Read the target YAML file to see the full context
cat -n ci-operator/config/openshift/aws-account-operator/openshift-aws-account-operator-master.yaml | head -100

Repository: openshift/release

Length of output: 3483


🏁 Script executed:

# Check if .prek-version file exists in the repo
find . -name ".prek-version" -o -name "*prek*" | head -20

Repository: openshift/release

Length of output: 43


🏁 Script executed:

# Search for other mentions of prek in the codebase
rg -i "prek" --type yaml --type sh --type md

Repository: openshift/release

Length of output: 4240


🏁 Script executed:

# Check if .prek-version exists in the aws-account-operator repo
# The config references the repo at /go/src/github.com/openshift/aws-account-operator
# Since we're in openshift/release repo, let's search for any reference to aws-account-operator content
rg -i "\.prek-version" --type yaml --type sh

Repository: openshift/release

Length of output: 456


🏁 Script executed:

# Search for PR `#975` or similar references in the repo
rg "975|prek" --type md | head -30

Repository: openshift/release

Length of output: 357


🏁 Script executed:

# Check the prek project to understand if binary validation is expected
web_search
prek tool GitHub j178/prek releases binary verification

Repository: openshift/release

Length of output: 155


🌐 Web query:

j178/prek GitHub releases binary verification checksum

💡 Result:

For j178/prek GitHub releases, the project provides SHA-256 checksums for prebuilt release assets (published alongside the binaries as *.sha256 files). The releases page lists assets with their SHA-256 digests. Additionally, starting around the v0.3.x timeframe, prek’s release process includes GitHub Artifact Attestations that you can verify with the GitHub CLI (this provides provenance/integrity attestation for the downloaded artifacts). How to verify a downloaded release binary (checksum): 1) Download the matching binary asset from https://github.com/j178/prek/releases (for your version/OS/arch). 2) Download the corresponding checksum file (typically named like the asset but with the extension .sha256). 3) Verify the binary against the checksum in that .sha256 file. How to verify GitHub Artifact Attestations (provenance/integrity): gh attestation verify --repo j178/prek You can also verify with a downloaded attestation bundle: gh attestation verify --bundle

Citations:


🌐 Web query:

aws-account-operator pull request 975 prek

💡 Result:

No pull request #975 exists in the openshift/aws-account-operator repository or any closely related repositories. Searches across GitHub, general web, and specific queries for "aws-account-operator pull request 975" and variations including "prek" returned no matching results. The repository is active (last push 2026-03-31) with 1 open issue but no mention of PR 975. "Prek" may refer to a username, prefix, or internal term not publicly documented. The aws-account-operator manages pools of AWS accounts for OpenShift Hive.

Citations:


Download and verify the prek binary before extraction.

The code downloads a binary directly from GitHub without checksum or signature validation. The prek project provides SHA-256 checksums for releases—these should be downloaded and verified before extracting. Additionally, the || true fallback to v0.3.9 when .prek-version is absent silently masks version drift and makes it difficult to detect when an unexpected prek version is being used.

Validate the release asset checksum (or use GitHub attestations) and consider requiring .prek-version to be present for reproducible builds.

@BATMAN-JD
Copy link
Copy Markdown
Contributor Author

/pj-rehearse

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@BATMAN-JD: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

Add prek-based pre-commit validation to aws-account-operator CI pipeline.

Changes:
- Add prek-runner image that builds on top of aws-account-operator image
- Install git and prek from release pinned in .prek-version
- Add prek test that runs hack/ci.sh (or falls back to prek run --all-files)
- Configure test to skip for documentation-only changes

Depends on aws-account-operator PR openshift#975 being merged first.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@BATMAN-JD BATMAN-JD force-pushed the aws-account-operator-prek-ci branch from 57fdc7e to 1f187c2 Compare May 1, 2026 20:05
@BATMAN-JD
Copy link
Copy Markdown
Contributor Author

/pj-rehearse

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@BATMAN-JD: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@BATMAN-JD: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
pull-ci-openshift-aws-account-operator-master-prek openshift/aws-account-operator presubmit Presubmit changed
pull-ci-openshift-aws-account-operator-master-coverage openshift/aws-account-operator presubmit Ci-operator config changed
pull-ci-openshift-aws-account-operator-master-images openshift/aws-account-operator presubmit Ci-operator config changed
pull-ci-openshift-aws-account-operator-master-integration-test openshift/aws-account-operator presubmit Ci-operator config changed
pull-ci-openshift-aws-account-operator-master-lint openshift/aws-account-operator presubmit Ci-operator config changed
pull-ci-openshift-aws-account-operator-master-test openshift/aws-account-operator presubmit Ci-operator config changed
pull-ci-openshift-aws-account-operator-master-validate openshift/aws-account-operator presubmit Ci-operator config changed
Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@BATMAN-JD
Copy link
Copy Markdown
Contributor Author

/pj-rehearse ack

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

@BATMAN-JD: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label May 1, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 1, 2026

@BATMAN-JD: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/rehearse/openshift/aws-account-operator/master/integration-test 1f187c2 link unknown /pj-rehearse pull-ci-openshift-aws-account-operator-master-integration-test

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants