Skip to content
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

Merged
merged 4 commits into from Nov 13, 2019

Conversation

miketaylr
Copy link
Member

Tested locally:

[2019-11-12 14:35:18,817] INFO in views: 127.0.0.1 b'http://example.com'
[2019-11-12 14:35:18,818] INFO in helpers: is_valid_issue_form: form[submit_type] => empty submit_type value
[2019-11-12 14:35:18,818] INFO in helpers: is_valid_issue_form: missing param(s)? => set()
[2019-11-12 14:35:18,818] INFO in helpers: is_valid_issue_form: experiment branch => form-v1
[2019-11-12 14:35:18,818] INFO in views: 400: POST request w/o valid form (is_valid_issue_form).

Mike Taylor added 2 commits November 12, 2019 14:27
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.
@miketaylr
Copy link
Member Author

r? @karlcow

@miketaylr
Copy link
Member Author

oops tests

Copy link
Member

@karlcow karlcow left a 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.

webcompat/helpers.py Show resolved Hide resolved
Copy link
Member

@karlcow karlcow left a 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.
@miketaylr
Copy link
Member Author

Let's try I would have probably added the IP for bot reasons.

Might as well do that now.

@miketaylr miketaylr changed the title Issue #3070 - Add additional logging to find out experiment branch Issue #3070 - Add additional logging of experiment branch and IP Nov 12, 2019
@karlcow
Copy link
Member

karlcow commented Nov 13, 2019

thanks @miketaylr let's merge.

@karlcow karlcow merged commit de5895d into master Nov 13, 2019
@miketaylr miketaylr deleted the issues/3070/3 branch November 13, 2019 02:33
@miketaylr
Copy link
Member Author

Thanks, I'll probably deploy tonight or tomorrow at some point.

@karlcow
Copy link
Member

karlcow commented Nov 13, 2019

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.

@miketaylr
Copy link
Member Author

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants