Skip to content

Review learning: rule changes from 2026-10-01 to 2026-10-31 - #8588

Closed
dd-apm-ecosystems[bot] wants to merge 5 commits into
mainfrom
review-learning/run-2026-10-01-1a620c58
Closed

dd-apm-ecosystems[bot] wants to merge 5 commits into
mainfrom
review-learning/run-2026-10-01-1a620c58

Conversation

@dd-apm-ecosystems

Copy link
Copy Markdown

Note

Monthly review learning. 6 changes to the code review rules, learned from the 336 PRs merged from 2026-10-01 to 2026-10-31.
Review them in Files changed, and answer on each rule: ok, discard, a suggestion, or a comment. Once a day, a workflow applies the answers and replies.

Merged PRs With human review Fixes linked to their cause Verified lessons Proposals Changes in this PR
336 238 33 48 33 6

Changes in this PR

Rule Lens Change Why Evidence
META-010 activation-and-metadata new rule: Gate each test at the first release that has its behavior. Six candidates show manifest or capabilities.yml version gates that do not match the release containing the asserted behavior: missing method gates, unbounde... #7844 · #7967 · #7970 · #7972 · #8004 · #8093
INFRA-013 infrastructure-and-conventions new rule: Mount the GitHub token in every build that calls the GitHub API. Two pull requests passed the github_token secret but did not mount it in some Dockerfiles. #8039 · #8040
INFRA-014 infrastructure-and-conventions new rule: Stop the run when provisioning fails. In two pull requests, a provisioning failure did not stop the run. #8042 · #8136
TEST-006 test-effectiveness sharpen Detect In several PRs the test app made up the result: it reported defaults for unsupported settings, it swallowed exceptions, and it started spans or set cookies w... #7994 · #8182 · #8128
TEST-008 test-effectiveness new rule: Check the type when the contract defines it. Two PRs found assertions that mixed up booleans and numbers. #8080 · #8130
TEST-009 test-effectiveness new rule: Assert every expectation on its own. Three PRs had weak assertions. #8080 · #8093 · #8139
9 more changes with evidence from one PR only. They stay out of the diff. Comment add <ID> to apply one.
Rule Lens Change Why Evidence
META-006 activation-and-metadata sharpen Detect META-006 asks for one reason per cause, but its Detect misses new per-class declarations that have no reason at all. #8128
META-011 activation-and-metadata new rule: Link the RFC that a test class implements. The reviewer asked for the @​rfc metadata decorator on classes that implement an RFC. #7425
INFRA-012 infrastructure-and-conventions new rule: Exclude local build output from the Docker build context. No rule says that .dockerignore must change when a new build adds local output. #8001
LIFE-005 lifecycle-and-isolation new rule: Replace an earlier Remote Config file instead of stacking a second one. No rule covers state isolation between Remote Config files in one test. #8087
LIFE-002 lifecycle-and-isolation sharpen Detect LIFE-002 already says to use library_interface_timeout for the flush window. #8093
TEST-004 test-effectiveness sharpen Detect The root cause is mocked tracer responses keyed on a fixed list of intake versions. #7829
TEST-005 test-effectiveness sharpen Detect A test-side fallback for one SDK hid an SDK divergence from the payload contract without an explicit context.library check, so the current Detect missed it. #7876
TEST-007 test-effectiveness sharpen Detect The test asserted application/grpc, but the test agent forwards gRPC exports as application/x-protobuf. #8072
TEST-010 test-effectiveness new rule: Do not assert results that depend on request timing. A dropped >= 1 assertion depended on request timing against a 1/s limit. #7425

META-006 · sharpen Detect · activation-and-metadata

META-006 asks for one reason per cause, but its Detect misses new per-class declarations that have no reason at all.

Current:

A marker contradicts its cause, or several exclusions with different causes share one vague reason. A marked test fails during setup because of invalid configuration or a missing required secret that the marker does not describe.

Proposed:

A marker contradicts its cause, or several exclusions with different causes share one vague reason. Several new declarations carry no reason, so readers cannot tell their causes apart. A marked test fails during setup because of invalid configuration or a missing required secret that the marker does not describe.

Evidence:

  • #8128 correction: "don't carry a reason, so later it might be hard to tell which ones are blocked"

META-011 · new rule: Link the RFC that a test class implements. · activation-and-metadata

The reviewer asked for the @​rfc metadata decorator on classes that implement an RFC. No rule in any lens names this.

Proposed:

META-011: Link the RFC that a test class implements.

  • Severity: P1
  • Flag: A test class that implements an RFC must carry the @​rfc(...) decorator with the RFC link.
  • Detect: A new test class implements or cites an RFC and has no @​rfc decorator.

Proposed severity: P1. A missing RFC link loses traceability but does not hide failures or change test results.

Evidence:

  • #7425 correction: "Please add @​rfc(...) on this class."

INFRA-012 · new rule: Exclude local build output from the Docker build context. · infrastructure-and-conventions

No rule says that .dockerignore must change when a new build adds local output. The Rust weblog sent about 18 GB of context to Docker.

Proposed:

INFRA-012: Exclude local build output from the Docker build context.

  • Severity: P1
  • Flag: The root .dockerignore must exclude the local build output of each new weblog or build. Otherwise local artifacts enter the build context and slow every build.
  • Detect: A new Dockerfile builds code whose toolchain writes local output, such as cargo target/. The root .dockerignore has no matching pattern.

Proposed severity: P1. A large build context slows builds, but it does not change what is tested.

Evidence:

LIFE-005 · new rule: Replace an earlier Remote Config file instead of stacking a second one. · lifecycle-and-isolation

No rule covers state isolation between Remote Config files in one test. LIFE-003 matches replies to a config version, but it does not cover an earlier file that stays active and interferes.

Proposed:

LIFE-005: Replace an earlier Remote Config file instead of stacking a second one.

  • Severity: P0
  • Flag: A test that changes the Remote Config of one product must reuse its config path. Otherwise it must remove the earlier file. Several active files can apply in an order that depends on the SDK.
  • Detect: One test sends configs for the same product under different paths, and it never removes the earlier file. A missing flag then appears as a wait timeout.
  • Not when: The test intentionally checks how the SDK combines several active config files.

Proposed severity: P0. Stacked Remote Config files make the result depend on SDK apply order, so the test fails or passes for the wrong reason.

Evidence:

LIFE-002 · sharpen Detect · lifecycle-and-isolation

LIFE-002 already says to use library_interface_timeout for the flush window. Its Detect does not catch a new scenario that leaves this timeout unset, so late telemetry gets lost when the weblog stops.

Current:

A setup or test uses a fixed sleep, polls without a deadline, or increases an arbitrary delay instead of waiting for an observable condition.

Proposed:

A setup or test uses a fixed sleep, polls without a deadline, or increases an arbitrary delay instead of waiting for an observable condition. A new scenario checks data that the library flushes late, such as final telemetry counters, and keeps the default library_interface_timeout.

Evidence:

  • #8093 correction: "Worth also setting library_interface_timeout (perhaps 10s)?"

TEST-004 · sharpen Detect · test-effectiveness

The root cause is mocked tracer responses keyed on a fixed list of intake versions. The current Detect names path filters only, not mocks, so it missed the absent /v1.0/traces mock.

Current:

A test that is not about the encoding compares raw fields, as in span["trace_id"] == expected or meta[key] == "true". A test reads a sampling priority field directly. A path filter lists only /v0.4/traces or /v0.5/traces.

Proposed:

A test that is not about the encoding compares raw fields, as in span["trace_id"] == expected or meta[key] == "true". A test reads a sampling priority field directly. A path filter or a mocked response lists only /v0.4/traces or /v0.5/traces and omits /v1.0/traces.

Evidence:

TEST-005 · sharpen Detect · test-effectiveness

A test-side fallback for one SDK hid an SDK divergence from the payload contract without an explicit context.library check, so the current Detect missed it.

Current:

A condition on context.library changes an assertion in a test_* method or in a helper used only by assertions.

Proposed:

A condition on context.library changes an assertion in a test_* method or in a helper used only by assertions. A shared assertion helper adds a fallback that accepts a field location only one library uses.

Evidence:

  • #7876 correction: "why don't we align .NET with the other SDKs so we include that timestamp there as well?"

TEST-007 · sharpen Detect · test-effectiveness

The test asserted application/grpc, but the test agent forwards gRPC exports as application/x-protobuf. So the test could not pass, and a manifest marker hid a real bug.

Current:

The self-test imports every expected value from the fake. The fake returns a bare body where the real service uses an envelope. The fake sends config for a product the client did not ask for.

Proposed:

The self-test imports every expected value from the fake. The fake returns a bare body where the real service uses an envelope. The fake sends config for a product the client did not ask for. A test asserts a header or transport detail that the test agent rewrites, so no library can pass.

Evidence:

TEST-010 · new rule: Do not assert results that depend on request timing. · test-effectiveness

A dropped >= 1 assertion depended on request timing against a 1/s limit. No rule covers nondeterministic outcome assertions, and LIFE-002 covers only waits.

Proposed:

TEST-010: Do not assert results that depend on request timing.

  • Severity: P1
  • Flag: Do not assert a result that depends on request timing against a rate limit. Keep the assertions that hold for every timing.
  • Detect: A test asserts that a rate limiter dropped at least one item. The test does not control the request rate.

Proposed severity: P1. A timing-dependent assertion makes the test flaky, but it does not hide a defect by itself.

Evidence:

  • #7425 correction: "dropped >= 1 will flake: each request already sleeps ~800ms"
Full evidence of the 6 changes in this PR

META-010 · new rule: Gate each test at the first release that has its behavior. · activation-and-metadata

Six candidates show manifest or capabilities.yml version gates that do not match the release containing the asserted behavior: missing method gates, unbounded legacy classes, missed backports and release lines. No rule covers gate correctness. META-002 and META-007 only cover prefix syntax and RC matching.

Proposed:

META-010: Gate each test at the first release that has its behavior.

  • Severity: P0
  • Flag: A version declaration must match the first release that contains the behavior each test asserts. If a method asserts behavior newer than its class, declare that method separately. If the SDK changes the behavior in a later release, bound the old test with a range. If a change ships on several release lines or as a backport, cover each line.
  • Detect: A new test method asserts behavior newer than its class declaration and has no method entry. A class for legacy behavior has only a minimum version and stays active after the SDK changed. A gate targets the next dev version, but a patch release or another release line already ships the change. Version ranges in tests/parametric/capabilities.yml follow the same rule.

Proposed severity: P0. A wrong version gate makes tests fail on supported releases or skip coverage on releases that have the behavior.

Evidence:

  • #7844 correction: "This activates the legacy dd.serialId class for every Go version from v2.10.1."
  • #7967 absence (culprit #7794)
  • #7970 absence (culprit #7924)
  • #7972 miss (culprit #7917)
  • #8004 absence (culprit #7773)
  • #8093 correction: "Gate this class at v2.11.0-dev for Go."

INFRA-013 · new rule: Mount the GitHub token in every build that calls the GitHub API. · infrastructure-and-conventions

Two pull requests passed the github_token secret but did not mount it in some Dockerfiles. One also bypassed the shared helper. No rule names this.

Proposed:

INFRA-013: Mount the GitHub token in every build that calls the GitHub API.

  • Severity: P1
  • Flag: Every Dockerfile that runs a GitHub API call must mount the github_token secret that the build passes. Install scripts must use the shared get_latest_release helper, not a raw curl or wget call. A secret that is passed but not mounted is silently absent. Then rate limits break the build.
  • Detect: A Dockerfile runs an install script that calls the GitHub API, and its RUN step has no --mount=type=secret,id=github_token. A script calls the GitHub releases API without a token or without --fail.

Proposed severity: P1. Unauthenticated calls cause rate-limited, flaky builds, but they do not make tests pass for the wrong reason.

Evidence:

INFRA-014 · new rule: Stop the run when provisioning fails. · infrastructure-and-conventions

In two pull requests, a provisioning failure did not stop the run. The real cause then showed up later as generic failures. INFRA-011 covers only shell results that decide what is tested.

Proposed:

INFRA-014: Stop the run when provisioning fails.

  • Severity: P1
  • Flag: A failed VM or environment provisioning step must stop the run with that error. It must not record the error and then run every test. A provisioning step must check that the installed tool works before it reports success.
  • Detect: A provisioning error handler stores an unknown error and continues the session. A provisioning step installs a tool and exits 0 without a check such as docker info.

Proposed severity: P1. The tests still fail, but the failures are misleading and hide the real provisioning cause.

Evidence:

TEST-006 · sharpen Detect · test-effectiveness

In several PRs the test app made up the result: it reported defaults for unsupported settings, it swallowed exceptions, and it started spans or set cookies wrongly. So tests passed or failed because of the app and not the SDK.

Current:

The app adds runtime-id or another tag the SDK must produce. It copies SDK result codes into its own map. It forces an exporter that the configuration already selects.

Proposed:

The app adds runtime-id or another tag the SDK must produce. It copies SDK result codes into its own map. It forces an exporter that the configuration already selects. It reports a default value for a setting the SDK does not support, instead of None. It catches every exception and returns OK, so a status-code check always passes. It drives the SDK differently from a real app, so the path under test never runs.

Evidence:

  • #7994 correction: "If we don't support the feature (or it's missing), then shouldn't this be None?"
  • #7994 miss (culprit #4681)
  • #8182 correction: "Would it make sense to catch only InvocationTargetException"
  • #8128 correction: "the Set-Cookie from /session/new never reaches the client"

TEST-008 · new rule: Check the type when the contract defines it. · test-effectiveness

Two PRs found assertions that mixed up booleans and numbers. No rule covers a type check when the contract is strict. TEST-004 covers only the lenient case with is_same_boolean.

Proposed:

TEST-008: Check the type when the contract defines it.

  • Severity: P0
  • Flag: Check the type as well as the value. This applies to a boolean or a number in the contract. In Python, 1 == True and 1.0 == True are both true. The contract can accept True, 1, and "true" as one value. Then use is_same_boolean().
  • Detect: An assertion compares a boolean or a number with == and has no type check. A coerced value then passes.

Proposed severity: P0. A comparison that ignores the type lets an SDK that coerces values pass for the wrong reason.

Evidence:

  • #8080 correction: "Please compare bool-ness in both directions here."
  • #8130 correction: "I think it could be a float with value 1.0 or 0.0 and not pass the test here"

TEST-009 · new rule: Assert every expectation on its own. · test-effectiveness

Three PRs had weak assertions. One summed counts across subjects, one skipped the shared evaluation checks, and one ignored fixture expectations. Wrong captures still passed, and no rule names this.

Proposed:

TEST-009: Assert every expectation on its own.

  • Severity: P0
  • Flag: Check each subject and each fixture expectation on its own. Do not merge expected counts, and do not drop the shared checks that sibling tests run.
  • Detect: A test sums the expected counts of two subjects into one total. A test skips the shared assertion helper that its siblings call. A runner loads fixture expectations, such as result.features, and never asserts them.

Proposed severity: P0. Merged or skipped expectations let wrong SDK output pass, so the test passes for the wrong reason.

Evidence:

  • #8080 correction: "Please validate the shared flag separately for the opted-out and allowed subjects."
  • #8093 correction: "Route this test through _assert_context_evaluation, as its two siblings do."
  • #8139 correction: "The imported split-feature cases include result.features expectations for hook, exposure, and evaluation metadata"
8 defects that a rule already describes
  • META-006 · activation-and-metadata: These candidates use missing_feature or incomplete_test_app for what is a real tracer bug. #8001 · #8072
  • META-009 · activation-and-metadata: A new end-to-end scenario was not added to run-end-to-end.yml. #8080
  • INFRA-010 · infrastructure-and-conventions: New weblog endpoints were added without their section in end-to-end_weblog.md. #7425
  • INFRA-005 · infrastructure-and-conventions: Tagging inside an action was skipped when the build failed, and set -e also skipped it. #7945
  • INFRA-011 · infrastructure-and-conventions: The script had set -eu without pipefail. #7948
  • INFRA-006 · infrastructure-and-conventions: A new base image was not picked up by the mirroring job. #8121
  • TEST-001 · test-effectiveness: TEST-001 already names a short redaction marker such as 1234 and a raw-string comparison of x-datadog-tags. #7937 · #8015
  • TEST-002 · test-effectiveness: An absence check on a disabled signal with no enabled control is exactly TEST-002. #8144
How to answer, and run details

How to answer each change

  • Nothing, ok, LGTM or a thumbs up: keep the change.
  • discard or discard: <reason>: put the rule back as it is on main. Outside a review thread, name the rule: discard LIFE-005.
  • A suggestion block: replace those lines.
  • add <ID>: apply a folded change, for example one with evidence from one PR only.
  • Any other comment on a rule: an agent edits that rule as you ask.
  • A change goes into the diff when its evidence comes from 2 or more distinct PRs. Each change must also pass the evidence thresholds and lint.
  • If the reason of a discard holds for the future, write it in the rule, for example as Not when:. The next runs read the rules.

This PR only edits .agents/rules/code-review/. It never merges by itself: a person from system-tests-core approves it. The next monthly run publishes nothing while it is open.

Human-only review and outside context: never rule material.

  • #7917 context: Remote-config capability handling (SDK_CONFIGURATION vs legacy APM_TRACING bits) depends on the dd-trace-js roadmap and backend decisions discussed outside the repository.
  • #7977 context: The manifest marks the cpp trace filter tests as flaky, but a reviewer cites a fix already made in the dd-trace-cpp repository.
  • #7980 context: The SSI GitLab template include is pinned to a release tag instead of a sha. The reason is an external libdatadog-build release workflow that updates file references and opens PRs in the tracer repos.
  • #8153 human_only: test_the_test: unit tests added for FFE test classes, which are already exercised by CI; test_the_test is meant for system-tests internals.

Coverage: test-effectiveness 13 · lifecycle-and-isolation 4 · activation-and-metadata 5 · infrastructure-and-conventions 11. 57 candidates went to another lens. 0 candidates had a quote that does not match.

Run: the workflow run in Datadog.

@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

.agents/rules/code-review/activation-and-metadata.md                    @DataDog/system-tests-core
.agents/rules/code-review/infrastructure-and-conventions.md             @DataDog/system-tests-core
.agents/rules/code-review/test-effectiveness.md                         @DataDog/system-tests-core

@robertomonteromiguel

Copy link
Copy Markdown
Collaborator

add TEST-004

- ❌ Add a named scenario without its workflow step, even when its scenario groups are otherwise valid.
- Ref: [End-to-end testing rules](../end-to-end-testing.md)

### META-010: Gate each test at the first release that has its behavior.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Kept: no change.

The review learning workflow answers once a day. It does not read this reply.

- Flag: Every Dockerfile that runs a GitHub API call must mount the `github_token` secret that the build passes. Install scripts must use the shared `get_latest_release` helper, not a raw `curl` or `wget` call. A secret that is passed but not mounted is silently absent. Then rate limits break the build.
- Detect: A Dockerfile runs an install script that calls the GitHub API, and its `RUN` step has no `--mount=type=secret,id=github_token`. A script calls the GitHub releases API without a token or without `--fail`.

### INFRA-014: Stop the run when provisioning fails.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

remove this, does not make sense for us

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Discarded INFRA-014 in bc3bb05: the rule is back as it is on main. The reviewer asked to remove this rule because it does not make sense for system-tests.

The review learning workflow answers once a day. It does not read this reply.


### INFRA-013: Mount the GitHub token in every build that calls the GitHub API.
- Severity: P1
- Flag: Every Dockerfile that runs a GitHub API call must mount the `github_token` secret that the build passes. Install scripts must use the shared `get_latest_release` helper, not a raw `curl` or `wget` call. A secret that is passed but not mounted is silently absent. Then rate limits break the build.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

redefine the prompt

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not applied: The comment asks to redefine the prompt and does not say how to change INFRA-013, so I cannot make an edit from it.

The review learning workflow answers once a day. It does not read this reply.

- Flag: Check the type as well as the value. This applies to a boolean or a number in the contract. In Python, `1 == True` and `1.0 == True` are both true. The contract can accept `True`, `1`, and `"true"` as one value. Then use `is_same_boolean()`.
- Detect: An assertion compares a boolean or a number with `==` and has no type check. A coerced value then passes.

### TEST-009: Assert every expectation on its own.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

remove this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Discarded TEST-009 in 9a33fcd: the rule is back as it is on main. The reviewer asks to remove this rule from the pull request.

The review learning workflow answers once a day. It does not read this reply.

@dd-apm-ecosystems

Copy link
Copy Markdown
Author

add TEST-004

#8588 (comment)

Applied the sharpen of TEST-004 (Detect) in 9a33fcd.

The review learning workflow answers once a day. It does not read this reply.

@robertomonteromiguel
robertomonteromiguel deleted the review-learning/run-2026-10-01-1a620c58 branch November 19, 2026 10:45
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.

1 participant