Skip to content

CLID-636: Update AGENTS.md and switch to .agents dir#1421

Open
dorzel wants to merge 1 commit into
openshift:mainfrom
dorzel:CLID-636
Open

CLID-636: Update AGENTS.md and switch to .agents dir#1421
dorzel wants to merge 1 commit into
openshift:mainfrom
dorzel:CLID-636

Conversation

@dorzel
Copy link
Copy Markdown
Member

@dorzel dorzel commented May 27, 2026

Description

Updates content in AGENTS.md and moves from .claude to .agents dir, expecting users to have a local symlink for use with specific agents.

Also fixes a typo.

Previous PR was accidentally closed after I renamed my branch: #1402.

Github / Jira issue: https://redhat.atlassian.net/browse/CLID-636

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code Improvements (Refactoring, Performance, CI upgrades, etc)
  • Internal repo assets (diagrams / docs on github repo)
  • This change requires a documentation update on openshift docs

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Expected Outcome

Please describe the outcome expected from the tests.

Summary by CodeRabbit

  • Documentation
    • Expanded agent guidance with a clearer, v2-focused workflow (v1 marked deprecated)
    • Added a detailed project and documentation structure tree
    • Enhanced architecture overview describing collectors, image-copy responsibilities, and concurrency model
    • Clarified development commands with explicit build/test/validation guidance
    • Added testing patterns covering mocking, fixtures, and assertion libraries

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Walkthrough

Documentation-only rewrite of AGENTS.md to mark v2 current, add explicit project and docs directory trees, update key architecture descriptions for collectors and image-copy concurrency, and expand build/test/validation guidance including testing patterns and build-tag examples.

Changes

oc-mirror Agent Guide Restructuring

Layer / File(s) Summary
Foundation and project structure
AGENTS.md
Introduction punctuation adjusted; version structure clarified with v2 marked current and v1 deprecated; explicit project directory tree added covering cmd/, pkg/, internal/, docs/, hack/, images/, and v1/ folders.
Architecture and documentation reference
AGENTS.md
Documentation tree section expanded with structured subdirectory and file listings; key architecture components section rewritten describing collector locations/purposes and how collectors feed batched concurrent copy operations.
Development workflow and testing guide
AGENTS.md
Build command guidance updated with clearer Makefile usage and required build-tag notes; testing instructions expanded with unit vs integration make targets and go test examples requiring specific build tags; validation targets (lint, vet, format, tidy, sanity, all) and a make sanity pre-commit reminder added; new testing patterns section documents mocking, fixtures, and assertion libraries.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Test Structure And Quality ❓ Inconclusive Custom check asks for Ginkgo test code review, but PR is documentation-only and repository uses standard Go testing, not Ginkgo. Check instructions are not applicable to this PR—clarify if Ginkgo review applies or provide different check matching actual test framework.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title mentions updating AGENTS.md and switching to .agents dir, which aligns with the actual changes documented in the raw summary (content updates and directory migration).
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 No Ginkgo tests found in PR. All test files use standard Go testing (testing.T) with func Test* patterns, not Ginkgo It()/Describe()/Context(). Check not applicable.
Microshift Test Compatibility ✅ Passed PR only modifies documentation (AGENTS.md) and directory structure (.agents). No Ginkgo e2e tests are added, making the compatibility check not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added in this PR; modified test files are unit tests using Go's standard testing pattern, and infrastructure files are test support fixtures.
Topology-Aware Scheduling Compatibility ✅ Passed This PR is documentation-only (AGENTS.md update) with no deployment manifests, operator code, or controllers that would introduce topology-aware scheduling constraints. The check does not apply.
Ote Binary Stdout Contract ✅ Passed oc-mirror is a regular CLI tool, not an OTE (OpenShift Tests Extension) binary that communicates with openshift-tests. The check does not apply to this PR.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add Ginkgo e2e tests; it adds standard Go unit tests using testify, which are outside the scope of this IPv6/disconnected network compatibility check.
No-Weak-Crypto ✅ Passed No weak cryptography usage found. Comprehensive search for MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, and insecure comparisons returned zero matches across all code and documentation files.
Container-Privileges ✅ Passed PR contains only documentation changes (AGENTS.md) with no container/K8s manifests; custom check for privileged containers is not applicable.
No-Sensitive-Data-In-Logs ✅ Passed PR contains only documentation updates to AGENTS.md with no logging statements, sensitive data, passwords, tokens, API keys, PII, or other confidential information exposed.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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

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

@dorzel dorzel changed the title Update AGENTS.md and switch to .agents dir CLID-636: Update AGENTS.md and switch to .agents dir May 27, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 27, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 27, 2026

@dorzel: This pull request references CLID-636 which is a valid jira issue.

Details

In response to this:

Description

Updates content in AGENTS.md and moves from .claude to .agents dir, expecting users to have a local symlink for use with specific agents.

Previous PR was accidentally closed after I renamed my branch: #1402.

Github / Jira issue: https://redhat.atlassian.net/browse/CLID-636

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code Improvements (Refactoring, Performance, CI upgrades, etc)
  • Internal repo assets (diagrams / docs on github repo)
  • This change requires a documentation update on openshift docs

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Expected Outcome

Please describe the outcome expected from the tests.

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 openshift-eng/jira-lifecycle-plugin repository.

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 `@AGENTS.md`:
- Line 23: In AGENTS.md update the two fenced code blocks that currently use
plain ``` to include a language identifier (e.g., change ``` to ```text) so
markdownlint MD040 is satisfied; locate the two triple-backtick blocks that
contain the directory trees (the oc-mirror/ and docs/ code blocks) and prepend
"text" after the opening backticks (retain the existing block content and
closing backticks).
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: cbf5fc82-0f74-41c5-b8b9-6d6e148580ad

📥 Commits

Reviewing files that changed from the base of the PR and between f5796a9 and bbddff4.

📒 Files selected for processing (3)
  • .agents/commands/README.md
  • .agents/commands/generate-imageset.md
  • AGENTS.md

Comment thread AGENTS.md Outdated
@openshift-ci openshift-ci Bot requested review from adolfo-ab and r4f4 May 27, 2026 16:38
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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 `@AGENTS.md`:
- Line 65: Update the doc entry string in AGENTS.md to correct the typo: replace
"progress-bar-and-concurrencty-investigation.md" with
"progress-bar-and-concurrency-investigation.md" wherever it appears (the listed
entry under the progress/concurrency design bullet); ensure any internal links
or references that use this filename are updated to the corrected "concurrency"
spelling as well.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d08effa8-297a-40cb-9ae5-11a288d06d95

📥 Commits

Reviewing files that changed from the base of the PR and between bbddff4 and 921c9ce.

📒 Files selected for processing (3)
  • .agents/commands/README.md
  • .agents/commands/generate-imageset.md
  • AGENTS.md

Comment thread AGENTS.md Outdated
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 27, 2026

@dorzel: all tests passed!

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.

Copy link
Copy Markdown
Contributor

@aguidirh aguidirh left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @dorzel, I added few comments. Please let me know if you have questions about them.

Comment thread AGENTS.md
## Project Overview

This is the `oc-mirror` repository - an OpenShift client tool for mirroring container registry content for disconnected cluster installs.
This is the `oc-mirror` repository an OpenShift client tool for mirroring container registry content for disconnected cluster installs.
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.

Suggested change
This is the `oc-mirror` repository an OpenShift client tool for mirroring container registry content for disconnected cluster installs.
This is the `oc-mirror` repository - an OpenShift client tool (Command Line Interface - CLI) for mirroring container registry content for disconnected cluster installs.

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.

Maybe just

Suggested change
This is the `oc-mirror` repository — an OpenShift client tool for mirroring container registry content for disconnected cluster installs.
This is the `oc-mirror` repository — an OpenShift command line tool for mirroring container registry content for disconnected cluster installs.

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.

Adolfo suggestion is simpler, which is better.

Comment thread AGENTS.md
Comment on lines +26 to +28
├── pkg/
│ ├── cli/mirror/ # top-level mirror orchestration (m2m, m2d, d2m)
│ └── metadata/storage/ # metadata/history persistence
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.

In v2 there is no pkg/cli/mirror and pkg/metadata/storage

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.

I am not sure if it's worth to have the file trees here. This might change over time and it will become obsolete. I think agents can easily find out the repository structure dynamically. I think instead we should emphasize the high-level components and architecture (collector, batch worker, etc), their function and why they exist.

wdyt? @aguidirh @dorzel

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.

I like the idea of explaining the high-level packages without having them in a tree structure, in this way when we refactor we don't need to remember to update the tree structure. Moving pieces from one place to another is a very common task and it would make the tree outdated easily.

Comment thread AGENTS.md
│ └── metadata/storage/ # metadata/history persistence
├── internal/
│ ├── pkg/
│ │ ├── api/v2alpha1/ # ImageSetConfiguration types and schemas
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.

There are other sub-folders under api, archive, cli, clusterresources, config, history. Also there are some pkgs missing in the list (spinners and version for example, there are others missing). Should we add all of them?

Each folder, even if it is a sub-folder it is considered a different pkg in golang, so maybe should we considere also sub-folders in the structure?

Comment thread AGENTS.md
│ │ └── ... # log, emoji, spinners, consts, etc.
│ ├── e2e/ # E2E test infrastructure and templates
│ └── testutils/ # Shared test helpers
├── tests/ # Test fixtures (OCI images, configs, caches)
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.

I believe there is a typo here.

Suggested change
├── tests/ # Test fixtures (OCI images, configs, caches)
├── tests/ # Test features (OCI images, configs, caches)

Comment thread AGENTS.md

- **Unit vs integration**: `make test-unit` runs with `-short`. Integration tests check `testing.Short()` and skip themselves, so they only run via `make test-integration`.
- **Mocking**: tests use `github.com/stretchr/testify/mock`. Mock structs are defined alongside the tests that use them (see `internal/pkg/cli/executor_test.go` for examples).
- **Test fixtures**: stored in `tests/` and referenced via the constant `consts.TestFolder` (`"../../../tests/"`). Fixtures include fake OCI images, caches, configs, and archive data.
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.

typo

Suggested change
- **Test fixtures**: stored in `tests/` and referenced via the constant `consts.TestFolder` (`"../../../tests/"`). Fixtures include fake OCI images, caches, configs, and archive data.
- **Test features**: stored in `tests/` and referenced via the constant `consts.TestFolder` (`"../../../tests/"`). Features include fake OCI images, caches, configs, and archive data.

Comment thread AGENTS.md
```bash
make verify # run golangci-lint
make sanity # runs: tidy, format, and vet checks
go test -tags "json1 exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp" \
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.

Not so sure if these tags are really needed. Maybe am I missing anything?

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.

If someone doesn't have all the deps installed, some of these flags might be needed.

Comment thread AGENTS.md
-short -race -count=1 ./internal/pkg/image/...

go test -tags "json1 exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp" \
-short -race -count=1 -run TestSpecificName ./internal/pkg/release/...
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.

@adolfo-ab is this the right way to call specific tests when using the new approach with ginko?

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.

It's pretty similar, yes

Comment thread AGENTS.md
## Project Overview

This is the `oc-mirror` repository - an OpenShift client tool for mirroring container registry content for disconnected cluster installs.
This is the `oc-mirror` repository an OpenShift client tool for mirroring container registry content for disconnected cluster installs.
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.

Maybe just

Suggested change
This is the `oc-mirror` repository — an OpenShift client tool for mirroring container registry content for disconnected cluster installs.
This is the `oc-mirror` repository — an OpenShift command line tool for mirroring container registry content for disconnected cluster installs.

Comment thread AGENTS.md
Comment on lines +26 to +28
├── pkg/
│ ├── cli/mirror/ # top-level mirror orchestration (m2m, m2d, d2m)
│ └── metadata/storage/ # metadata/history persistence
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.

I am not sure if it's worth to have the file trees here. This might change over time and it will become obsolete. I think agents can easily find out the repository structure dynamically. I think instead we should emphasize the high-level components and architecture (collector, batch worker, etc), their function and why they exist.

wdyt? @aguidirh @dorzel

Comment thread AGENTS.md
### Documentation tree

```text
docs/
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.

ditto

Comment thread AGENTS.md
-short -race -count=1 ./internal/pkg/image/...

go test -tags "json1 exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp" \
-short -race -count=1 -run TestSpecificName ./internal/pkg/release/...
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.

It's pretty similar, yes

Comment thread AGENTS.md

Run `make sanity` before committing — it will fail if there are uncommitted formatting or module changes.

## Testing patterns
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.

I think we can redirect the agent to docs/testing, which I just added here: #1422

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants