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

Fixes #2474 - Properly send along the submit_type to the server. #2477

Merged
merged 1 commit into from
Jun 3, 2018

Conversation

miketaylr
Copy link
Member

Thanks for finding this bug @karlcow.

This underscores a critical weakness: we need functional tests for bug creation (ideally that don't create real bugs so we don't get labelled as spammers).

r? @karlcow

Note: tags v11.0.0 and v11.0.1 aren't safe to deploy, but we'll cut v11.0.2 and deploy that once this is merged.

@miketaylr miketaylr requested a review from karlcow June 1, 2018 21:05
@@ -90,7 +90,7 @@ class IssueForm(FlaskForm):
[Optional(),
FileAllowed(Upload.ALLOWED_FORMATS, image_message)])
details = HiddenField()
submit_type = HiddenField(default="submitanon")

This comment was marked as abuse.

@@ -267,7 +267,7 @@ function BugForm() {
};

this.storeClickedButton = function(event) {
this.clickedButton = event.target.value;

This comment was marked as abuse.

@karlcow karlcow mentioned this pull request Jun 2, 2018
@karlcow
Copy link
Member

karlcow commented Jun 3, 2018

This underscores a critical weakness: we need functional tests for bug creation (ideally that don't create real bugs so we don't get labelled as spammers).

In fact it's probably a couple of things here.

  1. Improve /issues/new for form testability  #2479 Most of the parts in this view should be in helpers functions easily testable. The mistake was a missing key in the form dictionary triggering the third abort.
  2. Add unit tests for HTTP POST on test_urls #2480 The HTTP POST on the webcompat side can be tested in unit-tests, as we know what we want to receive and what we want to send back to the browser. The GitHub data just needs to be mocked. To read again stuff in Unit tests for API endpoints #396
  3. Adds logging for failures mode such as HTTP 400. #2481 The Abort 400 should maybe come with a log message.
  4. In this case I have the feeling that 400 was not the appropriate answer, but 500, because it's a failure of our code. So there's probably something to fix here too.
  5. Probably part also of [cleaning] form.py extracts multiple times some values in the same function. #1997 work

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.

Thanks @miketaylr
Wonderful! This is working again. 🎉 time.

Tested Anonymous bug reporting.
And github login. Both are working. Images are working too.

r+ @miketaylr

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.

2 participants