Uh oh!
There was an error while loading. Please reload this page.
feat: Add some GitHub Classroom API endpoints - #3690
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. |
jferrl
commented
Aug 18, 2025
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:
|
gmlewis
left a comment
There was a problem hiding this comment.
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!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
jferrl
commented
Sep 23, 2025
@gmlewis changes done! 😃 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Introduces test cases for invalid input options in GetAssignment, GetClassroom, ListClassrooms, and ListClassroomAssignments methods to improve error handling coverage.
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @jferrl and @stevehipwell!
LGTM.
Merging.
gmlewis
commented
Sep 23, 2025
Fixes: #3684. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
This PR implements some GitHub Classroom API endpoints support by adding three new methods to the
ClassroomServiceand fixes a deprecation warning in theaddOptionsfunction.Changes Made
✨ New Features
1. GetClassroom Method
GET /classrooms/{classroom_id}2. ListClassrooms Method
GET /classrooms3. ListClassroomAssignments Method
GET /classrooms/{classroom_id}/assignmentsRefactor
4. Reflect.Ptr Deprecation Fix
addOptionsfunction to usereflect.Pointerinstead of deprecatedreflect.Ptrreflect.Ptrwithreflect.Pointeringithub/github.goIssue: #3684