Repository navigation
Review learning: rule changes from 2026-10-01 to 2026-10-31 - #8588
dd-apm-ecosystems[bot] wants to merge 5 commits into
Conversation
|
|
|
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
remove this, does not make sense for us
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
redefine the prompt
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
Applied the sharpen of TEST-004 (Detect) in 9a33fcd. The review learning workflow answers once a day. It does not read this reply. |
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.Changes in this PR
META-010INFRA-013INFRA-014TEST-006TEST-008TEST-0099 more changes with evidence from one PR only. They stay out of the diff. Comment
add <ID>to apply one.META-006META-011INFRA-012LIFE-005LIFE-002TEST-004TEST-005TEST-007TEST-010dropped >= 1assertion depended on request timing against a 1/s limit.META-006· sharpen Detect · activation-and-metadataMETA-006 asks for one reason per cause, but its Detect misses new per-class declarations that have no reason at all.
Current:
Proposed:
Evidence:
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-metadataThe reviewer asked for the @rfc metadata decorator on classes that implement an RFC. No rule in any lens names this.
Proposed:
Proposed severity: P1. A missing RFC link loses traceability but does not hide failures or change test results.
Evidence:
correction: "Please add@rfc(...)on this class."INFRA-012· new rule: Exclude local build output from the Docker build context. · infrastructure-and-conventionsNo 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:
Proposed severity: P1. A large build context slows builds, but it does not change what is tested.
Evidence:
absence(culprit #7288)LIFE-005· new rule: Replace an earlier Remote Config file instead of stacking a second one. · lifecycle-and-isolationNo 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:
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:
miss(culprit #7556)LIFE-002· sharpen Detect · lifecycle-and-isolationLIFE-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:
Proposed:
Evidence:
correction: "Worth also settinglibrary_interface_timeout(perhaps 10s)?"TEST-004· sharpen Detect · test-effectivenessThe 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:
Proposed:
Evidence:
absence(culprit #6412)TEST-005· sharpen Detect · test-effectivenessA 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:
Proposed:
Evidence:
correction: "why don't we align .NET with the other SDKs so we include that timestamp there as well?"TEST-007· sharpen Detect · test-effectivenessThe 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:
Proposed:
Evidence:
miss(culprit #7795)TEST-010· new rule: Do not assert results that depend on request timing. · test-effectivenessA
dropped >= 1assertion depended on request timing against a 1/s limit. No rule covers nondeterministic outcome assertions, and LIFE-002 covers only waits.Proposed:
Proposed severity: P1. A timing-dependent assertion makes the test flaky, but it does not hide a defect by itself.
Evidence:
correction: "dropped >= 1will 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-metadataSix 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:
Proposed severity: P0. A wrong version gate makes tests fail on supported releases or skip coverage on releases that have the behavior.
Evidence:
correction: "This activates the legacydd.serialIdclass for every Go version from v2.10.1."absence(culprit #7794)absence(culprit #7924)miss(culprit #7917)absence(culprit #7773)correction: "Gate this class atv2.11.0-devfor Go."INFRA-013· new rule: Mount the GitHub token in every build that calls the GitHub API. · infrastructure-and-conventionsTwo 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:
Proposed severity: P1. Unauthenticated calls cause rate-limited, flaky builds, but they do not make tests pass for the wrong reason.
Evidence:
absence(culprit #5449)absence(culprit #4976)INFRA-014· new rule: Stop the run when provisioning fails. · infrastructure-and-conventionsIn 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:
Proposed severity: P1. The tests still fail, but the failures are misleading and hide the real provisioning cause.
Evidence:
miss(culprit #4166)miss(culprit #3420)TEST-006· sharpen Detect · test-effectivenessIn 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:
Proposed:
Evidence:
correction: "If we don't support the feature (or it's missing), then shouldn't this beNone?"miss(culprit #4681)correction: "Would it make sense to catch onlyInvocationTargetException"correction: "theSet-Cookiefrom/session/newnever reaches the client"TEST-008· new rule: Check the type when the contract defines it. · test-effectivenessTwo 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:
Proposed severity: P0. A comparison that ignores the type lets an SDK that coerces values pass for the wrong reason.
Evidence:
correction: "Please compare bool-ness in both directions here."correction: "I think it could be a float with value1.0or0.0and not pass the test here"TEST-009· new rule: Assert every expectation on its own. · test-effectivenessThree 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:
Proposed severity: P0. Merged or skipped expectations let wrong SDK output pass, so the test passes for the wrong reason.
Evidence:
correction: "Please validate the shared flag separately for the opted-out and allowed subjects."correction: "Route this test through_assert_context_evaluation, as its two siblings do."correction: "The imported split-feature cases includeresult.featuresexpectations 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 · #8072META-009· activation-and-metadata: A new end-to-end scenario was not added to run-end-to-end.yml. #8080INFRA-010· infrastructure-and-conventions: New weblog endpoints were added without their section in end-to-end_weblog.md. #7425INFRA-005· infrastructure-and-conventions: Tagging inside an action was skipped when the build failed, and set -e also skipped it. #7945INFRA-011· infrastructure-and-conventions: The script had set -eu without pipefail. #7948INFRA-006· infrastructure-and-conventions: A new base image was not picked up by the mirroring job. #8121TEST-001· test-effectiveness: TEST-001 already names a short redaction marker such as 1234 and a raw-string comparison of x-datadog-tags. #7937 · #8015TEST-002· test-effectiveness: An absence check on a disabled signal with no enabled control is exactly TEST-002. #8144How to answer, and run details
How to answer each change
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:discard LIFE-005.add <ID>: apply a folded change, for example one with evidence from one PR only.Not when:. The next 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.Human-only review and outside context: never rule material.
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.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.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.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.