Skip to content

Conversation

@PatrickHeneise
Copy link
Member

Summary

Adds user profile fetching for speaker information and documents
how to use existing APIs for talks repositories.

Closes #7
Closes #8

Changes

  • ✨ Add getUser() function to fetch user profiles
  • 📝 Add GraphQL query for user data with social accounts
  • ✅ Add comprehensive test suite
  • 📚 Document talks repository usage pattern
  • 📖 Update README with API documentation

API Usage - User Profiles

import { getUser } from 'gitevents-fetch'

const user = await getUser('octocat')
// Returns user profile with all metadata

Talks Repository Support

Talks stored as issues use existing event functions:

import { upcomingEvents, event } from 'gitevents-fetch'

const talks = await upcomingEvents('org', 'talks-repo')
const talk = await event('org', 'talks-repo', 42)

Features

  • ✅ User profile metadata (name, bio, company, location)
  • ✅ Social account links (LinkedIn, Twitter, etc.)
  • ✅ Follower/following/repository counts
  • ✅ Email and website information
  • ✅ Created/updated timestamps as Date objects
  • ✅ Returns null if user not found
  • ✅ Reuses existing event APIs for talks (no new code needed)

User Object Structure

{
  login: string | null
  name: string | null
  bio: string | null
  avatarUrl: string | null
  url: string | null
  websiteUrl: string | null
  company: string | null
  location: string | null
  email: string | null
  createdAt: Date | null
  updatedAt: Date | null
  followerCount: number
  followingCount: number
  publicRepoCount: number
  socialAccounts: Array<{
    provider: string
    url: string
  }>
}

Test Plan

  • Unit tests for parameter validation
  • Unit tests for successful user fetching
  • Unit tests for missing optional fields
  • Unit tests for user not found
  • Unit tests for GraphQL errors
  • Integration test with real API (octocat user)
  • README documentation for both features

🤖 Generated with Claude Code

Add user profile fetching and document talks repository usage.

## Changes

- Add getUser() function to fetch user profiles
- Add GraphQL query for user data with social accounts
- Add comprehensive test suite for user profiles
- Document how to fetch talks using existing event functions
- Update README with API documentation

## Features

- User profile metadata (name, bio, company, location)
- Social account links (LinkedIn, Twitter, etc.)
- Follower/following counts and repository count
- Reuses existing event APIs for talks repositories

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings October 29, 2025 16:40
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 adds a new getUser() function to fetch GitHub user profiles, which is useful for retrieving speaker information in the context of the GitEvents library. The feature includes a new GraphQL query, implementation logic, comprehensive tests, and updated documentation.

  • Implements getUser() function to fetch user profiles via GitHub GraphQL API
  • Adds comprehensive test coverage including parameter validation, success cases, error handling, and optional API integration tests
  • Updates documentation with usage examples and feature listing

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/users.js New module implementing the getUser() function with parameter validation and data transformation logic
src/graphql/user.gql GraphQL query definition for fetching user profile data
src/lib/parseGql.js Registers the new user query with the parseGql utility
src/index.js Exports the new getUser() function as part of the public API
test/users.test.js Comprehensive test suite covering validation, success cases, null handling, and error scenarios
README.md Documentation for the new feature with usage examples
package.json Version bump from 0.0.3-dev to 0.0.4
package-lock.json Lockfile updated to reflect version change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@PatrickHeneise PatrickHeneise changed the title feat: add user profiles and document talks usage (#7, #8) feat: add user profiles and document talks usage Oct 29, 2025
PatrickHeneise and others added 2 commits October 29, 2025 15:22
- Extract validateParams into shared utility module (src/lib/validateParams.js)
- Remove duplicated validateParams from events.js, teams.js, and users.js
- Align socialAccounts null handling with teams.js (remove redundant || null)
- Add updatedAt field to README example for completeness

Addresses code review comments from Copilot:
- #14 (comment)
- #14 (comment)
- #14 (comment)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Resolves merge conflicts by integrating both user profiles and file
fetching features from main branch.

Conflict resolutions:
- README.md: Added both user profiles and file fetching documentation
- src/index.js: Imported both getUserProfile and getFileContent, fixed
  getUser to use getGraphqlClient() with proper validation
- src/lib/parseGql.js: Added both userQuery and fileQuery imports

All 50 tests passing after merge.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@PatrickHeneise PatrickHeneise merged commit 0f716bd into main Oct 29, 2025
6 checks passed
@PatrickHeneise PatrickHeneise deleted the feature/user-profiles-7-8 branch October 29, 2025 22:20
@github-actions
Copy link

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for fetching speaker profiles Add enhanced support for talks from dedicated repository

2 participants