Skip to content

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

Merged
merged 17 commits into from
Aug 18, 2015
Merged

WIP: Teams #177

merged 17 commits into from
Aug 18, 2015

Conversation

Gankra
Copy link
Contributor

@Gankra Gankra commented Aug 6, 2015

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.

@Gankra
Copy link
Contributor Author

Gankra commented Aug 6, 2015

Oh, closes #137

@Gankra
Copy link
Contributor Author

Gankra commented Aug 6, 2015

r? @alexcrichton

@Gankra Gankra force-pushed the teams branch 2 times, most recently from 739d162 to 6ee2bef Compare August 6, 2015 22:54
@Gankra
Copy link
Contributor Author

Gankra commented Aug 6, 2015

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,
Copy link
Contributor Author

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.

@Gankra
Copy link
Contributor Author

Gankra commented Aug 7, 2015

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)",
Copy link
Member

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);
Copy link
Member

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())));
Copy link
Member

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));

@alexcrichton
Copy link
Member

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?

@alexcrichton alexcrichton merged commit e5ace68 into rust-lang:master Aug 18, 2015
@alexcrichton
Copy link
Member

Awesome, thanks so much @gankro! I've added some extra things here and there and pushed to master.

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