-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: Add some GitHub Classroom API endpoints #3690
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
Conversation
Implements the GetClassroom method to retrieve a GitHub Classroom by ID if the user is an administrator. Adds corresponding unit tests to verify correct API interaction and response handling.
Updated the addOptions function to use reflect.Pointer instead of the deprecated reflect.Ptr for checking pointer kinds. This change ensures compatibility with newer Go versions.
Implements the ListClassrooms method to retrieve classrooms for the current user via the GitHub API. Adds corresponding tests to verify correct API interaction and response parsing.
Implements the ListClassroomAssignments method to fetch assignments for a classroom via the GitHub API. Includes comprehensive tests for the new method, covering normal operation and error handling.
@jferri - just FYI - I lost write access to this repo and this may cause unexpected delays for which I apologize. |
No worries! 😃 |
Updated the usage of reflect.Ptr to reflect.Pointer in the stringifyValue function to align with the latest Go reflect package conventions.
Replaces usage of http.MethodGet with the string literal "GET" in both the ClassroomService methods and their corresponding tests. Also removes the unused net/http import.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3690 +/- ##
==========================================
- Coverage 91.12% 91.11% -0.02%
==========================================
Files 187 187
Lines 16640 16684 +44
==========================================
+ Hits 15164 15202 +38
- Misses 1291 1295 +4
- Partials 185 187 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @jferrl!
Just a few tweaks, please, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.
@stevehipwell and/or @alexandear - might you have time for a code review? Thank you!
Revised comments in classroom.go to clarify method descriptions and improve wording for GetClassroom and ListClassrooms functions.
Replaces GitHub and GitHub Classroom URLs with example.com in classroom and assignment test cases for consistency and to avoid referencing real endpoints.
@gmlewis changes done! 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Introduces test cases for invalid input options in GetAssignment, GetClassroom, ListClassrooms, and ListClassroomAssignments methods to improve error handling coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @jferrl and @stevehipwell!
LGTM.
Merging.
Fixes: #3684. |
Summary
This PR implements some GitHub Classroom API endpoints support by adding three new methods to the
ClassroomService
and fixes a deprecation warning in theaddOptions
function.Changes Made
✨ New Features
1. GetClassroom Method
GET /classrooms/{classroom_id}
2. ListClassrooms Method
GET /classrooms
3. ListClassroomAssignments Method
GET /classrooms/{classroom_id}/assignments
Refactor
4. Reflect.Ptr Deprecation Fix
addOptions
function to usereflect.Pointer
instead of deprecatedreflect.Ptr
reflect.Ptr
withreflect.Pointer
ingithub/github.go
Issue: #3684