Repository navigation
docs: Add example-authoring guidelines and Copilot review rubric - #1644
Conversation
|
cc @botengyao |
There was a problem hiding this comment.
🟡 Changes recommended
The guidance in CONTRIBUTING.md and .github/copilot-instructions.md incorrectly bans valid fixed container listeners instead of requiring overridable published host ports and resolved variables in verification requests.
1 open issue
What changed in this PR
Documents contributor expectations for documentation-first sandboxes that demonstrate released Envoy features, and adds a matching Copilot review rubric.
Changes:
- Defines example scope, numbered documentation steps, and matching CI verification.
- Documents requirements for ports, self-contained upstreams, external-service exceptions, and CI registration.
- Makes the guidance discoverable from the README and incorporates it into review instructions.
| File | Description |
|---|---|
| README.md | Links to the example-authoring guidelines. |
| CONTRIBUTING.md | Adds contributor requirements and an example checklist. |
| .github/copilot-instructions.md | Adds review checks derived from the contributor guidelines. |
Review effort: Balanced
b0ad3b2 to
d768517
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The unconditional 1:1 rule conflicts with the external-service setup exception, which needs to be reflected consistently in the guidance and checklists to avoid flagging permitted examples.
1 open issue
1 resolved since last review
Review effort: Balanced
d768517 to
dfa4a8d
Compare
dfa4a8d to
ff62f68
Compare
| `envoyproxy/envoy:dev`, or a dependency on a filter/config that is not in a published | ||
| Envoy release. The example's Envoy image and bzlmod module should be the last published | ||
| version, not a dev snapshot. | ||
| 2. **Stable filter.** Flag examples for filters under active correctness churn or still |
There was a problem hiding this comment.
I understand we want to introduce stable examples, but in the AI era, many functions are alpha in nature, would it make sense to relax this requirement? if not we should find a new place to host that alpha examples.
There was a problem hiding this comment.
it didnt with the transcoder example we had to disable it almost immediately
There was a problem hiding this comment.
i think the point is this ... there are filters/extensions in envoy that have remained alpha/wip for years with little change - i see no problem including in that case (with banner saying its not covered by sec policy etc)
that is a different case to the mcp-transcoder pr which changed almost immediately - or the other mcp here which is full of workarounds for known/current/active bugs - its these cases we dont want to carry - they really are not stable enough to exemplify
There was a problem hiding this comment.
I understand it could break, but what is the best way to show users that we have these features nicely and easily?
There was a problem hiding this comment.
ideally by stabilizing
but if they are at least in a published release - then we exemplify that - that risks breaking envoy ci when the code changes - but in that case we would have to figure out workarounds/shims/etc (this is what oauth did previously)
There was a problem hiding this comment.
We can add a shim at first before adding new examples for AI examples, it that is okay, I am fine.
There was a problem hiding this comment.
really not following - how can you add a shim to something that doesnt exist?
There was a problem hiding this comment.
I could misunderstand the "shim", I want to make sure when we are adding some examples: hey, the action item is to add a shim or some exception system that is easy enough to maintain since it is alpha, no matter which one is happening at first, will not block the PR. Does this guideline sound reasonable to you?
There was a problem hiding this comment.
to be precise on the blocking point: verify_examples isn't a hard gate in envoy CI — it's advisory, it goes red rather than failing the merge. but if your envoy PR breaks a documented example, you're expected to fix it, and we do take that signal — so in practice it will hold your envoy PR up. so "won't block the PR" isn't quite right: it blocks it the way a failing-but-not-required check does — by review, not by a hard gate.
tl;dr: if you don't document an unstable feature here, you never need a shim. if you do, then every breaking change you later make in envoy needs the shim dance first — that's the ongoing cost you're signing up for.
what the shim is, concretely — say there's an example for filter foo and you want to rename a config field old → new in envoy:
- a single envoy PR doing the rename breaks it: envoy's
verify_examplesruns the current example (still usingold) against envoy HEAD → red. - so the dance is:
- examples PR first — make the example tolerate both
oldandnew(the shim), so it stays green against the published release (old) and against envoy HEAD once the rename lands. - envoy PR — do the rename;
verify_examplesis now green because the example already handlesnew. - examples PR later — once the rename is in a published release, drop the shim and move the example to
newonly (and repin to the released version).
- examples PR first — make the example tolerate both
so it's 2–3 coordinated cross-repo PRs for every breaking change. that's cheap for a stable filter (changes are rare), but for an alpha one that changes often it's real recurring overhead — which is exactly why we're cautious about documenting unstable features. it won't block you in a hard-CI sense, but the maintenance is the thing to weigh.
(bot assisted)
There was a problem hiding this comment.
also, two things i glossed:
-
it's a bit more than those 2–3 PRs, because the accommodation usually needs an envoy module published to our registry for examples to pin — the "publishing dance." so a breaking change can run: examples shim PR → interim-publish an envoy module to the registry → envoy change → (later) examples cleanup + repin to the released version.
-
the case we really want to avoid is a filter that has never been in any envoy release — nothing published exists to pin, the example can only run on
:dev, and every change churns the full dance. what makes it tractable at all is that we already have a system for interim-publishing envoy to our registry: that's what shims pin against, and it's specifically how you'd add an example for a new filter ahead of its release — interim-publish the module carrying it and pin the build to that (the runtime container stays:devuntil the release ships, then repin).
and on docs: they should always be consistent with what they'll be at the next release — i.e. tracking envoy head, since head is what becomes that release. keep the docs matching head and they're already correct when it ships.
(bot assisted)
ff62f68 to
3710799
Compare
3710799 to
1733e17
Compare
1733e17 to
dbedf82
Compare
dbedf82 to
018483b
Compare
638d6ae to
a09ead8
Compare
e1f9364 to
4f6f421
Compare
4f6f421 to
123fa52
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The documentation promises upstream coverage for examples excluded from EXAMPLE_TESTS, but that exclusion also removes them from Envoy’s default-branch CI suite, so the coverage gap needs to be documented.
2 open issues
Review effort: Balanced
123fa52 to
f77f966
Compare
| An example pins and ships the **last published** Envoy. Envoy's own `verify_examples` job | ||
| runs the examples against Envoy **`main`** (via a local override of this checkout), so each | ||
| side tests a *different* Envoy: examples = the published release (what the example ships), | ||
| envoy = `main` (early warning that a change is about to break an example). `verify_examples` |
f77f966 to
0f61192
Compare
| An example pins and ships the **last published** Envoy. Envoy's own `verify_examples` job | ||
| runs the examples against Envoy **`main`** (via a local override of this checkout), so each | ||
| side tests a *different* Envoy: examples = the published release (what the example ships), | ||
| envoy = `main` (early warning that a change is about to break an example). `verify_examples` | ||
| is **advisory** — it goes red, it does not hard-block an Envoy PR — but a red example is the | ||
| standing expectation that the Envoy change waits until the example is accommodated. |
0f61192 to
6015563
Compare
| @@ -0,0 +1,63 @@ | |||
| # Copilot review instructions — envoyproxy/examples | |||
|
|
|||
| The examples in this repo are **documentation-first sandboxes**: each teaches one | |||
There was a problem hiding this comment.
not strictly accurate - it can teach a combination of features to a given end - eg single-page-app
There was a problem hiding this comment.
Fixed — the intro now says each example teaches a released Envoy feature or a combination of features toward one end (with single-page-app cited); CONTRIBUTING.md's opening matches. (bot assisted)
| `single-page-app`). Flag it when the external hookup is woven into the Envoy | ||
| demonstration rather than appended as reader next-steps, or when the example would not | ||
| demonstrate the Envoy feature with the external service removed. | ||
| 8. **CI registration.** Flag an added example that isn't in `EXAMPLE_TESTS` (`BUILD`) — it |
There was a problem hiding this comment.
this doesnt make any sense - and i dont think these guidelines (need to) go into all the parts needed - that should be obv from previous examples
what it probably should say is that it should be broadly consistent with existing examples
There was a problem hiding this comment.
Fixed — point 8 is now Consistent with existing examples: take the existing sandboxes as the reference rather than any checklist here, and flag only noticeable divergence. Dropped the EXAMPLE_TESTS enumeration (it's obvious from the other examples). (bot assisted)
| config/behaviour changes release-to-release, or where the example would carry workarounds | ||
| for currently-open bugs. That is a conformance suite, not an example — it belongs in | ||
| Envoy's integration and fuzz tests. | ||
| - **One feature, one directory, one PR.** Don't bundle two filters or two sandboxes in a |
There was a problem hiding this comment.
see previous comment - one sandbox, one pr
There was a problem hiding this comment.
Fixed — now One sandbox, one PR (the unit is the sandbox, not the feature; a single example may combine features toward one end). The checklist item is updated to match. (bot assisted)
6015563 to
96923e2
Compare
Examples here are documentation-first sandboxes for released Envoy features. Capture the conventions explicitly so contributors (and reviewers) have something concrete to work to: - CONTRIBUTING.md: what qualifies (released, stable features; one per PR), docs-first, verify.sh as a CI-only 1:1 mirror of the documented steps, the verify-common.sh shape (dynamic ports, published proxy port, no bespoke harness), and the no-third-party rule with the single-page-app exception. - README.md: link to it. - .github/copilot-instructions.md: the same checklist as a review rubric, so Copilot assesses example PRs on this basis. Signed-off-by: Ryan Northey <ryan@synca.io>
96923e2 to
037e3a9
Compare
|
gonna land this - its not perfect - but a good start i think honestly im still trying to figure out workflows envoy <> registry <> examples |


Examples here are documentation-first sandboxes for released Envoy features, but those conventions weren't written down anywhere — so contributors (and reviewers) had nothing concrete to work to. This captures them.
CONTRIBUTING.md— what qualifies (released, stable features; one feature per directory/PR), docs-first (example.rstas numbered Steps),verify.shas a CI-only 1:1 mirror of the documented steps using theverify-common.shhelpers (dynamic ports, published proxy port, no bespoke test harness), and the no-third-party-services rule with the narrowsingle-page-appOAuth exception (Envoy demonstrated first; external hookup last).README.md— links to it..github/copilot-instructions.md— the same checklist as a review rubric, so Copilot assesses example PRs on exactly these points.The guidelines are descriptive of existing good examples (e.g.
ai-transcoder); the immediate motivation was a recent example PR that diverged on most of these axes.(bot assisted)