Using @cached_property to define these prompting functions (which
are, fundamentally, not really properties at all) makes it a lot
harder to reason about what happens when you invoke them. Furthermore,
as far as I'm aware, there's no documented way to clear the cache for
a cached property.
This change is, in the wise words of Mickey Mouse, "a surprise tool
that will help us later".
This Pull Request does not include a changeset. Add a changeset if the change impacts users and should be included in the changelog upon release. Read more about changesets. Ignore this rule by adding [skip changeset] to your Pull Request body. - (More info)
Greet before asking questions
It's just common courtesy.
Do not use @cached_property for prompts
Using
@cached_property
to define these prompting functions (which are, fundamentally, not really properties at all) makes it a lot harder to reason about what happens when you invoke them. Furthermore, as far as I'm aware, there's no documented way to clear the cache for a cached property.This change is, in the wise words of Mickey Mouse, "a surprise tool that will help us later".
Ask for the push API key again if it's invalid
If the push API key does not validate, ask for it again instead of kicking the user out of the installer.
Move the logic out of the install command and to its own function. Spice it up with some emojis (they're free!)
Handle unexpected validation errors
Handle unexpected validation errors, such as AppSignal's servers not being reachable.
Test asking again for API key
Make it so that the
mock_input
context manager can indicate the expectation of an unanswered prompt by usingNone
instead of an answer.When this happens, the expected
StopIteration
that indicates that a prompt was asked for which no answer was given is not raised as an error.Delete several duplicates of
mock_input
and move it to a singleutils.py
file.