Skip to content

HYPERFLEET-884 - feat: add pre-commit hooks consuming from hyperfleet-hooks#25

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-hyperfleet:mainfrom
rafabene:HYPERFLEET-884-add-pre-commit-hooks
Jul 9, 2026
Merged

HYPERFLEET-884 - feat: add pre-commit hooks consuming from hyperfleet-hooks#25
openshift-merge-bot[bot] merged 1 commit into
openshift-hyperfleet:mainfrom
rafabene:HYPERFLEET-884-add-pre-commit-hooks

Conversation

@rafabene

@rafabene rafabene commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Add .pre-commit-config.yaml consuming hooks from hyperfleet-hooks v0.2.1 (commitlint, gofmt, golangci-lint, go-vet)
  • Add gofmt, go-vet, and install-hooks Makefile targets
  • Add Prerequisites and Install Git Hooks sections to README.md

Follows the pattern established in hyperfleet-sentinel (#102).

Test plan

  • Verify make install-hooks runs successfully
  • Verify pre-commit hooks trigger on commit (commit message validation + code quality)
  • Verify make gofmt and make go-vet work correctly

@openshift-ci openshift-ci Bot requested review from sherine-k and tirthct July 8, 2026 19:28
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds .pre-commit-config.yaml with pre-commit and commit-msg hook types, plus hyperfleet-commitlint, hyperfleet-gofmt, hyperfleet-golangci-lint, and hyperfleet-go-vet. Updates Makefile with gofmt, go-vet, and install-hooks targets and expands .PHONY. Updates README.md with development prerequisites and make install-hooks instructions.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
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.
Sec-02: Secrets In Log Output ✅ Passed Diff adds only config/docs; no added log statements mention tokens/passwords/secrets, so CWE-532 risk not introduced.
No Hardcoded Secrets ✅ Passed No CWE-798/CWE-259/CWE-321 hardcoded secrets found; diff only adds hook config, Makefile targets, and README docs, with no credential literals or auth URLs.
No Weak Cryptography ✅ Passed No crypto code added: diff is only pre-commit config, Makefile, and README; no md5/des/rc4, SHA1-for-security, ECB, or secret comparisons (CWE-327).
No Injection Vectors ✅ Passed Touched files only add static pre-commit/Makefile/docs; no SQL string building, exec.Command, template.HTML, or yaml.Unmarshal of untrusted input (CWE-89/78/79/502).
No Privileged Containers ✅ Passed No CWE-250/CWE-276 issue: the commit only touches .pre-commit-config.yaml, Makefile, and README.md; no manifests/Dockerfiles were changed.
No Pii Or Sensitive Data In Logs ✅ Passed No new slog/log/fmt.Print* calls were added in the touched files; only docs, Makefile, and pre-commit config changed. No CWE-532/CWE-200 log exposure found.
Title check ✅ Passed It clearly describes the main change: adding pre-commit hooks from hyperfleet-hooks.
Description check ✅ Passed It accurately summarizes the pre-commit config, Makefile targets, and README updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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

@hyperfleet-ci-bot

Copy link
Copy Markdown

Risk Score: 0 — risk/low

Signal Detail Points
PR size 39 lines +0
Sensitive paths none +0

Computed by hyperfleet-risk-scorer

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.pre-commit-config.yaml:
- Around line 4-5: The pre-commit hook source is an untrusted repo, so pinning
it with a tag is unsafe; update the hyperfleet-hooks entry in .pre-commit-config
to use a full commit SHA instead of the current rev tag, and keep the repo
reference in sync with that immutable commit so the pre-commit hook cannot be
moved later.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 7ab30050-ba8a-4edc-b082-d99909b699dd

📥 Commits

Reviewing files that changed from the base of the PR and between ccbce41 and 8cf4c11.

📒 Files selected for processing (3)
  • .pre-commit-config.yaml
  • Makefile
  • README.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)

Comment thread .pre-commit-config.yaml Outdated
@rafabene rafabene force-pushed the HYPERFLEET-884-add-pre-commit-hooks branch from 8cf4c11 to 1e0ae69 Compare July 8, 2026 19:46
@kuudori

kuudori commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kuudori

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

@openshift-ci openshift-ci Bot added the approved label Jul 9, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit bc77702 into openshift-hyperfleet:main Jul 9, 2026
8 checks passed
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