From ec576c9369194bae69af3566639a3ccb8b8c26e9 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Wed, 25 Nov 2026 19:57:16 +0300 Subject: [PATCH] docs(agents): require an upstream reference for downstream patches A patch carried on top of someone else's code is meant to be temporary: it stays only until the same change lands upstream. Without a link to the upstream submission nobody can tell whether that is underway, when the patch can be dropped, or whether it was ever offered at all. The rule is written once, in CONTRIBUTING.md, so that human contributors read it in the file addressed to them. AGENTS.md points to it and adds that an agent prepares the upstream submission but does not publish it in another project without explicit approval. The agent PR checklist and the PR template point to the same section; the template field is commented out so that PRs without a downstream patch are unaffected. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin --- .github/PULL_REQUEST_TEMPLATE.md | 2 ++ AGENTS.md | 1 + CONTRIBUTING.md | 4 ++++ docs/agents/contributing.md | 1 + 4 files changed, 8 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cf463c5e8..ccc752f3b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -14,6 +14,8 @@ ## What this PR does + + ### Screenshots diff --git a/AGENTS.md b/AGENTS.md index 3e74ff133..b9c8a4e00 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,6 +66,7 @@ These hold for every task, whichever document the routes above point at. - **Name the cluster.** Management and tenant clusters are different targets. Every `kubectl` call, including reads, carries `--context`; cluster-facing Helm commands carry `--kube-context`. Use the human-approved target and the task's kubeconfig where one was supplied, not the ambient current context. Before running wrappers or cluster-facing tests, verify that they propagate the chosen target. Tests that need no cluster must not inherit live cluster credentials. - **Respect the reader's time.** Lead with the answer or decision; prefer direct wording over formalities, filler and repeated conclusions. Put necessary detail after a short summary or in a linked document. - **Public text.** Everything that reaches GitHub (commits, PR and issue bodies, review comments, code comments) is in English. It names no private infrastructure (cluster, customer or internal namespace names) and none of an agent's private tooling (custom skills, slash commands). Nothing is published on someone's behalf without their approval, unless they have delegated it. +- **Downstream patches go upstream.** A change carried on top of someone else's code links the same change offered upstream, or says why there is none, as [Patches to other projects' code](./CONTRIBUTING.md#patches-to-other-projects-code) requires. An agent does not open that upstream pull request, issue or thread on its own: it is a publication in another project on the user's behalf and needs the user's explicit approval for that specific submission. Without it, prepare the upstream change and its text, and ask; a patch with no upstream counterpart needs no submission. ## Project Overview diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a2d02192..ad4633e67 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,6 +36,10 @@ We welcome many types of contributions including: The best way to reach us with a question when contributing is to drop a line in our [Telegram channel](https://t.me/cozystack), or start a new GitHub discussion. +## Patches to other projects' code + +A downstream patch is a change Cozystack carries on top of someone else's code: a source patch under `packages/*/*/images/*/patches/`, a patch to a vendored chart under `packages/*/*/patches/`, a fork pin, a carried backport. A pull request that adds or changes one links the same change offered upstream: the upstream pull request or patch submission, or at least the upstream issue or thread where it was raised and what came of it. A patch file's header names that link and the condition for dropping the patch. A patch with no upstream counterpart says why, in the pull request and in place of the link in its header, for example that the change is specific to Cozystack and upstream would not take it. + ## Where do I file? Cozystack work is split across two repositories. Use this table to land in the right place: diff --git a/docs/agents/contributing.md b/docs/agents/contributing.md index f5f19d923..c0e433147 100644 --- a/docs/agents/contributing.md +++ b/docs/agents/contributing.md @@ -11,6 +11,7 @@ Project-side conventions for commits, branches, and pull requests in Cozystack. - [ ] PR body includes description and release note - [ ] Ran `make generate` in every package whose `values.yaml`, `values.schema.json`, `Chart.yaml`, or `README.md` was touched, and committed the regenerated files - [ ] Walked the [Downstream Repositories](#downstream-repositories) trigger map against the diff, and linked a follow-up (a PR, or an issue when the PR is out of scope) in every repository the change reaches +- [ ] Every downstream patch the PR adds or changes links its upstream counterpart, or the PR says why there is none (see [Patches to other projects' code](../../CONTRIBUTING.md#patches-to-other-projects-code)) ## Regenerate Artifacts Before Committing