Skip to content

ci: add local fallback for sphinx - #20708

Open
KowalskiThomas wants to merge 1 commit into
mainfrom
kowalski/ci-add-local-fallback-for-sphinx
Open

KowalskiThomas wants to merge 1 commit into
mainfrom
kowalski/ci-add-local-fallback-for-sphinx

Conversation

@KowalskiThomas

@KowalskiThomas KowalskiThomas commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Currently facing this issue in CI...

[app] emitting event: 'builder-inited'()
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
Traceback (most recent call last):
  File "/home/bits/.cache/uv/archive-v0/KHGtErO-VClpBgU1/lib/python3.10/site-packages/sphinx/cmd/build.py", line 272, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/bits/.cache/uv/archive-v0/KHGtErO-VClpBgU1/lib/python3.10/site-packages/sphinx/application.py", line 256, in __init__
    self._init_builder()
  File "/home/bits/.cache/uv/archive-v0/KHGtErO-VClpBgU1/lib/python3.10/site-packages/sphinx/application.py", line 315, in _init_builder
    self.events.emit('builder-inited')
  File "/home/bits/.cache/uv/archive-v0/KHGtErO-VClpBgU1/lib/python3.10/site-packages/sphinx/events.py", line 94, in emit
    results.append(listener.handler(self.app, *args))
  File "/home/bits/.cache/uv/archive-v0/KHGtErO-VClpBgU1/lib/python3.10/site-packages/sphinx/ext/intersphinx.py", line 238, in load_mappings
    updated = [f.result() for f in concurrent.futures.as_completed(futures)]
  File "/home/bits/.cache/uv/archive-v0/KHGtErO-VClpBgU1/lib/python3.10/site-packages/sphinx/ext/intersphinx.py", line 238, in <listcomp>
    updated = [f.result() for f in concurrent.futures.as_completed(futures)]
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/bits/.cache/uv/archive-v0/KHGtErO-VClpBgU1/lib/python3.10/site-packages/sphinx/ext/intersphinx.py", line 223, in fetch_inventory_group
    logger.warning(__("failed to reach any of the inventories "
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/logging/__init__.py", line 1847, in warning
    self.log(WARNING, msg, *args, **kwargs)
  File "/home/bits/.cache/uv/archive-v0/KHGtErO-VClpBgU1/lib/python3.10/site-packages/sphinx/util/logging.py", line 122, in log
    super().log(level, msg, *args, **kwargs)
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/logging/__init__.py", line 1879, in log
    self.logger.log(level, msg, *args, **kwargs)
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/logging/__init__.py", line 1547, in log
    self._log(level, msg, args, **kwargs)
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/logging/__init__.py", line 1624, in _log
    self.handle(record)
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/logging/__init__.py", line 1634, in handle
    self.callHandlers(record)
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/logging/__init__.py", line 1696, in callHandlers
    hdlr.handle(record)
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/logging/__init__.py", line 964, in handle
    rv = self.filter(record)
  File "/home/bits/.pyenv/versions/3.10.20/lib/python3.10/logging/__init__.py", line 821, in filter
    result = f.filter(record)
  File "/home/bits/.cache/uv/archive-v0/KHGtErO-VClpBgU1/lib/python3.10/site-packages/sphinx/util/logging.py", line 425, in filter
    raise exc
sphinx.errors.SphinxWarning: failed to reach any of the inventories with the following issues:
intersphinx inventory 'https://docs.python.org/3/objects.inv' not fetchable due to <class 'requests.exceptions.HTTPError'>: 503 Server Error: Service Unavailable for url: https://docs.python.org/3/objects.inv
Warning, treated as error:
failed to reach any of the inventories with the following issues:
intersphinx inventory 'https://docs.python.org/3/objects.inv' not fetchable due to <class 'requests.exceptions.HTTPError'>: 503 Server Error: Service Unavailable for url: https://docs.python.org/3/objects.inv

Claude suggests adding a local fallback, which this PR does.

The PR also adds a CI job that checks we don't get out of date on the local fallback file, but I'm not sure how to best handle this. Ideally, the job should run as part of the nightly pipeline, it should also not make the pipeline fail if it fails due to an outage like we faced today, and it should somehow alert us if we are out of date, in order for us to update the file.

@KowalskiThomas KowalskiThomas added changelog/no-changelog A changelog entry is not required for this PR. CI ci-reliability The PR is related to the CI reliability of dd-trace-py labels Oct 1, 2026
@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.

.gitlab-ci.yml                                                          @DataDog/python-guild @DataDog/apm-core-python
docs/_intersphinx/python3.inv                                           @DataDog/python-guild
docs/conf.py                                                            @DataDog/python-guild
scripts/update-intersphinx-inventory.py                                 @DataDog/python-guild

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

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

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

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

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

Show existing violations (showing 5 of 201 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=132)
ddtrace.profiling.scheduler -×-> ddtrace.trace  (product:profiling -> product:tracing, score=130)
ddtrace.llmobs._integrations.pydantic_ai -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=130)
ddtrace.internal.openfeature._span_enrichment -×-> ddtrace.trace  (product:openfeature -> product:tracing, score=130)
ddtrace.llmobs._integrations.vllm -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=130)

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

@pr-commenter

pr-commenter Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-10-01 13:54:17

Comparing candidate commit 138db99 in PR branch kowalski/ci-add-local-fallback-for-sphinx with baseline commit 57aff59 in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 9 performance regressions! Performance is the same for 607 metrics, 10 unstable metrics, 7 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-b3_headers

  • 🟥 execution_time [+1.079µs; +1.152µs] or [+14.301%; +15.264%]

scenario:httppropagationextract-empty_headers

  • 🟥 execution_time [+89.869ns; +107.763ns] or [+12.179%; +14.604%]

scenario:iastaspects-add_aspect

  • 🟥 execution_time [+9.961µs; +11.264µs] or [+11.925%; +13.485%]

scenario:iastaspects-format_map_noaspect

  • 🟥 execution_time [+98.216µs; +107.756µs] or [+28.076%; +30.803%]

scenario:iastaspectsremodule-re_expand_aspect

  • 🟥 execution_time [+83.941µs; +98.362µs] or [+13.260%; +15.538%]

scenario:msgpackencoderscenario-simple_one_span

  • 🟥 execution_time [+455.678ns; +519.483ns] or [+10.959%; +12.494%]

scenario:openfeatureflagevaluation-hook-enqueue-typical

  • 🟥 execution_time [+1.634µs; +1.787µs] or [+7.573%; +8.282%]

scenario:recursivecomputation-shallow

  • 🟥 execution_time [+53.216µs; +56.504µs] or [+7.576%; +8.044%]

scenario:span-start-finish-telemetry

  • 🟥 execution_time [+4.644ms; +4.831ms] or [+11.403%; +11.861%]

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 [-817.514ns; +667.289ns] or [-7.765%; +6.338%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-47.357ns; +33.342ns] or [-7.061%; +4.972%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1995.350ns; +1842.006ns] or [-10.009%; +9.240%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1601.374ns; +2077.573ns] or [-8.469%; +10.988%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-420.330ns; +345.439ns] or [-9.778%; +8.036%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-272.758ns; +188.047ns] or [-10.023%; +6.910%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-106.316ns; +83.845ns] or [-7.808%; +6.157%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-6.197µs; +3.182µs] or [-12.585%; +6.461%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-1172.412ns; +728.457ns] or [-11.409%; +7.089%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-54677.584ns; +54026.660ns] or [-9.680%; +9.564%]

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:httppropagationinject-ids_only

  • 🟥 execution_time [+2.923µs; +3.047µs] or [+20.501%; +21.369%]

scenario:iastaspects-translate_aspect

  • 🟥 execution_time [+96.154µs; +100.860µs] or [+13.971%; +14.655%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+141.513µs; +148.400µs] or [+37.431%; +39.252%]

scenario:iastaspectssplit-rsplit_aspect

  • 🟥 execution_time [+30.126µs; +33.698µs] or [+19.444%; +21.749%]

scenario:span-start

  • 🟥 execution_time [+0.924ms; +1.360ms] or [+7.331%; +10.783%]

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

  • 🟥 execution_time [+247.091ns; +286.284ns] or [+12.663%; +14.671%]

scenario:tracer-small

  • 🟥 execution_time [+42.583µs; +43.956µs] or [+17.323%; +17.881%]

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-rstrip_aspect
  • scenario:iastaspects-swapcase_aspect
  • scenario:iastaspects-title_noaspect
  • 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

@KowalskiThomas
KowalskiThomas marked this pull request as ready for review October 1, 2026 10:03
@KowalskiThomas
KowalskiThomas requested review from a team as code owners October 1, 2026 10:03
@KowalskiThomas
KowalskiThomas requested review from Yun-Kim and juanjux and removed request for a team October 1, 2026 10:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T13:28:34.529869Z 138db99 New commits
🔒 Security Review ✅ Completed 2026-10-01T13:29:05.964151Z 138db99 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 846d2b2dd5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/update-intersphinx-inventory.py Outdated
Comment thread scripts/update-intersphinx-inventory.py Outdated
@KowalskiThomas
KowalskiThomas force-pushed the kowalski/ci-add-local-fallback-for-sphinx branch from 846d2b2 to 138db99 Compare October 1, 2026 13:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 138db997a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .gitlab-ci.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog A changelog entry is not required for this PR. CI ci-reliability The PR is related to the CI reliability of dd-trace-py

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants