Skip to content

get_me return concise user response #638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 4, 2025
Merged

get_me return concise user response #638

merged 4 commits into from
Jul 4, 2025

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 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 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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy