Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly disable pantsbuild opt-in anonymous telemetry #5737

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

cognifloyd
Copy link
Member

@cognifloyd cognifloyd commented Sep 20, 2022

Background

This is another part of introducing pants, as discussed in the TSC Meetings on 12 July 2022, 02 Aug 2022 and 06 Sept 2022. Pants has fine-grained per-file caching of results for lint, fmt (like black), test, etc. It also has lockfiles that work well for monorepos that have multiple python packages. With these lockfiles CI should not break when any of our dependencies or our transitive dependencies release new versions, because CI will continue to use the locked version until we explicitly relock with updates.

To keep PRs as manageable/reviewable as possible, introducing pants will take a series of PRs. I do not know yet how many PRs; I will break this up into logical steps with these goals:

  • introduce pants to the st2 repo, and
  • teach some (but not all) TSC members about pants step-by-step.

Other pants PRs include:

Overview of this PR

This PR is independent of other pantsbuild PRs.

This PR configures pants' anonymous telemetry so that it is explicitly disabled (it is already opt-in by default, but we explicitly disable it). It is also configured so that individual developers can enable it if they wish, but--again--it requires an explicit opt-in.

Documentation about anonymous telemetry is available here:
https://www.pantsbuild.org/docs/anonymous-telemetry

We need to either set the repo_id or explicitly disable telemetry to get rid of a non-fatal error pants prints on startup (shown below). I opted to set both so that I can still provide telemetry on my machine, but make the default state (opt-in) explicit to avoid any concerns in our community about telemetry.

$ ./pants --version
Bootstrapping Pants using /opt/local/bin/python3.9
Installing pantsbuild.pants==2.14.0rc1 into a virtual environment at /.../.cache/pants/setup/bootstrap-.../2.14.0rc1_py39
New virtual environment successfully created at /.../.cache/pants/setup/bootstrap-.../2.14.0rc1_py39.
13:56:52.14 [INFO] Initializing scheduler...
13:56:52.41 [INFO] Scheduler initialized.
13:56:52.46 [ERROR] Please set `repo_id = "<uuid>"` in the [anonymous-telemetry] section of pants.toml, where `<uuid>` is some fixed random identifier, such as one generated by uuidgen.

Example (using a randomly generated UUID):

    [anonymous-telemetry]
    repo_id = "6e658bee-a933-4c1b-bba2-1fee8254e653"

No telemetry will be sent for this run. See https://www.pantsbuild.org/v2.14/docs/anonymous-telemetry for details.
2.14.0rc1

If, like me, someone wants to enable anonymous telemetry on their machine, they can add a ~/.pants.rc file:

[anonymous-telemetry]
enabled = true

@cognifloyd cognifloyd added this to the pants milestone Sep 20, 2022
@cognifloyd cognifloyd self-assigned this Sep 20, 2022
@pull-request-size pull-request-size bot added the size/S PR that changes 10-29 lines. Very easy to review. label Sep 20, 2022
enabled = false
# repo_id here allows individuals to opt-in on their machine
# To opt-in, use ~/.pants.rc or envrc to set [anonymous-telemetry].enabled=true
repo_id = "de0dea7a-9f6a-4c6e-aa20-6ba5ad969b8a"
Copy link
Member Author

Choose a reason for hiding this comment

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

I think I generated this with uuidgen when I started the pants PoC.

@pull-request-size pull-request-size bot added size/XS PR that changes 0-9 lines. Quick fix/merge. and removed size/S PR that changes 10-29 lines. Very easy to review. labels Sep 21, 2022
@cognifloyd cognifloyd changed the title Explicitly disable pantsbuild opt-in anonymous telemetry, enable for CI Explicitly disable pantsbuild opt-in anonymous telemetry Sep 21, 2022
@cognifloyd cognifloyd marked this pull request as ready for review September 21, 2022 05:12
@cognifloyd cognifloyd enabled auto-merge (squash) September 21, 2022 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance pantsbuild size/XS PR that changes 0-9 lines. Quick fix/merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants