Skip to content

HYPERFLEET-930 - feat: add AGENTS.md and simplify CLAUDE.md#108

Open
kuudori wants to merge 4 commits into
openshift-hyperfleet:mainfrom
kuudori:HYPERFLEET-930
Open

HYPERFLEET-930 - feat: add AGENTS.md and simplify CLAUDE.md#108
kuudori wants to merge 4 commits into
openshift-hyperfleet:mainfrom
kuudori:HYPERFLEET-930

Conversation

@kuudori
Copy link
Copy Markdown
Contributor

@kuudori kuudori commented May 26, 2026

Summary

Test Plan

  • Unit tests added/updated
  • make test-all passes
  • make lint passes
  • Helm chart changes validated with make test-helm (if applicable)
  • Deployed to a development cluster and verified (if Helm/config changes)
  • E2E tests passed (if cross-component or major changes)

@openshift-ci openshift-ci Bot requested review from ciaranRoche and ma-hill May 26, 2026 20:04
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 26, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign vkareh 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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Chores

    • Enabled pre-commit hooks for automated code quality checks during commits.
    • Replaced code formatter with golangci-lint for standardized Go formatting.
  • Documentation

    • Added comprehensive E2E agent instructions and testing conventions.
    • Updated contribution guidelines with API client version-bump workflow.
    • Revised development and getting-started guides with updated test naming and cleanup patterns.

Walkthrough

This PR establishes code quality infrastructure, comprehensive E2E testing guidance, and import standardization. It configures golangci-lint with a gci formatter for import ordering, sets up pre-commit hooks for enforcing code standards, and refactors the Makefile to use golangci-lint instead of gofmt. A new AGENTS.md document provides detailed black-box instructions for writing E2E tests, covering conventions for naming, cleanup patterns, async operations, and runtime gotchas. Documentation is updated across CONTRIBUTING.md, development.md, architecture.md, and getting-started.md to reflect new test naming conventions with baseline categories, DeferCleanup cleanup patterns, and refreshed example commands. Go import ordering is standardized across multiple files to align with the gci formatter rules.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding AGENTS.md and simplifying CLAUDE.md as documented in the changeset.
Description check ✅ Passed The description references the related Jira ticket (HYPERFLEET-930) and provides a test plan checklist relevant to the changeset.
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.

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

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

Warning

Review ran into problems

🔥 Problems

Linked repositories: Couldn't analyze openshift-hyperfleet/architecture - clone failed: Clone operation failed: Cloning into '/home/jailuser/git'...
warning: templates not found in /usr/share/git-core/templates
fatal: unable to access 'https://github.com/openshift-hyperfleet/architecture.git/': Failed to connect to github.com port 443 after 133963 ms: Couldn't connect to server


Linked repositories: Couldn't analyze openshift-hyperfleet/hyperfleet-adapter - clone failed: Clone operation failed: Cloning into '/home/jailuser/git'...
warning: templates not found in /usr/share/git-core/templates
fatal: unable to access 'https://github.com/openshift-hyperfleet/hyperfleet-adapter.git/': Failed to connect to github.com port 443 after 134997 ms: Couldn't connect to server


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

Copy link
Copy Markdown

@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

🤖 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 `@Makefile`:
- Around line 107-111: The fmt-check target is masking formatter failures
because the current conditional only inspects pipe output and not the exit
status of "$(GOLANGCI_LINT) fmt --diff ./... | tee /dev/stderr | (! read)"; fix
it by running that pipeline in a bash subshell with pipefail enabled (so the
pipeline's exit status reflects the formatter command) and use that exit status
in the existing if ! ... then branch for fmt-check (reference the Makefile
target fmt-check and the pipeline containing $(GOLANGCI_LINT) fmt --diff ./... |
tee /dev/stderr | (! read) to locate the code).
🪄 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: ASSERTIVE

Plan: Enterprise

Run ID: f696652d-6f8e-4f32-a0ed-833a3959af9c

📥 Commits

Reviewing files that changed from the base of the PR and between ea96fbc and 5ae6d5b.

📒 Files selected for processing (15)
  • .golangci.yml
  • .pre-commit-config.yaml
  • AGENTS.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • Makefile
  • cmd/hyperfleet-e2e/common/config.go
  • cmd/hyperfleet-e2e/test/cmd.go
  • docs/architecture.md
  • docs/development.md
  • docs/getting-started.md
  • pkg/client/maestro/discovery.go
  • pkg/helper/adapter.go
  • pkg/helper/k8s.go
  • pkg/helper/k8s_test.go

Comment thread Makefile
kuudori added 4 commits May 26, 2026 17:03
CLAUDE.md now imports AGENTS.md via @AGENTS.md directive.
AGENTS.md contains verified, deduplicated agent instructions
with source-of-truth table, test conventions, and project boundaries.
Add .pre-commit-config.yaml using hyperfleet-hooks v0.2.1
(commitlint, gofmt, golangci-lint, go-vet).

Add gci formatter to golangci-lint config with 4-group import
ordering: stdlib, external, openshift-hyperfleet, hyperfleet-e2e.

Switch make fmt/fmt-check to use golangci-lint fmt.
Add make gofmt/go-vet aliases for hook compatibility.
Remove unused GOFMT variable.
Run golangci-lint fmt --fix to separate openshift-hyperfleet
org imports from hyperfleet-e2e local imports.
getting-started: fix nonexistent label-filter=critical to tier0,
fix broken troubleshooting.md link, fix broken markdown block.

development: fix test name format to [Suite:][category], switch
cleanup examples to DeferCleanup, add e2e/adapter/ to imports,
use h.TestDataPath(), fix dead links to nonexistent docs.

architecture: remove nonexistent config field, fix RunTests
signature, correct default poll interval, remove fabricated
retry logic and wrong generated client example.

CONTRIBUTING: add e2e/adapter/ to repo structure, fix cleanup
to DeferCleanup, remove fabricated OPENAPI_SPEC_REF env var.
Copy link
Copy Markdown

@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

🤖 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 `@Makefile`:
- Around line 99-105: The PR replaces gofmt with the golangci-lint formatter
causing cross-repo divergence; add a compatibility shim and documentation: keep
the Makefile targets fmt and gofmt (where gofmt is an alias to fmt using the
GOLANGCI_LINT variable) and add a short comment above them explaining the
standardization to golangci-lint fmt with gci import ordering, then update repo
README or CONTRIBUTING to state the new formatter and mention that gofmt target
remains for backward compatibility; reference the Makefile targets `fmt`,
`gofmt` and the `GOLANGCI_LINT` variable when making these edits.
🪄 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: ASSERTIVE

Plan: Enterprise

Run ID: fd35aa9d-e2ea-4bca-9334-9088cfa80d0e

📥 Commits

Reviewing files that changed from the base of the PR and between 5ae6d5b and a450b93.

📒 Files selected for processing (15)
  • .golangci.yml
  • .pre-commit-config.yaml
  • AGENTS.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • Makefile
  • cmd/hyperfleet-e2e/common/config.go
  • cmd/hyperfleet-e2e/test/cmd.go
  • docs/architecture.md
  • docs/development.md
  • docs/getting-started.md
  • pkg/client/maestro/discovery.go
  • pkg/helper/adapter.go
  • pkg/helper/k8s.go
  • pkg/helper/k8s_test.go

Comment thread Makefile
Comment on lines 99 to 105
.PHONY: fmt
fmt: ## Format Go code
$(GOFMT) -s -w .
fmt: $(GOLANGCI_LINT) ## Format Go code and imports
$(GOLANGCI_LINT) fmt ./...

.PHONY: gofmt
gofmt: fmt ## Alias for fmt

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Cross-repo formatting tool divergence.

Linked repositories (hyperfleet-api, hyperfleet-sentinel, hyperfleet-broker) still reference gofmt in their Makefiles and golangci configs. This PR standardizes on golangci-lint fmt with gci import ordering, which may create different developer experiences across repositories. Consider documenting this transition or coordinating formatting standards across the HyperFleet organization.

🤖 Prompt for 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.

In `@Makefile` around lines 99 - 105, The PR replaces gofmt with the golangci-lint
formatter causing cross-repo divergence; add a compatibility shim and
documentation: keep the Makefile targets fmt and gofmt (where gofmt is an alias
to fmt using the GOLANGCI_LINT variable) and add a short comment above them
explaining the standardization to golangci-lint fmt with gci import ordering,
then update repo README or CONTRIBUTING to state the new formatter and mention
that gofmt target remains for backward compatibility; reference the Makefile
targets `fmt`, `gofmt` and the `GOLANGCI_LINT` variable when making these edits.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant