-
Notifications
You must be signed in to change notification settings - Fork 643
WIP: Teams #177
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
WIP: Teams #177
Conversation
Oh, closes #137 |
739d162
to
6ee2bef
Compare
All old tests pass locally now. Moving on to making new tests. |
@@ -174,8 +175,9 @@ impl Crate { | |||
}))); | |||
|
|||
try!(conn.execute("INSERT INTO crate_owners | |||
(crate_id, user_id, created_at, updated_at, deleted) | |||
VALUES ($1, $2, $3, $3, FALSE)", | |||
(crate_id, owner_id, created_by, created_at, |
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.
Note: I added the created_by field here while debugging a test failure cause by something else. Not sure why it wasn't being set and whether it should be set.
Status Update: I have tested this out locally by hand and everything seems to be working!!! I just need to write some unit tests. (oh nooo mocking) |
VALUES ($1, $2, $3, $3, FALSE)", | ||
(crate_id, owner_id, created_by, created_at, | ||
updated_at, deleted, owner_kind) | ||
VALUES ($1, $2, $2, $3, $3, FALSE, 0)", |
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.
Could you refactor this literal 0 into something like OwnerKind::User as i32
?
|
||
pub fn github(app: &App, url: &str, auth: &Token) | ||
-> Result<curl::http::Response, curl::ErrCode> { | ||
println!("HTTP: {}", url); |
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.
s/println/info/
|
||
let resp = try!(http::github(app, | ||
&format!("http://api.github.com/orgs/{}/teams", org_name), | ||
&http::token(req_user.gh_access_token.clone()))); |
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.
Could you stylistically break this up into:
let url = ...;
let token = ...;
let resp = try!(http::github(app, &url, &token));
OK, I just hooked up coveralls to this repo so in theory when you rebase you'll start seeing coverage information published, and it's a good check to see if at least most of the branches and such were taken during the tests perhaps? |
Awesome, thanks so much @gankro! I've added some extra things here and there and pushed to master. |
This is completely untested
I just got it to compile, and wanted to get this up for the bikesheddy part of review while I start setting up testing and stuff.
Some of the JSON schemas still probably need to be updated to yield duplicate fields for bridging legacy and clarity. I don't think Cargo needs to be modified at all (teams are Just Another Name as far as it should be concerned), but I might be forgetting something.