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
Collaborator

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 and others added 3 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.
Copy link

codecov bot commented Sep 22, 2025

Codecov Report

❌ Patch coverage is 87.50000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.11%. Comparing base (ffc5df8) to head (863baf5).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
github/classroom.go 86.66% 4 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@gmlewis gmlewis left a 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!

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Sep 22, 2025
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 jferrl requested a review from gmlewis September 23, 2025 07:12
@jferrl
Copy link
Contributor Author

jferrl commented Sep 23, 2025

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!

@gmlewis changes done! 😃

Copy link
Contributor

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

LGTM

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Sep 23, 2025
Introduces test cases for invalid input options in GetAssignment, GetClassroom, ListClassrooms, and ListClassroomAssignments methods to improve error handling coverage.
@jferrl jferrl requested a review from gmlewis September 23, 2025 13:28
Copy link
Collaborator

@gmlewis gmlewis left a 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.

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 23, 2025

Fixes: #3684.

@gmlewis gmlewis merged commit 7e700a7 into google:master Sep 23, 2025
5 of 7 checks passed
@jferrl jferrl deleted the jferrl-jferrl-3684 branch September 24, 2025 07:59
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.

3 participants