Skip to content

rename user_id file #7707

Closed as not planned
Closed as not planned
@casperdcl

Description

@casperdcl

Telemetry/analytics are anonymised and can be disabled.

However for unification across Iterative's stack (MLEM, TPI, CML etc.) it's a good idea to put the config in one place. Basically move the existing $CONFDIR/dvc/user_id to $CONFDIR/iterative/telemetry. More explicitly:

import json
from shutil import copy
from pathlib import Path
from appdirs import user_config_dir

# DVC backwards-compatibility
old = Path(user_config_dir("dvc/user_id", "iterative"))
# cross-product path
new = Path(user_config_dir("iterative/telemetry", False))

uid = generate_id() # see above
if uid.lower() == "do-not-track":
    return
if new.exists():
    uid = new.read_text().strip()
else:
    if old.exits():
        uid = json.load(old.open())["user_id"]
    new.write_text(uid)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions