-
Notifications
You must be signed in to change notification settings - Fork 38
OPRUN-4268: Add AGENTS.md to allow agents to make contributions to the codebase #580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OPRUN-4268: Add AGENTS.md to allow agents to make contributions to the codebase #580
Conversation
Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
openshift/AGENTS.md
Outdated
|
|
||
| --- | ||
|
|
||
| ## Understanding the Rebase Process |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth including that these processes are crystallized in openshift/operator-framework-tooling?
openshift/AGENTS.md
Outdated
| - **Updated** if upstream code has changed in conflicting ways | ||
| - **Maintained** by the OpenShift team indefinitely | ||
|
|
||
| **Carry patches should only be added if a change absolutely cannot be accepted upstream.** Every carry patch represents ongoing manual work for the maintainers through every upstream release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
openshift/AGENTS.md
Outdated
|
|
||
| **When to use:** ONLY during the rebase process itself | ||
|
|
||
| **AI tools should NEVER suggest these** in regular pull requests - these are added by maintainers when rebasing to a new upstream version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
ankitathomas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
openshift/AGENTS.md
Outdated
| 1. **Understand the intent:** Is this fixing an OpenShift-specific issue or an upstream bug? | ||
|
|
||
| 2. **Choose the right approach:** | ||
| - If it's an upstream bug → Should be fixed in `operator-framework/operator-controller` first, then cherry-picked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not cherry-picked. The downstream-related tooling should be allowed to execute, replaying commits against our fork of the upstream branch, once that has been fast-forwarded.
openshift/AGENTS.md
Outdated
|
|
||
| ## 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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is that any PR not following these conventions will fail the CI check by commitchecker (though we've definitely encountered some bugs where it did not!!!).
openshift/AGENTS.md
Outdated
| 2. **Choose the right approach:** | ||
| - If it's an upstream bug → Should be fixed in `operator-framework/operator-controller` first, then cherry-picked | ||
| - If it's OpenShift-specific → Use `UPSTREAM: <carry>:` prefix | ||
| - If it's generated code → Will be handled by `make manifests` with `UPSTREAM: <drop>:` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to say that agents should resolve via an UPSTREAM: <drop> PR if and only if (IFF) those changes are needed to resolve current failures, and local re-generation of the content cannot (for example, if multiple PRs influence generated content in ways which cannot be trivially merged).
openshift/AGENTS.md
Outdated
| If you identify a bug that affects operator-controller generally (not just OpenShift): | ||
|
|
||
| 1. **The fix should ideally go to upstream `operator-framework/operator-controller` first** | ||
| 2. **Then cherry-pick** to OpenShift using `UPSTREAM: <PR number>:` format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want agents performing this step. Instead it's probably better to say that they should wait for the upstream change to be downstreamed using the $tooling on its scheduled interval.
Otherwise, we're going to end up with a bunch of PR-labeled changes duplicating the work of the bumper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, we avoid using UPSTREAM: <pr number> because we sync everything from upstream. It would have to be an exceptional case to use UPSTREAM: <pr number>, and in fact, it might be preferred to use UPSTREAM: <drop> because the fix will eventually come down from upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, updated in the latest commit
openshift/AGENTS.md
Outdated
|
|
||
| 1. **The fix should ideally go to upstream `operator-framework/operator-controller` first** | ||
| 2. **Then cherry-pick** to OpenShift using `UPSTREAM: <PR number>:` format | ||
| 3. **Only use `UPSTREAM: <carry>:`** for truly OpenShift-specific behavior |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 3. **Only use `UPSTREAM: <carry>:`** for truly OpenShift-specific behavior | |
| 3. **Only use `UPSTREAM: <carry>:`** for truly OpenShift-specific behavior for content which is not generated |
openshift/AGENTS.md
Outdated
| | OpenShift test (OTE) | `UPSTREAM: <carry>:` | ❌ NO - Downstream only | | ||
| | OpenShift integration | `UPSTREAM: <carry>:` | ❌ NO - Downstream only | | ||
| | OpenShift config | `UPSTREAM: <carry>:` | ❌ NO - Downstream only | | ||
| | Remove upstream file | `UPSTREAM: <drop>:` | ❌ NO - Downstream only | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think if a case where we would want to follow this path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An UPSTREAM: <drop> is generally used as a temporary fix, since it's gone during the next sync.
If we did want to remove an upstream file (e.g. .github directory), it would still be a <carry> commit. However, we try to actually avoid that. The bumper actually deletes some of these files itself with a <drop> because it can handle the process better than trying to carry over a <carry> commit and the conflicts that can create.
openshift/AGENTS.md
Outdated
| | OpenShift integration | `UPSTREAM: <carry>:` | ❌ NO - Downstream only | | ||
| | OpenShift config | `UPSTREAM: <carry>:` | ❌ NO - Downstream only | | ||
| | Remove upstream file | `UPSTREAM: <drop>:` | ❌ NO - Downstream only | | ||
| | Generated files | `UPSTREAM: <drop>:` | ❌ NO - Regenerate with `make manifests` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This contradicts previous guidance here which implies that generated stuff which we need to temporarily resolve until some later PR should use this process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it is something we do, and something I have done.
|
There's some duplicated and internally contradictory content here. Could you re-run this through claude with a "be concise and consistent" prompt modification? If you also direct it to resolve PR comments then you should be able to get to a happy update in a single step. |
Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
openshift/AGENTS.md
Outdated
| | General bug fix | `UPSTREAM: <PR>:` | ✅ YES - Fix upstream, then cherry-pick | | ||
| | General feature | `UPSTREAM: <PR>:` | ✅ YES - Add upstream, then cherry-pick | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ought to be "Fix upstream, then let the tooling synchronize"
|
TL;DR: we don't cherry-pick to the However, cherry-picking would be done on release branches, but since most downstream work is on the We would almost never see
EDIT: You updated the file as I was writing this... so looking 👀 again. |
openshift/AGENTS.md
Outdated
| **Upstream Repository:** https://github.com/operator-framework/operator-controller | ||
|
|
||
| **Key Constraints for AI Agents:** | ||
| - This fork is **rebased regularly** against upstream (with each upstream release) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, it's done daily, not on upstream releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this in the latest commit
ankitathomas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
This version is much better. I think I had just one comment on the frequency of the synchronization. |
Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
3cc0cef to
7a1d590
Compare
|
/lgtm |
openshift/AGENTS.md
Outdated
| 3. **Check upstream first** before fixing bugs - should it go upstream? | ||
| 4. **Separate commits:** Never mix code changes with generated files | ||
| 5. **Run verification:** `make verify` and `make test-unit` before completion | ||
| 6. **Sign commits:** Use `git commit -s` for DCO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a difference between signing a commit, and including DCO. -s is DCO. -S is sign cryptographically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we have root-level DCO file to cover this. So while signing is desired, it's not a required step for DCO. And it isn't cryptographic identity attestation.
Signed-off-by: Rashmi Gottipati <rgottipa@redhat.com>
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ankitathomas, grokspawn, rashmigottipati, tmshort The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/label acknowledge-critical-fixes-only |
|
/retitle NO-ISSUE: Add AGENTS.md to allow agents to make contributions to the codebase |
|
@rashmigottipati: This pull request explicitly references no jira issue. In response to this: 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. |
|
@rashmigottipati: This pull request references OPRUN-4268 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set. In response to this:
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. |
|
/refresh |
|
/label qe-approved |
|
@rashmigottipati: This pull request references OPRUN-4268 which is a valid jira issue. In response to this:
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. |
|
@bandrade: This PR has been marked as verified by In response to this:
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. |
|
@rashmigottipati: all tests passed! 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. |
Fixes: OPRUN-4268