Skip to content

docs: document per-endpoint noise in keploy.yml - #1007

Open
prabaltripathiofficial wants to merge 6 commits into
mainfrom
docs/endpoint-noise
Open

prabaltripathiofficial wants to merge 6 commits into
mainfrom
docs/endpoint-noise

Conversation

@prabaltripathiofficial

@prabaltripathiofficial prabaltripathiofficial commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

What has changed?

Documents per-endpoint noise (test.globalNoise.endpoints), added in keploy/keploy#5409: ignore a response field for one endpoint (method + path) at its exact place in the body, instead of a global entry that ignores the field name in every response.

versioned_docs/version-4.0.0/running-keploy/configuration-file.md:

  • a new Endpoint noise section after Test-Set noise: a keploy.yml example (under test:), which Test-Cases a rule applies to (required, case-sensitive path; optional method; {name} segments; host, query and trailing / ignored), exact body paths (any case, optional $.), arrays (items.at == items[].at, no positions, top-level arrays), {id} keys and which keys count as IDs, exact header names, value patterns, overlaps (first rule decides for the same field; rules on different fields all apply; a Test-Case's own noise wins; global field names cannot be narrowed), that streamed and gRPC responses and mock matching are not affected, and that keploy cloud replay adds the dashboard's rules after keploy.yml's;
  • the globalNoise bullet and the closing note mention the new field.

Related: keploy/keploy#5409 (feature), keploy/enterprise#3515, keploy/k8s-proxy#1409, keploy/enterprise-ui#2169. Merge when keploy#5409 and keploy/enterprise#3515 are released and keploy/enterprise-ui#2169 is deployed (the cloud-replay sentence and the dashboard depend on them).

Type of change

  • Documentation update (if none of the other choices apply).

How Has This Been Tested?

A Markdown-only change to one existing page; no new page, sidebar entry or component. Every {name}/{id} is inside inline code or a fenced block, so MDX does not parse it. I did not run yarn build / yarn serve locally (the machine could not hold the site's dependencies); the PR's build and Vale checks cover it.

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.

test.globalNoise gets an endpoints list (keploy/keploy#5409): noise for
one endpoint, at an exact field path from the top of the response body.
The configuration page now describes the rule's shape, which tests it
applies to, how body paths, arrays, id keys, patterns and overlaps are
read, and how keploy cloud replay combines keploy.yml's rules with the
ones saved in the dashboard.

Signed-off-by: Prabal Tripathi <prabaltripathiofficial@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 08:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Review fixes: a top-level array starts from its elements' keys
(`version` or `[].version`); endpoint noise does not apply to streamed
or gRPC responses; `{id}` in a body path is defined (which keys count as
IDs, and that a new ID is still a difference); body paths match without
case and may start with `$.`; `path` is required and case-sensitive;
header names match exactly; how rules on different fields and global
field names combine. The example sits under `test:` and uses a date
pattern that does not expire. Keploy terms and serial commas follow
STYLE.md.

Signed-off-by: Prabal Tripathi <prabaltripathiofficial@gmail.com>
Review round 2: say plainly that streamed and gRPC responses get no
endpoint rules, and that a global or test-set field name ignores the
field in the responses it applies to.

Signed-off-by: Prabal Tripathi <prabaltripathiofficial@gmail.com>
@prabaltripathiofficial

Copy link
Copy Markdown
Member Author

Review rounds

An independent reviewer checked every statement in the new section against keploy/keploy#5409's code (and keploy/enterprise#3515 for cloud replay), round after round until a round found nothing new.

Round Result Fixed in
1 3 🟡: the top-level array example was wrong; "applies to HTTP test responses" overclaimed (streamed and gRPC responses are not covered); {id} was not defined. Plus nits: case, required path, headers, overlaps, example under test:, style f51a94d
2 Two wording nits 933d991
3 No new findings

In brief

  • The section describes test.globalNoise.endpoints: one endpoint, an exact field path, how arrays, {id}, patterns and overlaps are read, and that cloud replay adds the dashboard's rules after keploy.yml's.
  • The YAML example was parsed to check it loads as the rules shown.

@Shivanipandey31 Shivanipandey31 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: #1007 at 933d991, approve with follow-ups

Scope: I read the whole diff and the surrounding configuration-file.md (version 4.0.0, the latest in versions.json). I checked every statement in the new section against keploy/keploy#5409 at 7155a37 and keploy/enterprise#3515 at de7fbc4, and drove the overlap rules through keploy's real matcher with a throwaway test (deleted afterwards). I reviewed this together with keploy/keploy#5409, keploy/enterprise#3515, keploy/k8s-proxy#1409 and keploy/enterprise-ui#2169. I didn't run yarn build; the PR pipeline covers it. Not run live.

Verified fine:

  • Request matching. path is case-sensitive; host, query and a trailing / are ignored; {name} matches one non-empty segment; method is case-insensitive (pathMatches / endpointMatches, keploy pkg/matcher/http/endpoint_noise.go:64-99).
  • Body paths are exact apart from case, cover their subtree, and take an optional $.. items.at is the same field as items[].at, and items[0].at matches nothing (ExactPath, exactCovers, pkg/matcher/noise_exact.go).
  • {id} keys: a UUID, a ULID, 16+ hex characters with a digit, or 10+ digits (IsIDKey, minIDHexLen = 16, IDKeyMinDigits = 10). IDs added only by the replay are not excused (lookup skips id-key entries for added keys).
  • Headers are matched exactly, case-insensitively, so X-Build does not match X-Build-Id (headerKeyCovers).
  • Overlaps. The first rule naming a field decides (takenBody in AddEndpointNoise). A test case's own noise wins. A global field name cannot be narrowed, because dot-free global keys are checked before the path index (pkg/matcher/utils.go:747). "A rule on data covers data.version wherever it is in the list" also holds: I probed rules [data: [], data.version: [^v1\.]] in both orders against a v2.0 value, and both pass.
  • SSE, gRPC and mock matching are untouched: the streaming path and compareGRPCResp build noise without the rules (pkg/service/replay/replay.go:5763, :9406), and mock matching is unchanged.

Gates: Markdown only. The site build and Vale are left to the PR pipeline.

Earlier reviews

Reviewer Point Status
Copilot Unable to review No points
@prabaltripathiofficial (review rounds) round 1 Top-level array example wrong; "applies to HTTP test responses" overclaimed; {id} undefined; nits (case, required path, headers, overlaps, example under test:) ✅ Fixed (C): array line now version or [].version; the streamed/gRPC sentence is added; {id} is defined with the exact thresholds
same, round 2 Two wording nits ✅ Fixed (C)

Minor

M1. The cloud replay sentence is wrong for keploy cloud replay --trigger, where keploy.yml's endpoint rules are not applied at all. (inline)

Claims ledger

Claim Status Evidence
The section matches keploy#5409's behaviour ✅ Verified See "Verified fine"
"keploy cloud replay adds the dashboard's rules after keploy.yml's, so your rule decides" ⚠️ Partly True for a local cloud replay (enterprise#3515 unionEndpointNoise). False under --trigger (M1). Also, a dashboard rule on an enclosing field (data) still ignores your data.version whatever your pattern, as the overlaps bullet says
"Every {name}/{id} is inside inline code or a fenced block, so MDX does not parse it" ✅ Verified Every brace in the added lines sits inside backticks or the yml fence
The YAML example loads as the rules shown ✅ Verified (C) Keys and list shapes match config.EndpointNoise (method, path, body, header)
Merge gate: after keploy#5409 and enterprise#3515 are released and enterprise-ui#2169 is deployed ✅ Agree The cloud-replay sentence and the dashboard mention depend on them

Cross-repo / linked PRs

Field names, defaults and behaviour match keploy#5409's config.EndpointNoise and enterprise#3515. Merge last, as the PR says.

What I'd want before merge

  1. M1: one sentence on --trigger.

…ules

Signed-off-by: Prabal Tripathi <prabaltripathiofficial@gmail.com>
@Shivanipandey31

Copy link
Copy Markdown
Contributor

Re-review at ae65c03, following my review at 933d991: approve.

M1 is fixed. The section now ends with "With --trigger, the replay runs in the cluster with only the rules saved in the dashboard; the rules in keploy.yml are not applied." That matches enterprise#3515 at 858d26c: on the --trigger path it warns that keploy.yml's test.globalNoise (including Endpoints) is not applied, and the in-cluster replay uses the stored noise (pkg/service/cloud/cloud.go:2075-2081). The new sentence has no braces, so MDX is unaffected. All 6 checks pass on ae65c03. Nothing open in this PR. It still merges last: after keploy#5409 is released, enterprise#3515 and k8s-proxy#1409 re-pin and release, and enterprise-ui#2169 is deployed.

@charankamarapu charankamarapu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The section is clear and matches keploy#5409 on paths, arrays, {id}, values, the first rule deciding, and the cloud replay / --trigger behaviour. One sentence is wrong against the code today:

an endpoint rule can't narrow a field name in global or test-sets

That holds for body fields. It is false for headers: with global x-build: [] and a rule X-Build: ['^b-'], a live c-2 fails, because the rule's exact entry outranks the global one (repro on keploy#5409). I've asked for the code to be fixed to match this sentence, not the other way round, so keep the sentence and merge only after that fix ships. If the decision goes the other way, the sentence has to say headers differ.

Merge order in the description is right (after keploy#5409 + enterprise#3515 are released and enterprise-ui#2169 is deployed).

@prabaltripathiofficial

prabaltripathiofficial commented Nov 26, 2026 •

Copy link
Copy Markdown
Member Author

Thanks @charankamarapu. The code now matches the sentence: keploy/keploy#5409 d78444aa8 resolves a rule apart from global and test-set noise, for headers and for dotted body keys, which had the same bug. I kept the sentence and made it say the rest (2bd9f4d):

An endpoint rule only adds to global and test-sets, for body fields and headers alike: version: [] or X-Build: [] there ignores that field in every response it applies to, whatever an endpoint rule's patterns say. When both give patterns for a field, a value that either one's patterns match is ignored.

It also notes that keploy test warns about a rule that can never match (keploy#5409 2b1bbf3d8). The merge order is unchanged: this goes last.

A rule cannot narrow a body field or a header that global or test-set
noise covers, and where both give patterns, a value either one matches
is ignored. keploy test warns about a rule that can never match.

Signed-off-by: Prabal Tripathi <prabaltripathiofficial@gmail.com>

@charankamarapu charankamarapu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review at 2bd9f4d: approve. The overlap bullet now matches keploy#5409 at 2e71e30: a rule only adds to global/test-sets, for headers and body alike, and when both sides give patterns, a value either one's patterns match is ignored. The new "Rules that match nothing" bullet matches WarnEndpointNoiseProblems. Merge last, as the description says.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants