Skip to content

Conversation

jferrl
Copy link
Contributor

@jferrl jferrl commented Aug 18, 2025

Summary

This PR implements some GitHub Classroom API endpoints support by adding three new methods to the ClassroomService and fixes a deprecation warning in the addOptions function.

Changes Made

✨ New Features

1. GetClassroom Method

  • Purpose: Retrieves a specific GitHub Classroom by ID for administrators
  • API Endpoint: GET /classrooms/{classroom_id}

2. ListClassrooms Method

  • Purpose: Lists all GitHub Classrooms for the current user
  • API Endpoint: GET /classrooms

3. ListClassroomAssignments Method

  • Purpose: Lists all assignments for a specific GitHub Classroom
  • API Endpoint: GET /classrooms/{classroom_id}/assignments

Refactor

4. Reflect.Ptr Deprecation Fix

  • Issue: Updated addOptions function to use reflect.Pointer instead of deprecated reflect.Ptr
  • Change: Replaced reflect.Ptr with reflect.Pointer in github/github.go
  • Benefit: Ensures compatibility with newer Go versions and removes deprecation warnings

Issue: #3684

jferrl added 4 commits August 18, 2025 23:14
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.
@gmlewis
Copy link
Contributor

gmlewis commented Aug 18, 2025

@jferri - just FYI - I lost write access to this repo and this may cause unexpected delays for which I apologize.
You can watch that other PR to check on the status.

@jferrl
Copy link
Contributor Author

jferrl commented Aug 18, 2025

@jferri - just FYI - I lost write access to this repo and this may cause unexpected delays for which I apologize. You can watch that other PR to check on the status.

No worries! 😃

jferrl added 2 commits August 19, 2025 10:04
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.
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.

2 participants