The GitHub Activity Monitoring card provides comprehensive activity metrics for GitHub repositories and organizations directly in the KubeStellar Console dashboard.
-
PR Trends - Track pull request activity over time
- View open, merged, and closed PRs
- Identify stale PRs (>30 days without updates)
- See PR status with color-coded indicators
- Draft PR identification
-
Issue Trends - Monitor issue creation, resolution, and aging patterns
- Track open and closed issues
- Highlight stale issues
- Show comment activity
- Direct links to GitHub
-
Star History - Display repository star count in stats grid
-
Contributor Activity - Show active contributors and contribution patterns
- View contributor avatars
- See contribution counts
- Sort by contributions
-
Release Tracking - Display recent releases
- Show version tags and release names
- Identify pre-releases
- Track release dates
- Link to release notes
- Repository Mode - Monitor a single repository in detail
- Organization Mode - Aggregate metrics across all repos in an org (planned)
- Multi-repo Mode - Track specific repos across different orgs (planned)
- Time Range Selector - Filter by 7d, 30d, 90d, or 1y
- Activity Stats Grid - Quick overview with:
- Open PRs (with stale count)
- Merged PRs
- Open Issues (with stale count)
- Star count
- View Mode Tabs - Switch between PRs, Issues, Releases, and Contributors
- Sorting Options - Sort by date, activity, or status
- Pagination - Handle large result sets efficiently
- Refresh Control - Manual refresh with last update timestamp
- Error Handling - Clear error messages with retry options
- A GitHub account
- Access to at least one GitHub repository (public or private)
- Optional: GitHub Personal Access Token for private repos or higher rate limits
- Open the KubeStellar Console
- Navigate to the Dashboard page
- Click the "+ Add Card" button
- Search for "GitHub Activity"
- Click on the card to add it to your dashboard
Click the settings icon on the card and configure:
{
"repos": ["kubestellar/console"],
"timeRange": "30d"
}Replace "kubestellar/console" with your repository in the format "owner/repo".
For private repositories or to increase API rate limits:
Generate Token:
- Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token"
- Select scope:
repo(Full control of private repositories) - Generate and copy the token (starts with
ghp_)
Add Token to Console:
- Open browser developer console (F12)
- Execute:
localStorage.setItem('github_token', 'ghp_your_token_here') - Refresh the card
Security Note: Tokens are stored in localStorage. For production use, consider implementing server-side token management.
- Switch Views: Click tabs at the top (PRs, Issues, Releases, Contributors)
- Filter by Time: Click time range buttons (7d, 30d, 90d, 1y)
- Sort: Use the sort dropdown for different ordering
- Navigate: Use pagination at the bottom
- Refresh: Click the refresh button to update data
The card accepts the following configuration options:
interface GitHubActivityConfig {
repos?: string[] // Array of repos in "owner/repo" format
org?: string // Organization name
mode?: 'repo' | 'org' | 'multi-repo'
token?: string // GitHub API token (optional, can also use localStorage)
timeRange?: '7d' | '30d' | '90d' | '1y'
}{
"card_type": "github_activity",
"title": "GitHub Activity",
"config": {
"repos": ["kubestellar/console"],
"timeRange": "30d"
}
}For private repositories or to increase API rate limits:
-
Generate a GitHub Personal Access Token:
- Go to GitHub → Settings → Developer settings → Personal access tokens
- Generate new token with
reposcope - Copy the token
-
Configure the token:
- Store in localStorage:
localStorage.setItem('github_token', 'ghp_...') - Or pass in config:
{ token: 'ghp_...' }
- Store in localStorage:
- Click the "+" button to add a new card
- Select "GitHub Activity" from the card list
- Configure repository details
- The card will immediately start fetching data
- Click on any PR/Issue/Release - Opens in GitHub in a new tab
- Change view mode - Click tabs at the top (PRs, Issues, Releases, Contributors)
- Adjust time range - Click time range buttons (7d, 30d, 90d, 1y)
- Sort results - Use the sort dropdown
- Paginate - Use pagination controls at the bottom
- Refresh - Click the refresh button in the header
The card uses:
- GitHub-style accent colors for different states:
- 🟢 Green for open PRs and merged items
- 🟣 Purple for merged PRs
- 🔴 Red for closed PRs
- 🟠 Orange for issues
- 🟡 Yellow for stale items
- 🔵 Blue for releases
- Dark mode optimized with secondary backgrounds
- Clean, data-dense layout similar to GitHub Insights
- Avatar images for contributors and PR/issue authors
- Status indicators and badges
The card uses the GitHub REST API v3:
GET /repos/{owner}/{repo}- Repository infoGET /repos/{owner}/{repo}/pulls- Pull requestsGET /repos/{owner}/{repo}/issues- IssuesGET /repos/{owner}/{repo}/releases- ReleasesGET /repos/{owner}/{repo}/contributors- Contributors
Rate limits:
- Unauthenticated: 60 requests/hour
- Authenticated: 5,000 requests/hour
- Location:
web/src/components/cards/GitHubActivity.tsx - Registry: Added to
cardRegistry.ts - Width: 8 columns (wide card)
- Category: External Integration
- Local state for UI controls (sorting, pagination, view mode)
- Custom hook
useGitHubActivityfor data fetching - Client-side GitHub API integration (no backend required)
- localStorage for GitHub token persistence
- Uses existing UI components:
CardControls,Pagination,RefreshButton,Skeleton - Lucide icons for visual indicators
- Standard fetch API for GitHub integration
- No additional npm packages required
Potential improvements for future versions:
- Activity Heatmap - GitHub contribution-style calendar view
- Advanced Contributor Leaderboard - Detailed stats and charts
- Configurable Refresh Interval - Auto-refresh every X minutes
- Organization Mode - Aggregate stats across org repos
- Multi-repo Mode - Track multiple repos with combined metrics
- PR Review Metrics - Time to review, approval counts
- Commit Activity - Commit frequency and patterns
- Branch Protection Status - Security compliance indicators
- Dependency Alerts - Security vulnerabilities from Dependabot
- GitHub Actions Status - CI/CD workflow status
Cause: Network error, rate limit, or invalid repository
Solutions:
- Check repository name format (
owner/repo) - Add GitHub token to increase rate limits
- Verify network connectivity
- Check browser console for detailed error
Cause: Card has no repos or org in config
Solution: Configure the card with at least one repository:
{
"repos": ["kubestellar/console"]
}Cause: Too many unauthenticated API requests
Solution: Add a GitHub Personal Access Token to increase limit from 60 to 5,000 requests/hour
{
"card_type": "github_activity",
"config": {
"repos": ["kubestellar/console"],
"timeRange": "30d"
}
}{
"card_type": "github_activity",
"config": {
"repos": [
"kubestellar/console",
"kubestellar/kubestellar"
],
"mode": "multi-repo"
}
}{
"card_type": "github_activity",
"config": {
"org": "kubestellar",
"mode": "org",
"timeRange": "90d"
}
}