Skip to content

Error reports from source builds are counted as a release #179

Backlog

Description

@dg-dayhaysoos

Summary

Once error reporting is back on (branch feat/telemetry-new-sentry-project, not merged yet), dg decides whether it is a release by reading its own install metadata. That covers the documented contributor setup: an editable install (uv sync, pip install -e .) sends nothing.

It does not cover a checkout that is built and installed the ordinary way. Such a build sends error reports to the same Sentry project as a release, labelled with the last released version.

Decision needed: accept that, or change the release workflow so that only the artifacts it produces can report.

What is covered today

How dg was installed Sends reports?
PyPI (pip, uv tool, pipx), Homebrew, the install script, the npm launcher Yes, as intended
Editable install from a checkout (uv sync, pip install -e ., make dev) No
A checkout put on PYTHONPATH No
pip install ., uv tool install . or uv sync --no-editable from a checkout Yes
Wheels from make build or uv build, installed locally Yes
An image built from the repo's Dockerfile Yes in principle (see Impact)
A released dg with one of its packages replaced by a local build or an editable one Yes (only the deepctl package's metadata is checked)

Why the current check can't close the gap

The check reads direct_url.json (PEP 610) from the installed metadata. An editable install says so there. A local directory build records dir_info: {}, and so does a Homebrew install, because the formula builds from the PyPI sdist in a directory. Treating every local directory build as "not a release" would turn reporting off for Homebrew users. Nothing else in an installed wheel says who built it.

Impact

  • No new data leaves the machine. A report from a source build holds the same allowlisted fields as any other (docs/telemetry.md): no paths, values, messages or keys.
  • The reports are misleading. The version in pyproject.toml only changes at release, so a report from modified code is filed under the last released version. Its line numbers may not match that release, and a contributor's work-in-progress crash can look like a production bug or raise an alert.
  • It should be rare. All of these have to hold: someone installs a non-editable build from a checkout; a command fails with an unexpected error (not a usage or API error); no opt-out is set (CI turns reporting off by itself); and an earlier run has shown the first-run notice at a terminal.
  • Docker is mostly covered already. A new container starts with an empty cache, so every run counts as a first run and sends nothing, unless the cache directory is kept in a volume. The side effect is that docker run -it prints the first-run notice every time.

Options

1. Leave it as it is

No work. Watch the Sentry project for reports that don't fit a release (see the last section) and revisit if they appear.

2. Stamp release builds

The source tree ships with no destination. release.yml turns it on just before make build, for example by writing a small generated module into deepctl-telemetry. Only artifacts from the release workflow can then report, whatever way they are installed.

  • Covers every row in the table, and doesn't depend on install metadata.
  • The PyPI sdist has to carry the stamp, because Homebrew builds from it. Someone who builds from a released sdist would still report, which is fine: that is release code.
  • It changes the publish path. If the stamp step is skipped or breaks, a release ships with reporting silently off. The test or verify-published job needs a check that the built wheel has a destination and the source tree doesn't.
  • The test suite runs against the source tree, where reporting would be off. One CI job should run the telemetry tests against stamped wheels, with a loopback sink.
  • A local make build no longer produces the same wheels as a release.
  • Roughly a day of work including a dry-run release. It can't be verified end to end without running the release workflow.

3. Label instead of block

Add a tag such as cli.install (index or local) from direct_url.json, so local builds can be filtered out in Sentry. It can't tell Homebrew from pip install . unless the formula changes, and it adds a field to the published schema.

4. Small steps that combine with option 1

  • ENV DEEPCTL_TELEMETRY_DISABLED=1 in the Dockerfile. An image built from the repo is a source build, and this also stops the repeated first-run notice.
  • A line in CONTRIBUTING.md: set DEEPCTL_TELEMETRY_DISABLED=1 when installing a non-editable build from a checkout.
  • Check every first-party package for an editable install, not only deepctl. This covers a released dg with one editable package.

Recommendation

Option 1 with the Dockerfile line from option 4 now. Move to option 2 if reports show up that don't match a release.

How to tell whether it is happening

A report whose stack frames don't line up with the tagged source for its release (a function at a line where the release has something else) came from modified code.

Activity

  1. added
    enhancement
    on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions