GithubHelp home page GithubHelp logo

education / teachers_pet Goto Github PK

View Code? Open in Web Editor NEW
187.0 27.0 74.0 398 KB

Command line tool to help teachers use GitHub in their classrooms

Home Page: https://education.github.com/guide

License: MIT License

Ruby 100.00%

teachers_pet's Introduction

Notice: We have released a web based tool for teachers. teachers_pet will remain availble, but we recommend teachers use Classroom for GitHub instead.

teachers_pet Build Status Gem Version

WARNING: This documentation may contain unreleased changes. See rubydoc.info/gems/teachers_pet for the version of this README corresponding to the latest release.

Command line tool to help teachers use GitHub in their classrooms.

Philosophy

Each class is an 'organization' on GitHub. This allows the instructors (GitHub organization Owners) to create, push, pull, and administer all repositories. This achieves two goals:

  • Instructors can push code starter code to all students
  • Instructors can easily browse/pull student code at any time during the assignment to assist in questions, check on progress

Each student is given a team in the organization. The team name is the same as the student's GitHub username.

Installation

Install Ruby 1.9.3+, then run

gem install teachers_pet

If you've used this tool before, get the newest version using

gem update teachers_pet

To use the latest-and-greatest code from this repository, see the instructions in CONTRIBUTING.md.

Typical workflow

...when using the sandboxing method with private repositories:

Basic setup

  1. Create an organization (you will be an owner by default). The organization should reflect the name of your course. See the classroom guide for more info.

  2. Have each student/instructor create GitHub accounts.

  3. Create a students file (you can use an alternate filename and specify with the --students option if you like)

    • Individual assignments: one username per line
    • Group assignments: one team per line in the format teamName username username username
  4. Add the GitHub username of all instructors to an Owners.csv file (one per line)

  5. Run the following:

    teachers_pet create_student_teams ...
    teachers_pet add_to_team --members Owners.csv ...

Assignments

teachers_pet create_repos ...
teachers_pet push_files ...
# Multiple times:
teachers_pet open_issue ...

# Then, after the assignment is due,
teachers_pet clone_repos ...

Authentication

The scripts will ask for your GitHub password in order to run. If you have two factor authentication (2FA) enabled, create a personal access token (replace github.com with your host for GitHub Enterprise):

https://github.com/settings/tokens/new?description=teachers_pet&scopes=repo%2Cpublic_repo%2Cwrite%3Aorg%2Crepo%3Astatus%2Cread%3Aorg%2Cuser%2Cadmin%3Aorg

Once created, specify the token using the --token option, or if you add the TEACHERS_PET_GITHUB_TOKEN environment variable to your .bash_profile (or equivalent – example below), it will be picked up by teachers_pet.

# replace YOUR_TOKEN_HERE below
echo "\n\nexport TEACHERS_PET_GITHUB_TOKEN=YOUR_TOKEN_HERE" >> ~/.bash_profile
source ~/.bash_profile

Actions

To learn the options for each action, run

teachers_pet help
# or
teachers_pet help COMMAND

Giving others access

You may need to give other people access to various repositories using teams – the add_to_team command can help do this in bulk.

Creating assignments

When using the sandboxing setup, you will need to create the repositories for the students. For each assignment, use the create_repos action to create a repository for each student. The repositories are technically created per team, but if you use create_student_teams first, then there will be one team per student.

Forks

If you need to grab the list of users who have forked a particular repository – e.g. to use with another command – you can run the forks command, and the results will be written to a file.

Collaborator access

Give collaborator access to everyone who has forked your repository using add_collaborators. Mostly useful for GitHub demonstrations, where usernames can quickly be collected via forks, and then the students can be quickly given access to a repository.

Pushing starter files

When creating repositories for students, you will often want to include boilerplate files. After running create_repos, create a canonical copy of the starter files (e.g. .gitignore, Makefiles, etc.) in a repository. From the local clone of the repository, use the push_files action to place that code in the repositories for each student. This works by creating a Git remote for each student repository, and doing a git push to each one.

Opening issues

After running create_repos, instructors can open issues in student repos as a way to list requirements of the assignment, goals, or instructions for patching, using the open_issue command.

Clone repositories for grading

When grading, use the clone_repos command to clone all the repositories in the organization that match the username-repository naming scheme that is generated when create_repos is run.

Merge all open pull requests

When running a GitHub workshop, it's nice to be able to merge a bunch of pull requests on a particular repository all at once. merge_pull_requests will handle this for you.

Related projects

teachers_pet's People

Contributors

afeld avatar aronwc avatar hartmamt avatar johndbritton avatar kelleydv avatar mikehelmick avatar mkuehn10 avatar svenevs avatar tarebyte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teachers_pet's Issues

Create a `students` team

In teaching my JS class, I've found myself wanting to call all the student's attention to a particular comment, or ensuring everyone sees a particular announcement made through an issue. Team mentions are a good way to do this, so it would be nice to have a students team (and maybe an all team?) created within the class organization. Would be great to have this as its own action (e.g. create_students_team), but maybe called as part of create_teams.


Additionally, all the actions (aside from create_teams) could rely on this team to get the list of students.

  • Pros
    • The teacher then doesn't need to keep the students file around
    • The teacher can populate the team in some way other than a students file (with the create_student_team action), but all the other actions work fine
  • Cons
    • The actions then have two different ways of getting a student list
    • For group projects, the repositories should be created off the list of teams, so that would need to still be handled with a local file, or other way of specifying the team names

Thoughts?

`method_missing': undefined method `password'

Running this:
teachers_pet create_student_teams --organization=org-mode-Su-2014

leads to this:

/usr/local/rvm/gems/ruby-1.9.3-p547/gems/teachers_pet-0.3.1/lib/teachers_pet/actions/base.rb:20:in `method_missing': undefined method `password' for #<TeachersPet::Actions::CreateStudentTeams:0x00000002a65458> (NoMethodError)
    from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/teachers_pet-0.3.1/lib/teachers_pet/actions/base.rb:36:in `octokit_config'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/teachers_pet-0.3.1/lib/teachers_pet/actions/base.rb:45:in `init_client'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/teachers_pet-0.3.1/lib/teachers_pet/actions/create_student_teams.rb:30:in `run'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/teachers_pet-0.3.1/lib/teachers_pet/commands/create_student_teams.rb:10:in `create_student_teams'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/gems/teachers_pet-0.3.1/bin/teachers_pet:4:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/bin/teachers_pet:23:in `load'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/bin/teachers_pet:23:in `<main>'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks:15:in `eval'
    from /usr/local/rvm/gems/ruby-1.9.3-p547/bin/ruby_executable_hooks:15:in `<main>'

The gem was installed this morning with:
gem install teachers_pet

Add tests

This might come in pieces, but the tool needs some validation.

  • clone_repos#12
  • create_repos#33
  • create_teams#21
  • fork_collab
  • push_files

Remove students from my set of students.

I previously added a student, BadStudent, via my students file, but now I want to remove them. I already attempted just removing BadStudent from the students file and deleting the Team containing BadStudent from my Organization.

Whenever I attempt teachers_pet create_student_teams or teachers_pet create_repos, the program first attempts to load my students with the message:

Loading students:
 -> BadStudent
 -> GoodStudent1
 -> GoodStudent2

And then attempts to perform actions applying to the above set of students.

Is it possible to remove the BadStudent from the above set of students?

Multiple Groups

Hi,

I was able to use the teachers_pet toll to create "students" and "groups".
My students file looks like:

StudentName1
StudentName2
StudentName3
team1 StudentName1 StudentName2 StudentName3

Ok, how can I create more students (StudentName4, StudentName6) and teams (team2) ?
Do I have to create a new students file? Or eyerything in one file?

action: open_issues

I propose a new feature.

I'm finding myself opening issues for students as I introduce them to GH and giving detailed instructions on how to clone, commit, push, etc. I don't know how this will look as we move on to more advanced assignments, but I like the idea of being able to author an issue and open it in everyone's repos.

Thoughts?

Error on create_student_teams

create_student_teams reports the error:
json/common.rb:155:in `initialize': can't convert Sawyer::Resource to String (Sawyer::Resource#to_str gives NilClass) (TypeError)
It successfully creates a team for the first student on the list but does not continue.

How do you use teachers_pet?

Hi Everyone,

I'm trying to get a more in depth understanding of how people are using this gem, what their pain points are, or if they aren't using the gem anymore what caused them to.

If you are interested in talking to email me at [email protected] and we can work out a time, or feel free to comment on this issue!

Thanks!

push_files doc and features

It is not clear to me how this works. Suppose I have a repo that I now want to share with all my students. What are the recommended steps? When I run the push_files script, I am prompted for the repos I want to push to, but where do I specify the files/repo I want to push?

Also, there are (at least) two situations that I want to account for:

  • The base repo I want to share is public and I want my students' to be private.
  • The base repo is private and I want my students' to be private.

Pushing feedback on student repositories?

I'm using teachers_pet for the first time this week. I went through the process fine to set everything up, and today I cloned student directories to my machine to grade their submissions. However, I now want to push the modifications I've made to each repository to GitHub so that students see my feedback. Does teachers_pet have this functionality? None of the commands seem to do this, but perhaps I am missing it. Thanks for your help!

push_files and private repos

Pushing files does not work unless repos have already been created. I can successfully create_repos and push code to them, but I don't understand how to make them private.

A couple situations that I can see arising for me:

  • I have a private repo and I want to push to private repos for my students
  • I have a public repo and I want to push to private repos for my students

Also, it would be handy if push_files could create repos if they don't already exist. Does anyone see any problems that could arise from that?

First-time user: Error connecting/authenticating to GitHub - no commands work

Hello, I'm trying to use teachers_pet (0.3.5) and can't seem to get it working. I've never used it before so hopefully it's something simple to fix. I'm trying to set up teams using create_student_teams and it's giving me the error below. I've tried entering my password and using a token (both on command line and in the environment variable) and get the same result. Any idea how to make it work? (I am able to connect to GitHub otherwise, e.g., with git push)

$ teachers_pet create_student_teams --students=./students.txt --organization=PCC-CIS-233J --username=caratang

Authenticating to GitHub...
c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (Faraday::SSLError)

from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in block in connect' from c:/Ruby22-x64/lib/ruby/2.2.0/timeout.rb:74:intimeout'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in connect' from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:863:indo_start'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:852:in start' from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:1375:inrequest'
from c:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:1133:in get' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:80:inperform_request'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:40:in block in call' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:87:inwith_net_http_connection'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:32:in call' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/response.rb:8:incall'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/response.rb:8:in call' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:inbuild_response'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in run_request' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/connection.rb:140:inget'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sawyer-0.5.5/lib/sawyer/agent.rb:94:in call' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/octokit-3.3.1/lib/octokit/client.rb:339:inrequest'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/octokit-3.3.1/lib/octokit/client.rb:200:in paginate' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/octokit-3.3.1/lib/octokit/client/organizations.rb:206:inorganization_teams'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/teachers_pet-0.3.5/lib/teachers_pet/client_decorator.rb:30:in existing_teams_by_name' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/teachers_pet-0.3.5/lib/teachers_pet/actions/create_student_teams.rb:6:increate_student_teams'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/teachers_pet-0.3.5/lib/teachers_pet/actions/create_student_teams.rb:32:in run' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/teachers_pet-0.3.5/lib/teachers_pet/commands/create_student_teams.rb:10:increate_student_teams'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:instart'
from c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/teachers_pet-0.3.5/bin/teachers_pet:4:in <top (required)>' from c:/Ruby22-x64/bin/teachers_pet:23:inload'
from c:/Ruby22-x64/bin/teachers_pet:23:in `

'

gem install on OS X

I am on OS X 10.8, which comes with Ruby 1.8.7 in /usr/bin/. This (and associated gem binary) is too old for teachers-pet.

  • I built Ruby 2.1.1 from source, and it installed in /usr/local/bin/.
  • I installed teachers-pet with sudo /usr/local/bin/gem install teachers_pet.

Now I can't find the teachers-pet binaries anywhere, and I don't know how to run the scripts. The only binary I could find is forkcollab at /usr/local/lib/ruby/gems/2.1.0/gems/teachers_pet-0.0.1/bin/forkcollab.

Bad reference when running `push_files`

I am trying to push the second assignment of the year to my students. I am running create repos first, but when it comes time to push files, teachers_pet is trying to push to the remote of the first assignment even though I'm specifying the correct repo name. This of course fails with the "Updates were rejected because the remote contains work..." message.

Any idea what the problem is? Has anyone else successfully pushed multiple assignments?

Adding Team description when creating team

Just started using teachers_pet and a big thank you for releasing it all as It has made my job easier already.

I would like to know if there is there a way when using teachers_pet create_student_teams to add a default description for each team member? At present it's blank but I would like to add something like MSc Student / BSc Level 2 etc etc when creating teams to make it easier to identify which cohort etc we are looking at. We have 250+ students across 4 levels so this would make our life easier.

thanks

Jon

Deleting repositories?

Is there an easy way to delete last semester's student repositories? I want to re-use my current organization, but I need to remove repositories from prior students to do that. I can't find a way other than going through and removing all 450 repositories by hand...

Ideally the repos would just stay on the student's GitHub account and leave my organization, but I suspect that is not possible.

Hope you can help!

posting issues fails

teachers_pet open_issue --organization=cs109-students --repository=test3 --students=students.csv --title="AWS Sign Up" --body ../Issues/aws.md --token TOKEN
Loading students:
 -> notsonaivebayes
==================================================
Authenticating to GitHub...
Found organization at: cs109-students

Creating issue in repositories...
/Library/Ruby/Gems/2.0.0/gems/octokit-3.3.1/lib/octokit/response/raise_error.rb:16:in `on_complete': POST https://api.github.com/repos/cs109-students/notsonaivebayes-test3/issues: 422 - Invalid request. (Octokit::UnprocessableEntity)

nil is not a array. // See: https://developer.github.com/v3/issues/#create-an-issue

If i leave out the body i get

/Library/Ruby/Gems/2.0.0/gems/teachers_pet-0.3.5/lib/teachers_pet/actions/open_issue.rb:19:in `initialize': no implicit conversion of nil into String (TypeError)

The other commands are working so I am wondering what i am doing wrong...

Split fork_collab

It's really two separate actions:

  • Grab the list of people who have forked a repository
  • Add a bunch of people as collaborators on a repository

Can't push files?

This is my second semester using GitHub in my course. I was able to create repos and push files fine on Monday. But today I tried going through the exact same steps I always use (create_student_teams, create_repos, push_files), but I get an error when I tried to push files. I am in the directory of my identical synced repo whose files I want to push into the student's repo. Anyone see what I'm doing wrong, or why it isn't working anymore? The repo exists, and I have access through the owner team. I have 1 student in the student file, this is the error on push_files:

Authenticating to GitHub...
Please enter your GitHub password: Found organization at: https://api.github.com/orgs/LUMCS201
Adding remotes and pushing files to student repositories.
tjlabadini --> [email protected]:LUMCS201/tjlabadini-ClassExamples.git
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
MMOMac:ClassExamples mmolsen$ teachers_pet push_files --organization=LUMCS201 --repository=ClassExamples --students=../late_students.txt --username=umasshokie --password
Loading students:
-> tjlabadini

I tried running git pull just in case the repo I an in and pushing files from wasn't right, but it says it is up to date. Thanks for any help! I can set up this one student without using teachers_pet, but I want to make sure the process will still work in the future when I do the same thing for all students for a new assignment.

Flags vs. interactive?

Currently, all of the interaction with this tool is done through a handful of executable commands, each of which corresponds to an action. Having that many top-level executables doesn't really make sense, so at the very least, I think it makes sense to put them beneath a single top-level command, e.g.

teacherspet clone_repos
# OR
tp clone
# etc.

Thor seems like a good tool to do this.

Currently, the actions are specified as the executable, and all the options are specified through interactive prompts. It feels like we should go all one way or all the other, e.g. fully interactive:

$ teacherspet
Actions:
1. Create repositories
2. Create teams
...
What would you like to do? >

or command-line flags:

teacherspet create-repos --name assignment1 --org cs101 ...

The former is nice because the teacher will often be doing a bunch of these actions in sequence and the options (e.g. the org name or the file with the list of students) can be "remembered", but the latter is more unix-y... though maybe not in the good sense 😏

@johndbritton @mikehelmick et al: Thoughts?

Contributing?

I came across this repo, and I really like the way GitHub education is going. I'm looking to get more into open source, and helping out with projects where I can.

I saw a couple of issues up, but I wasn't sure if someone was already working on them. Or even if this repo was looking for collaborators.

about labels

Could you tell me how I can have label such as 'feature'? And how could I make some persons have a part of rights such as posting only but could not select label and milestone just as the rights I have here. Thank you very much. @afeld

teachers pet with Gitlabs?

My institution wants to use GitLab instead of GitHub so that we can manage our own repository servers. Personally, I'm happy with GitHub, but oh well. So -- is there a way to use teacher's pet with Gitlab instead of with GitHub? I presume everything is identical except that it would have to connect to a different server. Is that easy to modify? Or is it recommended or not recommended for some reason?

Thanks!

[Feature request] Remove write access in repos to stop students from pushing more codes

I think assignment/homework usually has a deadline, thought we could checkout to commit before a datetime, but the commit log is easily to be faked, also sometimes student didn't configure the datetime and timezone on there machine, so I think so best way to make sure the code will be committed before deadline is to remove the write permission, which is not supported by teachers_pet currently, hope it can be added in, thanks!

Err: command nnexport not found

Hi, there.

When I try to set the TEACHERS_PET_GITHUB_TOKEN, running source ~./bash_profile, I hit a snag: nnexport: command not found

Could you tell me why? Thanks very much.

Warmly,
Leo

one repo per student, not per homework

First, it seems this already works, atleast if the student has not made any changes to their repo.

it will look like this:

Authenticating to GitHub...
Found organization at: https://api.github.com/orgs/teachers-pet-test
Adding remotes and pushing files to student repositories.
vkaynig --> [email protected]:teachers-pet-test/vkaynig-test1.git
fatal: remote vkaynig already exists.
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 350 bytes | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To [email protected]:teachers-pet-test/vkaynig-test1.git
   c2018fe..82f9d4c  master -> master

You can see the "fatal", but it does add the files for a new homework in.

Now, I dont want to have to pull every students changes in here to have to push new changes to their remotes. There wont be a merge conflict because, by convention, I want to keep a new homework in a new folder. Is this doable?

Gist as task list

How could I create a gist as task list that everyone in a team has access to check or uncheck the items? @afeld

provide a way to close a bunch of pull requests

In classes that use the fork strategy, teachers may leave students' pull requests open for review, so that they can submit updates, etc. This may leave them with a bunch of open pull requests across one or more repositories, so it would be helpful to have a command that takes care of them in bulk.

My thinking is to expand merge_pull_requests:

$ teachers_pet help pull_requests
Usage:
  teachers_pet pull_requests --repository=OWNER/REPO

Options:
  --repository=OWNER/REPO
  --merge   # Merges pull requests. Cannot be used in combination with --close.
  --close   # Closes pull requests. Cannot be used in combination with --merge.
  ...

Perform an action on all open pull requests in a particular repository

On the fence about whether it should be an even more generic issues command, though that may be confusing since most people probably think about them (and treat them) as separate things.

Authorization Troubles

When I get to the authorization step in create_teams I am getting the following error. It does not matter if I select 1 or 2, I also have the ghe_oauth set in my environment.

1. oAuth
2. Password
Login via oAuth or Password? 1
/Users/kelleydv/teachers-pet/lib/teachers_pet/actions/base.rb:20:in `get_auth_method': undefined local variable or method `auth_method' for #<TeachersPet::Actions::CreateTeams:0x000001024b4c88> (NameError)
    from /Users/kelleydv/teachers-pet/lib/teachers_pet/actions/base.rb:30:in `config_github'
    from /Users/kelleydv/teachers-pet/lib/teachers_pet/actions/base.rb:41:in `init_client'
    from /Users/kelleydv/teachers-pet/lib/teachers_pet/actions/create_teams.rb:34:in `create'
    from /Users/kelleydv/teachers-pet/lib/teachers_pet/actions/create_teams.rb:98:in `run'
    from ./bin/create_teams:6:in `<main>'

teachers_pet/github asking for username/password even with token

Even though I have defined the TEACHERS_PET_GITHUB_TOKEN env. variable, github now insists on asking me for my username and password.

This used to work perfectly fine without this interactivity a few weeks ago. I'm not sure what can be the source of this problem; the main change that I've done is to upgrade to Yosemite OS X beta, presumably with a newer version of Ruby installed (Ruby 2.0.0p481). I've also made sure to update my teachers_pet installation.

Anyone know what might be the cause of this problem?

(Right now, It makes my life very hard, having 40ish student repos to clone).

Support token creation (and 2FA) from the command line

This should be possible, but will take a bit of tinkering with to figure out. Might also be nice to pull out into a dedicated gem/script that can be shared between non-browser tools.

Would love input from people that are smarter than me :bowtie:

/cc @mislav

uninitialized constant TeachersPet::SimpleDelegator (NameError)

I did a fresh install of the gem and when I ran teachers_pet help I got this.

/Users/mark/.gem/ruby/2.1.2/gems/teachers_pet-0.3.0/lib/teachers_pet/client_decorator.rb:2:in `<module:TeachersPet>': uninitialized constant TeachersPet::SimpleDelegator (NameError)
        from /Users/mark/.gem/ruby/2.1.2/gems/teachers_pet-0.3.0/lib/teachers_pet/client_decorator.rb:1:in `<top (required)>'
        from /Users/mark/.gem/ruby/2.1.2/gems/require_all-1.3.2/lib/require_all.rb:109:in `require'
        from /Users/mark/.gem/ruby/2.1.2/gems/require_all-1.3.2/lib/require_all.rb:109:in `block in require_all'
        from /Users/mark/.gem/ruby/2.1.2/gems/require_all-1.3.2/lib/require_all.rb:107:in `each'
        from /Users/mark/.gem/ruby/2.1.2/gems/require_all-1.3.2/lib/require_all.rb:107:in `require_all'
        from /Users/mark/.gem/ruby/2.1.2/gems/require_all-1.3.2/lib/require_all.rb:154:in `block in require_rel'
        from /Users/mark/.gem/ruby/2.1.2/gems/require_all-1.3.2/lib/require_all.rb:153:in `each'
        from /Users/mark/.gem/ruby/2.1.2/gems/require_all-1.3.2/lib/require_all.rb:153:in `require_rel'
        from /Users/mark/.gem/ruby/2.1.2/gems/teachers_pet-0.3.0/lib/teachers_pet.rb:4:in `<top (required)>'
        from /Users/mark/.gem/ruby/2.1.2/gems/teachers_pet-0.3.0/bin/teachers_pet:3:in `require_relative'
        from /Users/mark/.gem/ruby/2.1.2/gems/teachers_pet-0.3.0/bin/teachers_pet:3:in `<top (required)>'
        from /Users/mark/.gem/ruby/2.1.2/bin/teachers_pet:23:in `load'
        from /Users/mark/.gem/ruby/2.1.2/bin/teachers_pet:23:in `<main>'

All the tests pass though, not entirely sure what the issue is here. SimpleDelegator is available in Ruby 2.1.2.

Educators PLZ participate in my PhD research about Open Source

Hi,
I would like to invite you to participate in my PhD research which is about contributing to Open Source to modernize Computer Science education. The survey will take few minutes but will be of great value to my research as i need direct evidences from OS users like you, plz.
I hope you will be happy to participate by clicking on the related link to take the suitable survey & feel free to answer any number of questions (will be much help if you can answer all):

"Please support my PhD research by circulating this invitation and mention it to your friends to reach educators, students, mentors & other experts & professional interested in the OS field"

Many thanks in advance,,
Nada Alasbali
PhD of Computer Science & Engineering, UNSW

Pushing folder and its content to Student Repos

Suppose that the initial content I would like to push to the student repos is organized in subfolders such as:
index.html
css/styles.ccs
imgs/img1.png
imgs/img2.png
I have tried to use push_files action to place the above folders hierarchy into the repository for each student but it did not work.
What is the best way to achieve the above?
Thanks for your appreciated help.

Failing when GitHub username is invalid

Currently when running add_users_to_team if the username is invalid (or hasn't been created on GitHub) the gem fails with a 403 error. Which is totally fine.

Would it be a viable alternative to skip over the invalid username and print a helpful message at the end?

`push_files` action

EDITED for clarity:

What is the recommended procedure for pushing new files to student/team repos?

  • I created repos, and pushed files for 4 students.
  • I changed my repo by adding one file.
  • I ran a push_files action with the 4 users in my students file.
  • Users A and B had already pushed commits to their repo.
  • Users C and D had not pushed any commits yet.
  • A and B did not get the update.
  • C and D did get the update.

As an eample of the error, I get the following (typical error when the remote is ahead)

==================================================
Authenticating to GitHub...
Found organization at: https://api.github.com/orgs/MyOrg
Adding remotes and pushing files to student repositories.
userA --> [email protected]:MyOrg/userA-repo.git
fatal: remote userA already exists.
To [email protected]:myOrg/userA-repo.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to '[email protected]:myOrg/userA-repo.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first merge the remote changes (e.g.,
hint: 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

As a tangential note, I always seem to get this when pushing files even for the first time
fatal: remote userA already exists.

The problem of students not getting updates after making commits makes sense. For some reason I thought I was going to get away with it as long as there were no direct conflicts in the files. How do we solve the problem of pushing updates to already-created-repos for students? Is this a problem that we should solve, or is it simply not recommended to push updates in this way?

Support Fork method

As described in the guide, using forks for assignments is preferable for a lot of reasons. Would be great to have the following actions support forks of assignment repositories:

  • open_issue
  • clone_repos

Note: will probably want to filter by current members of the students team a list of students or a particular team, so that it doesn't grab repositories from past iterations of the class.

Having trouble with `push_files`

I'm not sure what is going on here. I am an owner of the organization, but somehow I don't have rights to push_files to student repos. Here is an example of the error I get.

Authenticating to GitHub...
Found organization at: https://api.github.com/orgs/KJHS-Coding
Adding remotes and pushing files to student repositories.
jakiestfu --> [email protected]:KJHS-Coding/jakiestfu-Python-Tour.git
fatal: remote jakiestfu already exists.
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I am running create_team, create_repos, and push_files - in that order. push_files is the only step that fails.

Team membership questions

First, let me say a big thanks for teachers_pet. I am having satisfying success with it.

I have two questions:

  • Why am I made a member of each student's singleton team? As a member of the Organization's Owners team, don't I already have omnipotence over the teams and repos?
  • In the README.md, instructions say to "Add the GitHub username of all instructors to an Owners.csv file (one per line)" and then submit teachers_pet add_to_team --members Owners.csv …. Again, why do I need to explicitly add all Owners to each student singleton team?

Please forgive me if, once I start to actually do more, this all becomes abundantly clear. So far I have only created teams and repos, but will soon be pushing files into them. I'm trying to minimize ugly surprises.

create_student_teams fails due to GitHub API change

The create_student_teams command fails if the user being added isn’t already on another team in your organization. This is due to a change in the GitHub API.

The solution is to switch from using the Add team member API request to using Add team membership.
A dirty hack that takes care of it is changing line 311 in octokit/client/organizations.rb (on my machine this is located under /Library/Ruby/Gems/2.0.0/gems/octokit-3.1.2/lib/) the "teams/#{team_id}/members/#{user}" part to "teams/#{team_id}/memberships/#{user}".
This should probably be fixed in octokit, and may have other implications. I just needed a quick solution so that students can be added to the organization.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.