-
Notifications
You must be signed in to change notification settings - Fork 196
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 #2024 - Adds the ability to receive POST data with a JSON Payload #2582
Conversation
Also, all the clients we control that create issues via this form need to be updated. |
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 looks great, just a few questions to make sure that I understand how this works. Haven't tested locally yet, but that's the next step once I have a few more answers. Then we can deploy this thing to staging.
Could you also rebase against master, that will make deploying to staging a tiny bit simper. 😻 |
Rebasing against master. Definitely! |
This goes through the possible scenarios when requesting the form with a POST or a GET.
This will help us determine how we want to process the data when requesting.
This is handling a form_data object as a dictionary which is in charge of containing the data relative to the future Form()
…submission The tests were not defining the type and were then sending url-encoded stuff, which is not what we do in the HTML.
This is a minimal test which could become more complete if we wanted.
A lot of the data can be collected at first request.
…ith a body The new form interaction are two folds 1. GET with parameters or POST with a body 2. POST as a multipart form to GitHub
Just polishing things here and there.
Rebased and pushed. Let's see what travis said. |
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 is great.
Only "unresolved" issue is #2582 (comment), which isn't really an issue. We can leave it as-is and file a follow up, or make a decision it's the right way, or change it as I described in my comment. No strong feelings.
I've (temporarily? not seeing much pretriage activity...) deployed this branch to staging and when I try to file an issue: 502 Bad Gateway 2018/09/20 20:35:02 [error] 6998#0: *1839287 upstream prematurely closed connection while reading response header from upstream, client: xxx, server: staging.webcompat.com, request: "POST /issues/new HTTP/1.1", upstream: "uwsgi://unix:///tmp/uwsgi-staging.sock:", host: "staging.webcompat.com", referrer: "https://staging.webcompat.com/" Trying to investigate more. |
Once I log in, I'm able to file reports just fine. Logging out, and trying to report anonymously I get the following stack trace:
Let me ensure I'm using the right credentials, I did mess with that to help out a contributor, and maybe deployed the wrong thing to staging. |
OK, not a credentials thing. It seems if I'm not logged in, and I click "report Anonymously", I get a 502. |
Ah!
|
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 add proxy=True to report_issue
, then I'll re-deploy to staging.
Do you remember why we are using |
1. Addresses the PR review 2. Adds tests for case for the submit type is wrong 3. Makes the reporting request a bit stricter.
We could probably pass again form_data again later when we need it for more complex things.
@miketaylr this is working now for anonymous users. It can be deployed again on staging. :) |
No, I don't remember if this was an intentional design decision (to allow it to be used outside of a form submission context), or just like, the way we wrote it. :S |
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.
Looks great. Will do some quick testing on staging.
All good in my testing. Let's mergeeeeeee 💯 🍰 🌵 |
(ok, so the "Update branch" button does a merge commit, that's lame :P) |
This PR fixes issue #2024
Proposed PR background
This should be able to receive POST data with a JSON body for pre-populating the form.
Possible Follow up issues to fill.
The next step will be to push this to staging so we can test it deeply and thoroughly.
r? @miketaylr