-
Notifications
You must be signed in to change notification settings - Fork 351
Rewrote /user/current to Go #3996
Conversation
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
|
Refer to this link for build results (access rights to CI server needed): |
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.
think about using sqlx structscan? and sqlx for the query above instead of using $1,$2,$3,$4. With a big parametrized query like this I worry about maintenance/debugging
121193c to
85d0d51
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
16e21a5 to
a4317d2
Compare
|
Refer to this link for build results (access rights to CI server needed): |
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.
Manually testing looks great.
One thing I did notice is the perl implementation requires certain fields to be defined. Do we want to carry that requirement through?
{
"alerts": [
{
"level": "error",
"text": "fullName is required"
},
{
"level": "error",
"text": "email is required"
},
{
"level": "error",
"text": "role is required"
},
{
"level": "error",
"text": "username is required"
}
]
}
mhoppa
left a comment
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.
manual tests work and so do API tests
|
Refer to this link for build results (access rights to CI server needed): |
|
Eh. I don't think that difference is actually going to break anyone, and I did make sure identifiers can't be null. And to be honest I'm sick to death of working on this. |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
7065204 to
a50e728
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
can you rebase? |
715dbbc to
ac250df
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
dee0e0b to
6c12c6e
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
mitchell852
left a comment
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.
unit tests, api tests, ui tests and manual TP test passed.
What does this PR (Pull Request) do?
This rewrites the previously unimplemented PUT handler of
/user/currentinto Go. It adds support in both the Go and Python clients, with some associated testing as well as documentation updates.This differs from the way the endpoint was handled in Perl - in Perl, every field in the request was optional (under the top-level "user" object, obviously) and only those included would be updated - as though it were a PATCH request. This instead demands a full representation of a user as is proper for PUT. Additionally, the Perl returned only a success message, this handler returns a representation of the user as it exists following the update.Pursuant to a mailing list discussion changing this endpoint's behavior - albeit for the better - was shot down, and I re-rewrote it to implement Perl-style PATCH-like behavior.
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Build a TO RPM, start Traffic Ops, make a
PUTrequest to/user/current, run the Go client/API integration tests, build and read the documentation.The following criteria are ALL met by this PR