-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat: Exit before_command_run if telemetry consent is passed through kedro run #681
Conversation
Signed-off-by: lrcouto <laurarccouto@gmail.com>
@@ -107,6 +107,10 @@ def before_command_run( | |||
if not project_metadata: # in package mode | |||
return | |||
|
|||
for arg in command_args: |
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.
Doesn't this mean though that using the --telemetry
flag is the same as opting out? If we return at this point, no data will be sent even if the user provided "yes" to the flag.
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 imagined the person would only use the flag once and then on subsequent runs that would be handled, but you're right. I'm going to look over this one again.
Signed-off-by: lrcouto <laurarccouto@gmail.com>
Signed-off-by: lrcouto <laurarccouto@gmail.com>
Changed the code to bypass the |
Why, then, did we create other PRs for the Kedro CLI? Perhaps that task can be handled within that hook for all commands? |
We'd still need at the very least to have a PR that introduces the "--telemetry" flag to the |
In that case, I believe it would be better to put all the logic for validating the answer and writing to the file into that hook (since it was already there previously). We can then add just a few lines to the Kedro CLI to initialise that command. This approach avoids duplication and ensures the same logic is used for all commands. Do you know why that hook doesn't work on |
The hook does get called on the "new" command, but the prompt to consent is called the first time a Kedro CLI command is used inside the project directory. You can test this by creating a new project, using a command like "kedro --version" outside the project directory, and then inside. The consent prompt will be shown when you do it inside the project directory. Because of that, if you set the .telemetry file to already have a response on project creation, it'll skip the prompt. We could do all of the validation and writing for the |
It seems like in kedro-org/kedro#3876, for a In my head, if It seems strange that one run command decides the telemetry collection for all subsequent commands. We could add |
I agree with your point, but for me, it's more about naming. We can change it to |
In a vacuum, a do agree with this notion that you should be able to use the command to decide if telemetry will be collected on a run by run basis, but the idea of this specific task was to introduce a CLI option that reproduces the behavior of the prompt the user gets when running the CLI on a project for the first time, and that writes on the If we were to do that, I'd change the name of the flag so it doesn't become confusing, since we have another one with the same name that does change the Changing the prompt to consent or not to telemetry to project creation instead of on the first CLI run would need to change when the plugin first becomes available, and it's a bit out of the scope of this specific task. But we could discuss that and maybe open another issue. |
Also, if we do want to rethink how this is going to work, should we revert kedro-org/kedro#3876? With only that one merged and not this one, it will allow the user to set consent through a flag but the prompt will override it. |
Yeah, it might be useful but it's a strange thing to do as an option for the
That I think could be a separate issue. Out of scope for this discussion For now I think -
|
I agree with @ankatiyar proposals that setting telemetry on I also concur with @lrcouto that we should finalise the feature design before proceeding with the coding. The PR, which has already been merged, is not currently properly functioning. It seems that we will need the next sprint to agree on a new solution and implement it. Therefore, I support reverting the previous PR and rethinking the approach to avoid blocking the current release. |
Just left a comment here before everyone jump in, I asked @astrojuanlu to clarify the requirements here. I think both solutions are correct but the main question here is what the desired user journey. |
Thanks all for your thoughts on this. I've looked at the original tickets and comments and I agree that the feature ask actually wasn't clear here. I interpreted it the same way as @lrcouto did, thinking that I still think that the way @lrcouto built it is my ideal approach, but would be good to get a product view from @astrojuanlu |
PR for reversion here in case we want it: kedro-org/kedro#3888 We could go either way, proceed as it is or revert and go back to the drawing table. |
To recap on how we got here: The original user problem was described in kedro-org/kedro#1640:
Then in kedro-org/kedro#2867 a solution was proposed, but it fixated in And in the middle of the implementation kedro-org/kedro#3701, we realised that adding that flag to So in kedro-org/kedro#3701 (comment) we agreed to add "a similar flag" to But indeed, we never fully clarified what said flag was supposed to do. I do agree with @ankatiyar that it's weird for
I suggested that we take this to
This is an idea we hadn't considered yet and maybe worth giving a second thought. At least it decouples As a user, going to my CI runs and changing |
Conceptually this de-coupling is cleaner, but I don't know if it's really useful. This would work equally well:
At the end, the only one cares about telemetry is us, users certainly won't switch telemetry on if it's off already. What if the flag simply set |
From my understanding, the main idea of this flag would be avoiding an automated run to stop because of the consent prompt, in a CI situation or similar. Our own e2e tests, for example, are manually creating the |
After discussing this a bit more internally, we decided to revert this PR. I'll give a proper rationale in kedro-org/kedro#1640 but essentially, the way we will solve the problem of "telemetry prompt blocking unattended environments" is actually removing the prompt, rather than adding a Thanks everybody for the thoughtful discussion here, the requirements weren't clear and @lrcouto you did the right thing 🙏🏼 Let's close this one and go with kedro-org/kedro#3888. |
Description
Works together with kedro-org/kedro#3876.
Modifies the
before_command_run
hook inkedro-telemetry
to exit if the user has passed the telemetry consent through the flag onkedro run
.Development notes
Checklist
RELEASE.md
file