Skip to content
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

Adds graceful continue #73

Merged
merged 6 commits into from
Jul 10, 2024
Merged

Adds graceful continue #73

merged 6 commits into from
Jul 10, 2024

Conversation

jalafel
Copy link
Contributor

@jalafel jalafel commented Jun 29, 2024

What are you trying to accomplish?

Fixes a bug where the gh classroom clone student-repos command would fail if any repositories could not be cloned and was due to an unhandled error. This PR adds a --verbose flag to the command to enable verbose error output and gracefully continue cloning the remaining repositories if any fail.

Closes: #69

What should reviewers focus on?

In addition, this PR abstracts the cloning of repositories to a separate function utils.CloneRepository to improve testability and maintainability.

This PR also removes the Name() function from acceptAssignment.Repository.Name() and replaces it with acceptAssignment.Repository.Name. On GitHub Classroom, I've opened a PR to update the Repo serializer to include the name attribute.

@jalafel jalafel marked this pull request as ready for review June 29, 2024 01:35
@jalafel jalafel requested a review from a team as a code owner June 29, 2024 01:35
@@ -57,6 +56,7 @@ type Classroom struct {

type GithubRepository struct {
Id int `json:"id"`
Name string `json:"name"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jalafel Spacing looks off here. Try running go fmt.

octosteve
octosteve previously approved these changes Jul 9, 2024
Copy link

@megan-arellano megan-arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a second to understand why we don't need the GithubRepository Name function, but I believe it's bc you changed the serializer so it's an accepted value. Anyway, looks good to me!

@jalafel jalafel merged commit 09a9004 into main Jul 10, 2024
9 checks passed
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.

gh classroom clone student-repos crashing with "panic: runtime error: index out of range [1] with length 1"
3 participants