Skip to content

WIP: UPSTREAM: <carry>: add AGENTS.md for AI code contributions#2503

Open
kevinrizza wants to merge 1 commit intoopenshift:masterfrom
kevinrizza:add-agents-file
Open

WIP: UPSTREAM: <carry>: add AGENTS.md for AI code contributions#2503
kevinrizza wants to merge 1 commit intoopenshift:masterfrom
kevinrizza:add-agents-file

Conversation

@kevinrizza
Copy link
Copy Markdown
Member

Adding AGENTS.md file for code generation tools to interact with this repository. Mostly focuses on the kinds of changes that should be made to this repo.

@openshift-ci-robot openshift-ci-robot added the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Oct 28, 2025
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 28, 2025
@openshift-ci-robot
Copy link
Copy Markdown

@kevinrizza: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@openshift-ci openshift-ci Bot requested review from bertinatto and tkashem October 28, 2025 19:12
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Oct 28, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Oct 29, 2025

@kevinrizza: The following tests 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/prow/e2e-aws-ovn-techpreview-serial 136124e link false /test e2e-aws-ovn-techpreview-serial
ci/prow/integration 136124e link true /test integration
ci/prow/e2e-aws-ovn-serial 136124e link true /test e2e-aws-ovn-serial

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.

@kannon92
Copy link
Copy Markdown

kannon92 commented Nov 3, 2025

/hold

Should we consider inheriting this from upstream?

kubernetes#133386

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 3, 2025
@jacobsee
Copy link
Copy Markdown
Member

jacobsee commented Nov 4, 2025

/hold

Should we consider inheriting this from upstream?

kubernetes#133386

It does seem like we shouldn't "step on" a change that's likely coming upstream but I'm conflicted on what the right answer should be. The file in the upstream PR details how to work with this repository in ways that we'd rather avoid here, and this file has proper context for this forked repository in ways that aren't applicable upstream. Should we keep both, with different names? Would agents even read both? Or should we step on the upstream file after all since it'd add potentially unnecessary complexity to the interpretation...

@kevinrizza
Copy link
Copy Markdown
Member Author

My perspective here is that we probably want a carry patch that has our own separate AGENTS.md file. That pr upstream has been up for quite a while, but even if it does merge we probably want to have radically different behavior here vs upstream (hence my PR). I am obviously biased, but I'm happy to hear alternative suggestions. Another option would be that we do a merge of both if and when that change eventually lands upstream.

@kannon92
Copy link
Copy Markdown

kannon92 commented Nov 7, 2025

It would be great to avoid conflicts as much as possible.

WDYT @bertinatto?

Copy link
Copy Markdown
Member

@bertinatto bertinatto left a comment

Choose a reason for hiding this comment

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

I don’t feel strongly about this. If others think it adds value, I’m fine with merging it. My preference would be to improve the existing READMEs (agents do read them, right?) and address the gaps there, but I’m not opposed to this change.

Comment thread AGENTS.md

1. **Remove all carry patches** from the current branch
2. **Cherry-pick all new upstream commits** added between the two minor releases
3. **Reapply all carry patches** on top of the new upstream base
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We start with a clean branch from the upstream tag (e.g., v1.31.0) and cherry-pick all downstream carries from the current openshift/master branch. Then we merge our branch in openshift/master. The end result is openshift/master has the same code base as v1.31.0 plus the downstream carries.

Comment thread AGENTS.md
- `openshift-kube-apiserver/` - OpenShift API server customizations
- `openshift-kube-controller-manager/` - OpenShift controller manager customizations
- `README.openshift.md` - OpenShift fork documentation
- `REBASE.openshift.md` - Rebase process documentation
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps just the OpenShift-specific directories/files?

Comment thread AGENTS.md
- `README.openshift.md` - OpenShift fork documentation
- `REBASE.openshift.md` - Rebase process documentation

## Commit Message Conventions (CRITICAL)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is already explained in the REBASE.openshift.md file; do we need to state this again?

Comment thread AGENTS.md
- **Related carries** should be squashed together to simplify future rebases

### Enforcement
**Pull requests that do not follow these commit message conventions will be rejected by maintainers.** Every commit must use one of the `UPSTREAM:` prefixes listed above (except for direct upstream commits added during rebase).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

Comment thread AGENTS.md
If you identify a bug that affects Kubernetes generally (not just OpenShift):
1. The fix should ideally go to upstream `kubernetes/kubernetes` first
2. Then cherry-pick to OpenShift using `UPSTREAM: <PR number>:` format
3. Only use `UPSTREAM: <carry>:` for truly OpenShift-specific behavior
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These are good instrcutions, but I feel like they are not AI-specific. Maybe they would fit better in one of the README's we have (I'm OK with leaving them here as well).

Comment thread AGENTS.md
If changes are needed here, strongly consider:
1. Can this be fixed upstream first?
2. Is there a way to achieve this with less invasive changes?
3. Can this be done via a plugin or extension point?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if this will discourage agents from fixing code in k8s if I have my openshift/master checked out.

Comment thread AGENTS.md
2. **Understand the context**: Is this addressing an upstream or downstream concern?
3. **Minimize divergence**: Prefer smaller, more targeted changes
4. **Use correct prefixes**: Every commit must have an `UPSTREAM:` prefix
5. **Check for upstream fixes**: Before implementing a fix, search if it exists upstream
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This one is very useful. I wonder if the agent will need instructions on how to go through the upstream issues/PRs in GitHub.

Comment thread AGENTS.md
3. **Minimize divergence**: Prefer smaller, more targeted changes
4. **Use correct prefixes**: Every commit must have an `UPSTREAM:` prefix
5. **Check for upstream fixes**: Before implementing a fix, search if it exists upstream
6. **Suggest testing**: Always recommend running `make test` and `make verify`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This takes a lot of time, maybe we should suggest running individual tests.

Comment thread AGENTS.md

1. **Mixing generated and code changes** in the same commit
2. **Using wrong UPSTREAM prefix** (causes rebase issues)
3. **Modifying core Kubernetes code** without understanding if it should be upstream
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe this should be something like: add downstream-only commits (prefixed with UPSTREAM msg) that should be upstream

@openshift-bot
Copy link
Copy Markdown

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci Bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 15, 2026
@openshift-bot
Copy link
Copy Markdown

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci Bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 17, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 17, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f8994938-0042-4cbf-b3a4-edd0d17de2af

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

@openshift-bot
Copy link
Copy Markdown

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close not-planned

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 17, 2026

@openshift-bot: PRs cannot be closed as Not Planned.

Details

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close not-planned

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.

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

Labels

backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants