-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
add DO_NOT_TRACK environment variable support #5000
add DO_NOT_TRACK environment variable support #5000
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that we want two separate flags, SEND_ANONYMOUS_USAGE_STATS and DO_NOT_TRACK. We only want one flag, SEND_ANONYMOUS_USAGE_STATS, but one that can also be set from a DO_NOT_TRACK env var.
Thanks for the review @gshank. Having 2 separate flags for the same feature adds complexity to the feature itself. I changed the code to your proposed solution. the |
Yeah, I realized it would actually be a bit more complicated. But you've done a very nice job of refactoring those bits :) And it does feel better to not have both flags. |
…rue` (#4713) ## What are you changing in this pull request and why? While responding to dbt-labs/dbt-core#9336, I set `DO_NOT_TRACK=0` and examined the result. It does not behave the same way as `DBT_SEND_ANONYMOUS_USAGE_STATS=True`. Looking at the source code [here](https://github.com/dbt-labs/dbt-core/blob/11cc71b75fa64b09888461339eb1eb3b394f9528/core/dbt/cli/flags.py#L252-L254) explains why. So we can safely just remove this line from the docs for [`send_anonymous_usage_stats`](https://docs.getdbt.com/reference/global-configs/usage-stats) to avoid confusion. ## Additional info We first added support for the [Console Do Not Track](https://consoledonottrack.com/) initiative within dbt-labs/dbt-core#5000 as described in dbt-labs/dbt-core#3540. Any of the following are equivalent to `DBT_SEND_ANONYMOUS_USAGE_STATS=False` (whether they are uppercase, lowercase, or mixed case): ``` export DO_NOT_TRACK=1 export DO_NOT_TRACK=t export DO_NOT_TRACK=true export DO_NOT_TRACK=y export DO_NOT_TRACK=yes ``` Any other values of `DO_NOT_TRACK` are ignored altogether and not have any effect. ## Checklist - [x] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines.
resolves #3540
Description
To be compliant with the Console Do Not Track initiative, this PR adds support for the
DO_NOT_TRACK
environment variable.DO_NOT_TRACK
is a generic version of the dbt-specificSEND_ANONYMOUS_USAGE_STATS
variable. Tracking will be disabled if any of these 2 variables specifies that the user does not wish to be tracked.Checklist