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
Issue #3070 - Add additional logging of experiment branch and IP #3086
Conversation
If the value is the empty string, dict.get() won't actually return the fallback here. But the empty string is falsey, so this will log out 'missing submit_type value'. In the case where submit_type doesn't exist in the form it will log None.
r? @karlcow |
oops tests |
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.
Let's try I would have probably added the IP for bot reasons.
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.
Houston we got a problem.
.....................E.............................................................................................
======================================================================
ERROR: Assert that we get the form parameters we want.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/circleci/repo/tests/unit/test_form.py", line 248, in test_is_valid_issue_form
self.assertFalse(helpers.is_valid_issue_form(incomplete_form))
File "/home/circleci/repo/webcompat/helpers.py", line 599, in is_valid_issue_form
ab_active('exp') or 'Unknown branch'
File "/home/circleci/repo/webcompat/helpers.py", line 683, in ab_active
if ab_exempt():
File "/home/circleci/repo/webcompat/helpers.py", line 691, in ab_exempt
if g.user and g.user.user_id in app.config['AB_EXEMPT_USERS']:
File "/home/circleci/repo/env/lib/python3.7/site-packages/werkzeug/local.py", line 348, in __getattr__
return getattr(self._get_current_object(), name)
File "/home/circleci/repo/env/lib/python3.7/site-packages/werkzeug/local.py", line 307, in _get_current_object
return self.__local()
File "/home/circleci/repo/env/lib/python3.7/site-packages/flask/globals.py", line 45, in _lookup_app_object
raise RuntimeError(_app_ctx_err_msg)
RuntimeError: Working outside of application context.
This typically means that you attempted to use functionality that needed
to interface with the current application object in some way. To solve
this, set up an application context with app.app_context(). See the
documentation for more information.
-------------------- >> begin captured logging << --------------------
webcompat: INFO: is_valid_issue_form: form[submit_type] => empty submit_type value
webcompat: INFO: is_valid_issue_form: missing param(s)? => {'browser', 'os', 'url', 'submit_type', 'description', 'username'}
--------------------- >> end captured logging << ---------------------
----------------------------------------------------------------------
Ran 115 tests in 1.251s
It doesn't need to log a failure in the test, but in case it did it can now.
Might as well do that now. |
thanks @miketaylr let's merge. |
Thanks, I'll probably deploy tonight or tomorrow at some point. |
I would have done it, but given that I'm in and out. If anything goes wrong, I will not be able to intervene. Thanks mike. |
Yeah, no worries -- I know you're travelling. And I wanted for the morning so we didn't have to sleep on any bad errors. :) |
Tested locally: