-
Notifications
You must be signed in to change notification settings - Fork 237
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
Only ask for usage permission if TTY #697
Only ask for usage permission if TTY #697
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.
This seems like a sensible change to me.
Will require a second review from someone else on the team.
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.
Thanks, @zuzak!
Sorry, actually there's one more thing – would you mind rebasing and adding an entry to the changelog? (We can do this if you prefer.) |
I've not got access to a computer this week; feel free to add the changelog
entry for me, or I'll do it this weekend.
…On Tue, 5 Mar 2019, 10:02 am Oliver Byford, ***@***.***> wrote:
Sorry, actually there's one more thing – would you mind adding an entry to
the changelog?
(We can do this if you prefer.)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#697 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAx3nt7HVsVyYXU1YHkXcwoaQ0E3mNPqks5vTjKxgaJpZM4bRsy->
.
|
You can run the prototype toolkit in a way that does not accept input. A basic example would be: $ npm start | cat If this is the first time you have run the prototype kit, the application will hang as there is no way to respond to the question about recording usage data. This means it is difficult to run the prototype kit solely without user input. This commit changes the behaviour of that prompt to only appear if the user is running the command in a TTY context. If the user is not running the prototype kit in a TTY, the prompt will be skipped and the default action will occur as if the user had simply hit return. In this case, it'll default to "no" and opt the user out of usage data collection automatically. A downside of this approach is that the user will not get asked again if they subsequently run the kit interactively. However, it is unlikely that users will wish to run the prototype kit initially within a pipeline whilst also wishing to run it interactively at a later date. Closes alphagov#695. Another prompt occurs when the chosen port is in use, but this commit doesn't attempt to edit that.
919e98e
to
9644b31
Compare
You can run the prototype toolkit in a way that does not accept input.
A basic example would be:
$ npm start | cat
If this is the first time you have run the prototype kit, the
application will hang as there is no way to respond to the question
about recording usage data. This means it is difficult to run the
prototype kit solely without user input.
This commit changes the behaviour of that prompt to only appear if the
user is running the command in a TTY context.
If the user is not running the prototype kit in a TTY, the prompt will
be skipped and the default action will occur as if the user had simply
hit return. In this case, it'll default to "no" and opt the user out of
usage data collection automatically.
A downside of this approach is that the user will not get asked again
if they subsequently run the kit interactively. However, it is unlikely
that users will wish to run the prototype kit initially within a
pipeline whilst also wishing to run it interactively at a later date.
Closes #695.
Another prompt occurs when the chosen port is in use, but
this PR doesn't attempt to edit that (the other prompt is only going to show when things go wrong, whereas this prompt occurs on the initial run of the app, every time).
I haven't included tests as there's no existing tests for the usage data feature.