Comments (7)
Looks like this issue has been addressed in the closed issue "create_student_teams fails due to GitHub API change" but id still does not work!
from teachers_pet.
I can take a look at this later tonight, can you give the full error and possibly the snippet of your file that failed?
Thanks!
from teachers_pet.
@michaelfahy What version of teachers_pet do you have? You can run gem list -d teachers_pet
to find out, then gem update teachers_pet
to get the latest (0.3.5). Let us know if that works!
For reference, the issue referred to above is #88.
from teachers_pet.
I am using teachers_pet 0.3.5.
My students file is a list of student github IDs. They already belong to a team named "students" in the organization. The create_student_teams commands authenticates to GitHub, reads the ids from the students file and successfully creates a team for the first student on the list but then displays this error and stops:
/usr/local/rvm/gems/ruby-2.2.0/gems/json-1.8.2/lib/json/common.rb:155:in initialize': can't convert Sawyer::Resource to String (Sawyer::Resource#to_str gives NilClass) (TypeError) from /usr/local/rvm/gems/ruby-2.2.0/gems/json-1.8.2/lib/json/common.rb:155:in
new'
from /usr/local/rvm/gems/ruby-2.2.0/gems/json-1.8.2/lib/json/common.rb:155:in parse' from /home/michael/teachers_pet/lib/teachers_pet/actions/create_student_teams.rb:24:in
block in create_student_teams'
from /home/michael/teachers_pet/lib/teachers_pet/actions/create_student_teams.rb:9:in each' from /home/michael/teachers_pet/lib/teachers_pet/actions/create_student_teams.rb:9:in
create_student_teams'
from /home/michael/teachers_pet/lib/teachers_pet/actions/create_student_teams.rb:33:in run' from /home/michael/teachers_pet/lib/teachers_pet/commands/create_student_teams.rb:10:in
create_student_teams'
from /usr/local/rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /usr/local/rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in
invoke_command'
from /usr/local/rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from /usr/local/rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in
start'
from ./bin/teachers_pet:4:in `
from teachers_pet.
@michaelfahy any luck with this? I have the same problem.
It looks like the create_student_teams
method tries to parse the result of client.create_team
as a JSON object, but it returns something like this instead: <Sawyer::Resource:0x007f7f65374777>
from teachers_pet.
BTW, here is my workaround
--- a/lib/teachers_pet/actions/create_student_teams.rb
+++ b/lib/teachers_pet/actions/create_student_teams.rb
@@ -21,8 +21,9 @@ module TeachersPet
if team
puts "Team @#{org_login}/#{team_name} already exists."
else
- team = JSON.parse(self.client.create_team(org_login, team_name))
- team.symbolize_keys!
+ res = self.client.create_team(org_login, team_name)
+ teams_by_name = self.client.existing_teams_by_name(org_login)
+ team = teams_by_name[team_name]
end
self.client.add_users_to_team(org_login, team, usernames)
end
It makes extra calls to the GH API to get the new team ids, since they doesn't seem to be returned by the create_team call.
from teachers_pet.
Dear maintainers of teachers_pet
,
I was also faced with this issue yesterday, and @aronwc 's workaround worked like a charm.
Could this fix be directly integrated in master? or should I open a PR?
Best regards.
from teachers_pet.
Related Issues (20)
- Failing when GitHub username is invalid
- What do you want out of teachers_pet? HOT 5
- Multiple Groups HOT 8
- Pushing folder and its content to Student Repos HOT 1
- [Feature request] Remove write access in repos to stop students from pushing more codes HOT 2
- First-time user: Error connecting/authenticating to GitHub - no commands work HOT 4
- provide a way to close a bunch of pull requests HOT 1
- Err: command nnexport not found HOT 4
- Remove students from my set of students. HOT 1
- one repo per student, not per homework HOT 1
- teachers pet with Gitlabs? HOT 2
- Deleting repositories? HOT 3
- posting issues fails HOT 2
- Can't push files? HOT 3
- Educators PLZ participate in my PhD research about Open Source
- create_student_teams fails and quits for nonexisting users
- OS for CS education research study HOT 1
- create_student_teams OctoKit 404 Not Found?
- push_files inconsistencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teachers_pet.