Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Fetch GitHub Team name for Classroom Assistant #1727

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

srinjoym
Copy link
Contributor

@srinjoym srinjoym commented Jan 2, 2019

Fetch the team name from GitHub everytime we serialize a group assignment repo. This fixes education/classroom-assistant#117

@srinjoym srinjoym self-assigned this Jan 2, 2019
@srinjoym srinjoym added the WIP 💭 PR's that are a 'Work In Progress' label Jan 3, 2019
@stale
Copy link

stale bot commented Mar 4, 2019

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Mar 4, 2019
@stale stale bot removed the stale label Jun 3, 2019
@stale
Copy link

stale bot commented Aug 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Aug 2, 2019
@andrewbredow andrewbredow removed the request for review from BenEmdon September 11, 2019 13:10
@stale stale bot removed the stale label Sep 11, 2019
@andrewbredow andrewbredow requested a review from a team September 11, 2019 13:10
@ghost ghost requested a review from jeffrafter September 11, 2019 13:10
@andrewbredow
Copy link
Contributor

@srinjoym Is this still WIP? Should we close it?

@andrewbredow andrewbredow added this to In progress in GitHub Classroom via automation Sep 11, 2019
@andrewbredow andrewbredow moved this from In progress to Icebox in GitHub Classroom Oct 7, 2019
Copy link
Contributor

@jeffrafter jeffrafter left a comment

Choose a reason for hiding this comment

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

Small clarification but I love how simple this is ❇️

@@ -6,7 +6,7 @@ class GroupAssignmentRepoSerializer < ActiveModel::Serializer
attributes :displayName

def username
object.group.title
object.group.github_team.name
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm trying to understand the implications of fetching from the API here; If I am understanding correctly we fetch from the API every time we access the github_* properties. This means every time we serialize a GroupAssignmentRepo to JSON we will hit the github API. The main place this feels problematic is here:

repos = GroupAssignmentRepo.where(group_assignment: @group_assignment).order(:id)
paginate json: repos

This introduces and github API N+1 if I am reading this right. I'm not clear if that is acceptable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Depending on our setup, I think OctoKit would cache these at the client level?

Copy link
Contributor

Choose a reason for hiding this comment

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

Octokit should cache them, correct

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fix 🛠️ WIP 💭 PR's that are a 'Work In Progress'
Projects
GitHub Classroom
  
Icebox
Development

Successfully merging this pull request may close these issues.

Classroom Assitant doesn't update team's name
5 participants