Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions dvc/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,24 @@ def _runtime_info():
"""
Gather information from the environment where DVC runs to fill a report.
"""
from iterative_telemetry import find_or_create_user_id
from iterative_telemetry import _generate_ci_id, find_or_create_user_id

from dvc import __version__
from dvc.utils import is_binary

ci_id = _generate_ci_id()
Copy link
Collaborator

Choose a reason for hiding this comment

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

A private function may break in the future.

if ci_id:
group_id, user_id = ci_id
else:
group_id, user_id = None, find_or_create_user_id()

return {
"dvc_version": __version__,
"is_binary": is_binary(),
"scm_class": _scm_in_use(),
"system_info": _system_info(),
"user_id": find_or_create_user_id(),
"user_id": user_id,
"group_id": group_id,
}


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies = [
"dvc-data==0.36.2",
"dvc-http",
"hydra-core>=1.1.0",
"iterative-telemetry==0.0.6",
"iterative-telemetry==0.0.7",
"dvc-studio-client>=0.1.1"
]
dynamic = ["version"]
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def test_runtime_info(tmp_global_dir):
"scm_class": Any("Git", None),
"user_id": str,
"system_info": dict,
"group_id": Any(str, None),
},
required=True,
)
Expand Down