Skip to content

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

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
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"

4 participants