Skip to content

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

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

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

Conversation

@dd-apm-ecosystems

@dd-apm-ecosystems dd-apm-ecosystems Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Note

Monthly review learning. 7 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 47 35 7

Changes in this PR

Rule Lens Change Why Evidence
META-010 activation-and-metadata new rule: Gate each test at the version that ships its behavior. No rule covers activation version boundaries. #7844 · #7967 · #7970 · #8093 · #7972
META-006 activation-and-metadata sharpen Detect META-006 already says to match the marker to the real cause, but its Detect misses three cases. #8128 · #8072 · #8087
INFRA-011 infrastructure-and-conventions new rule: Authenticate GitHub API calls in image builds. Two absences show the same defect. #8039 · #8040
INFRA-013 infrastructure-and-conventions new rule: Stop the session when provisioning fails. In the AWS SSI flow, unknown provisioning errors were only stored on the VM object, and the CentOS 7 Docker install never checked its result. #8042 · #8136
LIFE-005 lifecycle-and-isolation new rule: Stop the session when scenario infrastructure fails. Both candidates show a setup or provisioning failure that is not raised where it happens. #8042 · #8136
TEST-006 test-effectiveness sharpen Detect Test apps that invent config defaults, always return OK, or misuse the tracer API produce the result the test expects in place of the SDK. #7994 · #8182
TEST-008 test-effectiveness new rule: Assert every expectation of each case. No rule names assertion gaps in which some declared expectations are aggregated, skipped, or loosely compared, so wrong output passes. #8080 · #8093 · #8139
7 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
INFRA-012 infrastructure-and-conventions new rule: Exclude local build output from the Docker build context. The Rust weblog and parametric builds were added without .dockerignore entries for their target/ folders, so the build context reached 18 GB. #8001
LIFE-002 lifecycle-and-isolation sharpen Detect LIFE-002 already says to use library_interface_timeout for the flush window. #8093
LIFE-006 lifecycle-and-isolation new rule: Replace an earlier Remote Config instead of stacking it. Two Remote Config files stay active at the same time, so the test result depends on the order in which the SDK applies them. #8087
TEST-004 test-effectiveness sharpen Detect Mocked responses keyed by trace intake path stopped applying when a tracer moved to /v1.0/traces. #7829
TEST-005 test-effectiveness sharpen Detect An unconditional fallback that exists only to let one tracer pass weakens the shared assertion in the same way a library branch does. #7876
TEST-007 test-effectiveness sharpen Detect Asserting the gRPC content-type on a capture that the test agent forwards over HTTP could not pass, and a manifest entry hid this. #8072
TEST-002 test-effectiveness sharpen Detect Opt-out tests checked only configured flags, so an SDK that leaked telemetry on the evaluation error path passed. #8080

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

The Rust weblog and parametric builds were added without .dockerignore entries for their target/ folders, so the build context reached 18 GB. No rule covers .dockerignore.

Proposed:

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

  • Severity: P1
  • Flag: A new weblog, parametric app, or binary can write local build output folders. The same pull request must exclude those folders in .dockerignore.
  • Detect: A new build writes a folder such as target/ under utils/build/docker/ or binaries/, and no .dockerignore pattern excludes it.

Proposed severity: P1. A large build context makes builds slow and large, but it does not change test results.

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 timeout that is too short, so the weblog stops before the SDK emits the final telemetry.

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 or polls without a deadline. It increases an arbitrary delay instead of waiting for an observable condition. A scenario flush timeout is shorter than the interval at which the SDK emits the data under test.

Evidence:

  • #8093 correction: "Set library_interface_timeout=15 here."

LIFE-006 · new rule: Replace an earlier Remote Config instead of stacking it. · lifecycle-and-isolation

Two Remote Config files stay active at the same time, so the test result depends on the order in which the SDK applies them. This is a state isolation defect between setup steps. LIFE-003 covers config versions, not configs stacked at different paths.

Proposed:

LIFE-006: Replace an earlier Remote Config instead of stacking it.

  • Severity: P0
  • Flag: Each Remote Config change in a test must replace the earlier config at the same path or remove it. Several active configs apply in an order that depends on the SDK.
  • Detect: A setup sends a second Remote Config at a new path, and the first config stays active. A flaky marker hides the resulting nondeterminism.
  • Not when: The test checks how the SDK combines several active configs.

Proposed severity: P0. The SDK applies the configs in an order that depends on the SDK, so the test can pass or fail for the wrong reason.

Evidence:

TEST-004 · sharpen Detect · test-effectiveness

Mocked responses keyed by trace intake path stopped applying when a tracer moved to /v1.0/traces. Detect only named path filters.

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 Agent response lists only /v0.4/traces or /v0.5/traces.

Evidence:

TEST-005 · sharpen Detect · test-effectiveness

An unconditional fallback that exists only to let one tracer pass weakens the shared assertion in the same way a library branch does.

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. An assertion helper adds a fallback that accepts a non-spec payload so that one library passes.

Evidence:

  • #7876 correction: "If .NET is the only SDK not adding a timestamp at the root of the payload, why don't we align .NET with the other SDKs"

TEST-007 · sharpen Detect · test-effectiveness

Asserting the gRPC content-type on a capture that the test agent forwards over HTTP could not pass, and a manifest entry hid this.

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. The test asserts a header or field that the test agent rewrites before capture.

Evidence:

TEST-002 · sharpen Detect · test-effectiveness

Opt-out tests checked only configured flags, so an SDK that leaked telemetry on the evaluation error path passed.

Current:

A test expects no spans, logs, metrics, or events, and no assertion shows that data when the feature is on. Its control bypasses the proxy or receiver used for the absence check. A new entry in utils/scripts/activate_easy_wins/skip.yml is a review signal for this case.

Proposed:

A test expects no spans, logs, metrics, or events, and no assertion shows that data when the feature is on. Its control bypasses the proxy or receiver used for the absence check. A suppression test covers only the success path, while the error path can also emit data. A new entry in utils/scripts/activate_easy_wins/skip.yml is a review signal for this case.

Evidence:

  • #8080 correction: "Please add opt-out cases on the evaluation error path."
Full evidence of the 7 changes in this PR

META-010 · new rule: Gate each test at the version that ships its behavior. · activation-and-metadata

No rule covers activation version boundaries. META-002 and META-007 cover only version syntax and RC matching. Several PRs added class-level gates that turned on methods for releases without the behavior. One PR left a legacy-behavior class unbounded after an SDK change. Another left out an active release line in a version range.

Proposed:

META-010: Gate each test at the version that ships its behavior.

  • Severity: P0
  • Flag: A method that needs behavior from a later release than its class must have its own version declaration. A class that tests behavior an SDK later changed must stop at the version before the change. A version gate for a change on several active release lines must cover each line.
  • Detect: A class-level version activates a method whose behavior shipped in a later release. A version gate starts before the SDK emits the data that the test needs. A class that tests a legacy behavior has no upper version bound. A version range in a manifest or tests/parametric/capabilities.yml omits an active release line.

Proposed severity: P0. A gate that is too broad or too narrow makes a test fail for the wrong reason on versions without 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 #7795)
  • #8093 correction: "Gate this class at v2.11.0-dev for Go."
  • #7972 miss (culprit #7917)

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

META-006 already says to match the marker to the real cause, but its Detect misses three cases. Some new missing_feature entries had no reason at all. An incomplete_test_app entry hid a test that no library could pass. A flaky marker hid a setup with two Remote Config files active at once.

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. A marked test fails during setup from invalid configuration or a missing secret, and the marker does not describe it. A new declaration has no reason. A marker blames the library, but a test defect causes the failure. For example, no library can pass the assertion, or the test setup is nondeterministic.

Evidence:

  • #8128 correction: "don't carry a reason, so later it might be hard to tell which ones are blocked by"
  • #8072 miss (culprit #7795)
  • #8087 miss (culprit #7556)

INFRA-011 · new rule: Authenticate GitHub API calls in image builds. · infrastructure-and-conventions

Two absences show the same defect. The dotnet parametric and cpp_nginx Dockerfiles got the github_token secret but never mounted it, and the cpp_nginx scripts made ad-hoc unauthenticated calls. No rule in any lens covers build secrets or GitHub API calls.

Proposed:

INFRA-011: Authenticate GitHub API calls in image builds.

  • Severity: P1
  • Flag: A build script that calls the GitHub API must use the shared get_latest_release helper and the github_token secret. Each Dockerfile step that calls the API must mount that secret with RUN --mount=type=secret,id=github_token. A change to the secret flow must update every language Dockerfile in the same pull request.
  • Detect: The build passes --secret id=github_token, and a Dockerfile step that calls the GitHub API has no secret mount. A script calls the releases API with wget or curl and no token or no --fail. A script prints the token under set -x.

Proposed severity: P1. Unauthenticated calls hit rate limits and break or slow builds, but they do not by themselves hide a test failure.

Evidence:

INFRA-013 · new rule: Stop the session when provisioning fails. · infrastructure-and-conventions

In the AWS SSI flow, unknown provisioning errors were only stored on the VM object, and the CentOS 7 Docker install never checked its result. Failures then showed up later in unrelated steps. LIFE-001 covers only test setup methods, not infrastructure provisioning.

Proposed:

INFRA-013: Stop the session when provisioning fails.

  • Severity: P0
  • Flag: A VM provisioning or warmup step must check that its result works. If it fails, it must stop the session. Do not store an unknown error and then run every test against a broken environment.
  • Detect: A provisioning step installs a package or an engine and never checks it, for example with docker info. An error handler stores an unknown provisioning error and continues instead of calling pytest.exit.

Proposed severity: P0. A broken environment makes every test fail for the wrong reason and hides the real provisioning failure.

Evidence:

LIFE-005 · new rule: Stop the session when scenario infrastructure fails. · lifecycle-and-isolation

Both candidates show a setup or provisioning failure that is not raised where it happens. It shows up later as unrelated test or step failures. LIFE-001 only allows setup to fail and does not require an early abort. No other rule covers this.

Proposed:

LIFE-005: Stop the session when scenario infrastructure fails.

  • Severity: P0
  • Flag: A failed provisioning, warmup, or install step must stop the session with a clear error. A provisioning step must verify its result, for example with docker info. Do not store the error and run every test against a broken environment.
  • Detect: A provisioning error handler stores an unknown error and continues the session. An install step exits 0 without checking that the installed tool works.

Proposed severity: P0. Tests then fail for the wrong reason, with misleading messages that hide the real provisioning failure.

Evidence:

TEST-006 · sharpen Detect · test-effectiveness

Test apps that invent config defaults, always return OK, or misuse the tracer API produce the result the test expects in place of 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 returns a made-up default instead of None for a setting the SDK does not support. It catches every exception and still returns OK. Its span helpers ignore the stored parent or write fields the tracer does not use.

Evidence:

  • #7994 miss (culprit #6917)
  • #7994 correction: "If we don't support the feature (or it's missing), then shouldn't this be None?"
  • #8182 correction: "Would it make sense to catch only InvocationTargetException"

TEST-008 · new rule: Assert every expectation of each case. · test-effectiveness

No rule names assertion gaps in which some declared expectations are aggregated, skipped, or loosely compared, so wrong output passes.

Proposed:

TEST-008: Assert every expectation of each case.

  • Severity: P0
  • Flag: The test must assert every expectation that a case declares. Check each subject on its own. Do not sum counts across subjects. A new sibling test must use the shared assertion helper of its siblings. Compare booleans by type, because 1 == True in Python.
  • Detect: A test sums expected counts across subjects for a shared flag. A test skips the assertion helper that its siblings use. Imported fixtures hold expectations, such as result.features, that the runner never asserts. A bool check passes for the value 1.

Proposed severity: P0. Expectations that are summed, skipped, or never asserted let mutated or swapped captures pass, which hides failures.

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, which this runner doesn’t assert."
  • #8080 correction: "Please compare bool-ness in both directions here."
8 defects that a rule already describes
  • META-006 · activation-and-metadata: The tracer has a gap in a feature it must support, but the manifest declared it missing_feature instead of bug. #8001
  • META-009 · activation-and-metadata: A new end-to-end scenario was added without its step in run-end-to-end.yml. #8080
  • INFRA-005 · infrastructure-and-conventions: The tag step follows a junit upload in one shell: bash (-e) script with no trap. #7945
  • INFRA-006 · infrastructure-and-conventions: A new base image that the mirroring job does not pick up is the defect INFRA-006 describes. #8121
  • TEST-001 · test-effectiveness: TEST-001 Detect already names a redaction check that searches a whole payload for the short marker 1234. #7937
  • TEST-001 · test-effectiveness: TEST-001 Detect already flags comparing x-datadog-tags as a raw ordered string. #8015
  • TEST-002 · test-effectiveness: TEST-002 already requires an enabled control for absence checks, which is the fix the reviewer asked for. #8144
  • TEST-006 · test-effectiveness: TEST-006 Detect already names a weblog that adds runtime-id or another tag the SDK must produce. #8001
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.

Not applied

Rule Action Status Reason
INFRA-008 sharpen not_enough_evidence needs a fix, an applied maintainer correction, or two PRs

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

  • #7839 human_only: Reviewer questioned whether a piece of the OTEL_METRIC_EXPORT_INTERVAL parametric test setup was needed; the author applied a change.
  • #7980 context: CI: the one-pipeline template include is pinned to a release tag instead of a sha, because the libdatadog-build release workflow updates references and opens PRs in the tracer repositories.
  • #7977 context: Manifests: cpp trace filter tests were marked flaky, but the flakiness was already fixed in the dd-trace-cpp repository.
  • #8153 human_only: test_the_test: tests added for system-tests test classes (FFE EVP contract), which are already heavily exercised by CI, instead of being reserved for framework internals

Coverage: test-effectiveness 14 · lifecycle-and-isolation 5 · activation-and-metadata 7 · infrastructure-and-conventions 9. 63 candidates went to another lens. 1 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
robertomonteromiguel deleted the review-learning/run-2026-10-01-86175665 branch November 19, 2026 09:10
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