Skip to content

ci: block new AIDEV-* comment anchors - #19876

Draft
vlad-scherbich wants to merge 1 commit into
mainfrom
vlad/block-new-aidev-anchors
Draft

ci: block new AIDEV-* comment anchors#19876
vlad-scherbich wants to merge 1 commit into
mainfrom
vlad/block-new-aidev-anchors

Conversation

@vlad-scherbich

Copy link
Copy Markdown
Contributor

Description

Split of #19517, slice 1 of 2 (block new). Independent of the follow-up that converts existing anchors.

Guild decision: stop using AIDEV-NOTE: / AIDEV-TODO: / AIDEV-QUESTION: prefixes in favor of plain inline comments.

This PR only adds the policy and the gate:

  • Update AGENTS.md and cursor rules so new anchors are not added
  • Add scripts/check_no_new_aidev_anchors.py (diff-scoped: added lines only; legacy anchors are grandfathered)
  • Wire a GitLab CI job modeled on check_added_file_size (includes GIT_DEPTH: "0" to match that job on current main)
  • Exclude the new script from pyproject.toml exclude_dirs

It does not rewrite existing AIDEV-* comments in product code.

Testing

  • Pre-commit hooks passed on this branch
  • Confirm check_no_new_aidev_anchors runs on the MR and is skippable on main / release / merge-queue
  • python3 scripts/check_no_new_aidev_anchors.py --base-ref origin/main is clean on this branch (no new anchors in this diff)

Risks

Low. Docs/rules plus a CI check that only inspects added diff lines. Existing anchors keep working until the conversion PR lands.

Additional Notes

Guild decision: stop using AIDEV-NOTE/TODO/QUESTION prefixes in favor of
plain inline comments. Update AGENTS.md and cursor rules, and add a
diff-scoped CI check so new anchors fail while legacy ones are grandfathered.
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

There are 3 circular imports that already exist on the base branch and have not been changed by this PR.

ddtrace.llmobs -> ddtrace.llmobs._evaluators -> ddtrace.llmobs._evaluators.format -> ddtrace.llmobs._experiment -> ddtrace.llmobs
ddtrace.errortracking._handled_exceptions.bytecode_injector -> ddtrace.errortracking._handled_exceptions.callbacks -> ddtrace.errortracking._handled_exceptions.collector -> ddtrace.errortracking._handled_exceptions.bytecode_reporting -> ddtrace.errortracking._handled_exceptions.bytecode_injector
ddtrace.appsec._asm_request_context -> ddtrace.appsec._iast._iast_request_context_base -> ddtrace.appsec._iast._iast_env -> ddtrace.appsec._iast.reporter -> ddtrace.appsec._exploit_prevention.stack_traces -> ddtrace.appsec._asm_request_context

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

There are 240 dependency direction violations that already exist on the base branch and have not been changed by this PR.

Show existing violations (showing 5 of 240 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=135)
ddtrace.internal.ci_visibility.api._base -×-> ddtrace.trace  (product:ci_visibility -> product:tracing, score=133)
ddtrace.appsec._contrib.django -×-> ddtrace.trace  (product:appsec -> product:tracing, score=133)
ddtrace.llmobs._integrations.google_adk -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=133)
ddtrace.internal.openfeature._span_enrichment -×-> ddtrace.trace  (product:openfeature -> product:tracing, score=133)

To see all violations, download the layers-base.json and layers-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/layers.py compare layers-base.json layers-pr.json

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Pipelines  Tests

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 6 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741238-d2b8243-manylinux2014_x86_64, 1] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-py | build linux serverless: [arm64, cp315-cp315, v113741357-d2b8243-manylinux2014_aarch64, 1] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-py | build linux: [arm64, cp315-cp315, v113741357-d2b8243-manylinux2014_aarch64] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

View all 6 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 10 jobs - 10 passed on retry View in Datadog

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 991d147 | Docs | View more details | Give us feedback!

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Codeowners resolved as

Resolved from the full PR diff against main using the target branch CODEOWNERS file.
CODEOWNERS team requests not listed below are not required by the current file set.

.cursor/rules/ai-guard.mdc                                              @DataDog/asm-python
.cursor/rules/dd-trace-py.mdc                                           @DataDog/python-guild
.gitlab-ci.yml                                                          @DataDog/python-guild @DataDog/apm-core-python
AGENTS.md                                                               @DataDog/python-guild
pyproject.toml                                                          @DataDog/python-guild
scripts/check_no_new_aidev_anchors.py                                   @DataDog/python-guild

@pr-commenter

pr-commenter Bot commented Aug 26, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-26 18:12:02

Comparing candidate commit 991d147 in PR branch vlad/block-new-aidev-anchors with baseline commit 85486fa in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 6 performance regressions! Performance is the same for 580 metrics, 10 unstable metrics, 1 known flaky benchmarks, 17 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:httppropagationextract-tracecontext_headers

  • 🟥 execution_time [+2.405µs; +2.595µs] or [+7.550%; +8.144%]

scenario:httppropagationinject-ids_only

  • 🟥 execution_time [+2.333µs; +2.431µs] or [+14.242%; +14.845%]

scenario:iastaspects-repr_aspect

  • 🟥 execution_time [+41.305µs; +47.769µs] or [+11.491%; +13.289%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+116.066µs; +121.701µs] or [+29.448%; +30.877%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+523.170ns; +561.172ns] or [+19.427%; +20.839%]

scenario:tracer-small

  • 🟥 execution_time [+33.558µs; +35.364µs] or [+10.523%; +11.089%]

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:coreapiscenario-context_with_data_listeners

  • unstable execution_time [-726.980ns; +753.415ns] or [-6.587%; +6.826%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-30.819ns; +35.788ns] or [-5.081%; +5.900%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1722.685ns; +1581.292ns] or [-10.098%; +9.269%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1384.604ns; +1146.635ns] or [-10.485%; +8.683%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-331.842ns; +319.218ns] or [-9.060%; +8.716%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-260.845ns; +245.309ns] or [-8.988%; +8.453%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-78.872ns; +66.590ns] or [-6.551%; +5.531%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-3951.603ns; +4119.951ns] or [-9.569%; +9.977%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-739.169ns; +801.906ns] or [-9.078%; +9.849%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-59851.047ns; +57953.444ns] or [-9.586%; +9.283%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:span-start

  • 🟥 execution_time [+1.454ms; +1.704ms] or [+10.796%; +12.649%]

Known flaky benchmarks without significant changes:

  • scenario:errortrackingflasksqli-baseline
  • scenario:flasksimple-iast-get
  • scenario:iastaspects-casefold_aspect
  • scenario:iastaspects-casefold_noaspect
  • scenario:iastaspects-index_aspect
  • scenario:iastaspects-ljust_noaspect
  • scenario:iastaspects-lower_aspect
  • scenario:iastaspects-replace_aspect
  • scenario:iastaspects-swapcase_aspect
  • scenario:iastaspects-title_noaspect
  • scenario:iastaspects-translate_aspect
  • scenario:iastaspects-translate_noaspect
  • scenario:iastaspects-upper_noaspect
  • scenario:packagespackageforrootmodulemapping-cache_off
  • scenario:packagespackageforrootmodulemapping-cache_on
  • scenario:sethttpmeta-all-enabled
  • scenario:telemetryaddmetric-record-100-metrics

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