Skip to content

Conversation

@LuluBeatson
Copy link
Contributor

@LuluBeatson LuluBeatson commented Jul 4, 2025

Update get_me tool to return a marshalled MinimalUser instead of a full User object, and extend MinimalUser with an optional nested UserDetails.

Example

image
{
    "login": "LuluBeatson",
    "id": 59149422,
    "profile_url": "https://github.com/LuluBeatson",
    "avatar_url": "https://avatars.githubusercontent.com/u/59149422?v=4",
    "details": {
        "name": "Lulu",
        "blog": "lulubeatson.com",
        "location": "London, UK",
        "public_repos": 31,
        "public_gists": 1,
        "followers": 0,
        "following": 5,
        "created_at": "2019-12-22T21:15:47Z",
        "updated_at": "2025-06-05T06:41:06Z"
    }
}

@LuluBeatson LuluBeatson changed the title Omit site_admin from get_me output get_me return MinimalUser Jul 4, 2025
@LuluBeatson LuluBeatson marked this pull request as ready for review July 4, 2025 11:15
Copilot AI review requested due to automatic review settings July 4, 2025 11:15
@LuluBeatson LuluBeatson requested a review from a team as a code owner July 4, 2025 11:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR changes the get_me tool to return a slimmed-down MinimalUser instead of the full User object, aligning it with search_users output.

  • Map and return only selected fields (Login, ID, ProfileURL, AvatarURL) in GetMe
  • Update tests to unmarshal into MinimalUser and assert on Login and ProfileURL
  • Remove assertions for full-user fields (Name, Email, Bio, Type)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/github/context_tools.go Build and marshal a MinimalUser with only login, ID, and URLs
pkg/github/context_tools_test.go Switch test to expect MinimalUser and update assertions accordingly
Comments suppressed due to low confidence (1)

pkg/github/context_tools_test.go:126

  • Add assertions to verify returnedUser.ID and returnedUser.AvatarURL against the expected values so that all fields in MinimalUser are covered by tests.
			assert.Equal(t, *tc.expectedUser.HTMLURL, returnedUser.ProfileURL)

@LuluBeatson LuluBeatson changed the title get_me return MinimalUser get_me return concise user response Jul 4, 2025
Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums 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!

@SamMorrowDrums SamMorrowDrums merged commit e43fca1 into main Jul 4, 2025
16 checks passed
@SamMorrowDrums SamMorrowDrums deleted the lulu/get-me branch July 4, 2025 12:58
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