github-education-resources / classroom

GitHub Classroom automates repository creation and access control, making it easy for teachers to distribute starter code and collect assignments on GitHub.
https://classroom.github.com
1.34k stars 564 forks source link

Can't join group assignment after deleting associated team #2479

Closed maxwofford closed 4 years ago

maxwofford commented 4 years ago

Describe the bug I can't join a team or create a team on a group assignment because the "Max number of teams" is being taken by a deleted team.

To Reproduce Steps to reproduce the behavior:

  1. Create a group assignment
  2. Set the assignment's "Maximum number of teams" to 1
  3. Sign up for the assignment & create a new team
  4. Go to org's teams index page & delete the newly created team
  5. Go to assignment's invite link
  6. I can't join a team, or create a new team

Expected behavior

Screenshots

Screenshot 2019-11-25 16 50 31 Screenshot 2019-11-25 16 54 31

Additional context Assignment in question is here, with an invite link here

d12 commented 4 years ago

@maxwofford :wave:! Looks like we're running into some sort of undefined behavior here, we don't advise deleting teams off of GitHub.com when using GitHub Classroom. We have an open issue here for better management of teams in general when using GitHub Classroom: https://github.com/education/classroom/issues/292

The workaround for now is to create a new assignment if this were to happen. If you'd like us to repair this specific assignment, let me know :)

maxwofford commented 4 years ago

Seems like an issue with soft-deletion of teams. Will avoid doing this in the future. I'd appreciate it if you can disassociate the "all" team from the assignment on the backend.

maxwofford commented 4 years ago

I've gone ahead and just nuked the assignment & restarted from scratch– no need to make changes on the backend. Seems like this is a specific bug under the scope of #292, and seeing that other bugs commented in that issue are being closed I'll go ahead and close this.

maxwofford commented 4 years ago

@d12 I've managed to brick another assignment. Can I get this repo set as the assignment repo for this assignment manually for the time being? I'd like to send this assignment out asap & am just blocking on having a working Classroom assignment. I got stuck trying to reassign the repo & now accepting the invite 404s.

Screenshot 2019-11-26 13 15 03

d12 commented 4 years ago

Taking a peek at this now @maxwofford , thanks for reporting!

d12 commented 4 years ago

@maxwofford To help our engineers debug, what steps did you take to get into this state?

To unblock, you could create a new assignment with the repository you want to use. Not totally sure why changing the starter code repo is causing these errors, but we'll dig into it.

maxwofford commented 4 years ago

@d12

  1. Created a new assignment
  2. Created a new assignment team
  3. Went to the team settings, replaced the generated repo w/ an existing repo
  4. Tried to accept an invite to the assignment, reached a 404

As for getting unblocked, I don't know another way to do this. My end-result is that I'd like an assignment with a single team that uses an existing repo as the assignment repo (not a copy or template, but the original with all the issue/PR/comment history)

d12 commented 4 years ago

@maxwofford Ah, I see. This isn't a supported workflow on GitHub Classroom, we don't have a way of accomplishing what you're trying to do. Can you do this through GitHub by adding collaborators to a repository?

With GitHub Classroom, the flow is intended to be

  1. Teacher sets up "starter code" repo with instructions and frameworking
  2. Teacher creates assignment and sets starter code repository
  3. Students accept assignment and get a copy of the repo to work in

Are there specific parts of GitHub Classroom you're hoping to use with your flow? It seems to bypass most of Classroom's functionality.

maxwofford commented 4 years ago

I'm running a competition where participants all submit by PRing to a single repo. I'm using GitHub Classroom to give people access to the repo & add them to a team + org at the push of a button. Classroom has been fantastic for this & does what I need it to flawlessly.

The one change I'd like to make is for people to PR into an existing repo which has sentimental value to the community I'm running the competition in instead of a fork without issue/comment/PR history.

I've been looking at how to implement this without Classroom, and it looks like the best alternative for me is to create multiple API keys & run an oauth service that 1-click adds people to a specific team, cycling through keys when I reach the API limit (50 invites per day). This wouldn't be as polished as Classroom is, would take engineering time, and doesn't feel like it's in the spirit of GitHub's rate-limits.

I'd really love to be able to run this competition through GitHub Classroom– @mogalvanize recommended I use it for this & it's been great so far.

d12 commented 4 years ago

It'd be a pretty big change to the way the application has worked in the past, and it'd be a pretty decent engineering project to build out the functionality. Unfortunately I can't promise anything in the short term, but we'll note the feature request and try to get to it soon.

In this case, you'd probably be better off writing some sort of integration to do this. Looking at the API docs:

To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.

Will the 500 invitations per day be sufficient here?

Given the partnership we have with Hackclub, we're happy to help try to make this happen!

maxwofford commented 4 years ago

Sorry for the late response here– slipped past my unreads. I ended up going for the integration (missed that line about the raised invite limit the first time) and it's working perfectly for my use-case. Thanks for recommending it.

Max Wofford max@maxwofford.com Engineering & Operations @ Hack Club ( https://hackclub.com )

On Wed, Nov 27, 2019 at 11:47 AM, Nathaniel Woodthorpe < notifications@github.com > wrote:

It'd be a pretty big change to the way the application has worked in the past, and it'd be a pretty decent engineering project to build out the functionality. Unfortunately I can't promise anything in the short term, but we'll note the feature request and try to get to it soon.

In this case, you'd probably be better off writing some sort of integration to do this. Looking at the API docs:

To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.

Will the 500 invitations per day be sufficient here?

Given the partnership we have with Hackclub, we're happy to help try to make this happen!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub ( https://github.com/education/classroom/issues/2479?email_source=notifications&email_token=ABM6K4RWEIPGV4CBMSD7JNLQV2QCFA5CNFSM4JRPXGUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFKDN7I#issuecomment-559167229 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/ABM6K4XJH5J3R5ER5DAMJHLQV2QCFANCNFSM4JRPXGUA ).