Skip to content

Conversation

@kevinrizza
Copy link
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

@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

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.

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

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.

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

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

kannon92 commented Nov 7, 2025

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

WDYT @bertinatto?

Copy link
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.


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
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.

- `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
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?

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

## Commit Message Conventions (CRITICAL)
Copy link
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?

- **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
Member

Choose a reason for hiding this comment

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

👍

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
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).

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
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.

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
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.

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
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.


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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants