fix(telemetry): honor the SCRAPEGRAPHAI_TELEMETRY_ENABLED env var - #1119
Open
hakoke wants to merge 1 commit into
Open
fix(telemetry): honor the SCRAPEGRAPHAI_TELEMETRY_ENABLED env var#1119hakoke wants to merge 1 commit into
hakoke wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1118.
_check_config_and_environ_for_telemetry_flagre-read the config file inside the env var branch, so the opt-out documented in the README never had any effect. The branch now parses the variable's value with the same true/false strings configparser accepts (1/yes/true/on, 0/no/false/off, any casing). The env var wins over the config file since it is the more explicit setting, and unrecognized values keep the default instead of raising, matching how the config path already behaves.Verified by importing the package in a subprocess for each value: false, False, FALSE, 0, no and off now disable telemetry, true, 1, yes and on keep it enabled, unset keeps the current default, and a config file value is still honored when the variable is not set. The nine test files that CI runs pass before and after the change. Happy to add a small unit test for this function and register it in test-suite.yml if you want one.