Repository navigation
[Demo option D: scan, then a ruff card] Review learning: rule changes from 2026-10-20 to 2026-11-18 - #8619
Closed
robertomonteromiguel wants to merge 4 commits into
Closed
[Demo option D: scan, then a ruff card] Review learning: rule changes from 2026-10-20 to 2026-11-18#8619robertomonteromiguel wants to merge 4 commits into
robertomonteromiguel wants to merge 4 commits into
Conversation
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Demo, not to merge. Option D: same changes as #8614, #8616 and #8617. The workflow does not process comments on this PR.
Note
Monthly review learning. 8 changes to the code review rules, learned from the 364 PRs merged from 2026-10-20 to 2026-11-18.
Review them in Files changed.
okkeeps a change,discardputs the rule back, a suggestion replaces lines. Once a day, a workflow applies the answers and replies.META-006·INFRA-011·LIFE-002·TEST-001·TEST-004New rules
Each card is the shape of a ruff rule: what it does, why it is bad, a bad line, a good line.
META-010
Match each manifest version range to the versions that have the behavior. ·
activation-and-metadata· P1What it does. A manifest range starts at the first release that has the behavior, on every weblog the entry covers, and it stops before a later version that replaces that behavior.
Why is this bad. No rule checks the range. META-002 and META-007 only cover the version prefix and the dev or RC version. Three PRs set a range that was too wide.
Example
Use instead
v2.10.1keeps the legacydd.serialIdclass active on every later Go version.Evidence
dd.serialIdclass for every Go version from v2.10.1."v2.11.0-devfor Go."TEST-008
Assert every expectation that the contract defines. ·
test-effectiveness· P0What it does. A test checks each expectation its contract defines, on each subject. It does not merge subjects into a sum, and it does not drop the error path.
Why is this bad. A summed count still passes when one subject is wrong. No current rule names that gap.
Example
Use instead
Validate the shared flag separately for the opted-out subject and the allowed subject.
Evidence
_assert_context_evaluation, as its two siblings do."result.featuresexpectations for hook, exposure, and evaluation metadata, which this runner doesn’t assert."TEST-009
Prove that the test reached the behavior under test. ·
test-effectiveness· P0What it does. The test fails when the behavior under test does not run. The app must not swallow an error and report success.
Why is this bad. A status check then proves only that the route exists. This is not the absence case of TEST-002.
Example
Use instead
Accept only the expected exception. Any other failure returns HTTP 500.
Evidence
multiValueHeaders, whileparse_alb_lambda_output(..., multi=False)"New cases
The rule already exists. The line is the case we add. Open it for one bad line, one good line, and the quotes.
META-006— a marker with no reason, a file-wide skip, a flaky marker on a wrong expectation, or a declaration left behind after its endpoint existsAdded to Detect
flakydeclaration hides a wrong test expectation.incomplete_test_appdeclaration names, and the declaration stays.Example
Use instead
Remove the declaration once
/add_eventexists, or name the real cause and let the tests that pass run.Evidence
missing_featureentries have no reason."/add_eventexists do you need to update"INFRA-011— a script that continues after a failed command, or a swallowed import that looks like a missing featureAdded to Detect. The current line only names bash (
2>/dev/null,|| true, a pipeline withpipefailoff).Restart-Service.ImportErrorof a dependency, so a broken install looks like a missing feature.Example
Use instead
Stop when the restart fails. A failed restart leaves the agent off the mocked backend.
Evidence
mcp.pyfile feels a bit fragile"LIFE-002— a timeout that ends before the last flush, an exact flush count, or a wait that returns as soon as the expected count arrivesAdded to Detect. The current line only names a fixed sleep and a poll with no deadline.
Example
A wait returns as soon as 2 spans show up, so a third span in a later flush is never seen.
Use instead
Wait long enough to see a later flush, then assert the count.
Evidence
library_interface_timeout=15here."TEST-001— an exact stats-request count, a timing-dependent outcome, or a comparison against ajson.dumpsstringAdded to Detect. The current line covers exact sampled flags,
len(tracestate) == 1, rawx-datadog-tags, and a short marker searched in a whole payload.json.dumpsstring instead of the parsed value.Example
Use instead
Assert the stats payload. A periodic flush may split it into more than one request.
Evidence
dropped >= 1will flake"JSON.stringifygives"TEST-004— a check that treats1asTrue, or rejects a valid1.0Added to Detect. The current line covers raw field comparisons, a sampling-priority field read directly, and a path filter that lists only
/v0.4/tracesor/v0.5/traces.1forTrueor rejects a valid1.0.Example
Use instead
Compare bools as bools, in both directions, and accept
1.0where the value may be a float.Evidence
1.0or0.0and not pass the test here"Wording
Same meaning, other words. You can leave these closed.
Nothing this month. A line in this lane would read like this, and it would not be a new case:
8 more changes, each from one PR. They stay out of the diff. Comment
add INFRA-014to apply one.INFRA-005ifdepends on a step that some runs skip, so those runs save no logs.INFRA-007curlorwgetand has no retry.INFRA-008INFRA-014INFRA-015LIFE-003TEST-005TEST-0076 defects that a rule already describes
META-009· a named scenario has no step in.github/workflows/run-end-to-end.yml. #8080INFRA-010· new weblog endpoints are missing fromend-to-end_weblog.md. #7425INFRA-006· a new base image that the mirroring job does not pick up. #8121INFRA-011·findwith2>/dev/nullpiped towc -lis already the example in the rule. #8572TEST-005· an expected field depends oncontext.libraryinside the assertion. #8306TEST-002· absence tests have no enabled control, and the PR adds askip.ymlentry. #8144How to answer, and the rest of the run
On each rule, in Files changed
ok,LGTMor a thumbs up: keep the change.discardordiscard: <reason>: put the rule back as it is onmain. Outside a review thread, name the rule, for examplediscard LIFE-002.add INFRA-014: apply one folded change. Name the rule id.Not when:. Later runs read the rules.This PR only edits
.agents/rules/code-review/. It never merges by itself. A person fromsystem-tests-coreapproves it. The next monthly run publishes nothing while it is open.Not applied
INFRA-013Not rule material
Coverage. test-effectiveness 11 · lifecycle-and-isolation 4 · activation-and-metadata 4 · infrastructure-and-conventions 14. 65 candidates went to another lens. 0 quotes failed to match. 16 fixes were linked to their cause. 33 proposals were considered.
Run. The workflow run in Datadog.