Conversation
|
Hi @hjanuschka , I've been testing this and found a few compatibility issues with |
|
you have the PR link, i think i am not allowed to merge but it sounds reasonable and like a great idea!!! |
|
@hjanuschka You should be able to see the PR in your profile: hjanuschka#1 |
Features: - Add --gitlab <hostname> flag to enable GitLab mode - Add provider abstraction layer (provider package) - GitLab provider uses glab CLI for API calls - Support MR (Merge Request) terminology in GitLab mode - Support GitLab-specific query syntax (repo:, author:, assignee:, reviewer:, label:) - Tasks (merge, close, reopen, etc.) use glab mr commands in GitLab mode Usage: ./gh-dash --gitlab gitlab.example.com --config ./gitlab-config.yml Configuration: In GitLab mode, use 'repo:GROUP/PROJECT' in filters to specify the project. Prerequisites: - glab must be installed and configured with: glab auth login --hostname <your-gitlab-host>
- Fetch and cache label colors from GitLab API for each project - Use cached colors when displaying labels in MRs and Issues - Fall back to default gray color (6e7681) when no color is available - Handle both GitHub (no #) and GitLab (with #) color formats
- Fetch MR commits via GitLab API (projects/:id/merge_requests/:iid/commits) - Fetch MR changed files via GitLab API (projects/:id/merge_requests/:iid/changes) - Parse diff to count additions/deletions per file - Show file change count in MR overview (from changes_count field) - Commits tab now shows commit history with author and date - Files Changed tab now shows list of modified files with +/- stats
Updated all commands to use glab instead of gh when in GitLab mode: PR/MR operations: - diff: glab mr diff - checkout: glab mr checkout - comment: glab mr note - approve: glab mr approve - assign/unassign: glab mr update --assignee/--unassign - watch checks: glab ci status --live Issue operations: - close: glab issue close - reopen: glab issue reopen - comment: glab issue note - assign/unassign: glab issue update --assignee/--unassign - label: glab issue update --label/--unlabel
- Add Files field to EnrichedPullRequestData for GitLab - Convert provider ChangedFiles to data ChangedFiles - Update Files Changed tab to use enriched data when available - Update overview to show correct files/commits count from enriched data - Add GLAB_PAGER env var for glab mr diff command
- Use GitLab API endpoint (projects/:id/merge_requests/:iid/notes) instead of non-existent 'glab mr note list' command - Filter out system-generated notes (commits, description changes, etc.) - Update comment count to reflect actual user comments
Issue comments: - Add FetchIssueComments to Provider interface - Implement GitLab API call (projects/:id/issues/:iid/notes) - Filter out system-generated notes - Add enrichment mechanism to fetch comments when viewing an issue - Handle IssueCommentsMsg in UI to update sidebar Pagination: - Add --page flag support to FetchPullRequests and FetchIssues - Use EndCursor as page number (stored as string) - Return next page number in EndCursor for subsequent fetches
The syncSidebar() function returns a tea.Cmd that fetches issue comments for GitLab, but this command was not being executed in several places: - onViewedRowChanged: was overwriting cmd with PR enrich only - TogglePreview: was not using the returned cmd at all - Text input handlers: were not batching the sync cmd Fixed by: - Using tea.Batch to combine syncSidebar cmd with other cmds - Simplified EnrichIssueComments condition (always fetch if no nodes)
The bug was that after SetIssueComments updated the issue with fetched comments, syncSidebar() was called which re-fetched the row data from the section (without comments) and overwrote the updated data. Fix: Just update the sidebar content directly instead of calling syncSidebar() after setting comments. Also added debug logging to FetchIssueComments for troubleshooting.
- Add getRepoFlag() helper to return '--repo' for GitLab, '-R' for GitHub - Fix PRReady to use 'glab mr update --ready' for GitLab - Fix UpdatePR to use 'glab mr rebase' for GitLab (instead of update-branch) - Fix MergePR and CreatePR to use correct repo flag - Update task messages to use MR label for GitLab - Remove debug logging from FetchIssueComments
- Fetch pipeline jobs from GitLab API when enriching MR data - Display pipeline jobs in the Checks tab with status icons - Support both 'pipeline' and 'head_pipeline' fields from GitLab API - Add PipelineJob struct to provider and data layers - Calculate check stats from GitLab jobs for overview display
|
merged and fixed conflicts thx @LopezBanos |
|
@hjanuschka opened a PR against your branch to fix However, I can't seem to authenticate against gitlab.com (with your branch or my PR), see dropdown for more details. DetailsSeems to be these lines: https://github.com/hjanuschka/gh-dash/blob/d9be8ad8510d7ca1f7d08c9f6086265f242881fc/internal/provider/gitlab.go#L706-L731 Which uses the following command to get user: Here's the output of that command: I invoked |
|
any updates? 😁 |
|
can i take this over? |
|
@nicolaric please go ahead, i somehow got dragged away :D |
|
have a look here: hjanuschka#3 |
Summary
This PR adds support for GitLab instances, allowing users to use gh-dash with their GitLab servers via the
glabCLI.Features
--gitlab <hostname>flag: Enables GitLab mode and specifies which GitLab instance to connect tointernal/providerpackage that abstracts the differences between GitHub and GitLab APIsglabCLI for all API interactionsrepo:,author:,assignee:,reviewer:,label:filtersglab mrcommands in GitLab modeUsage
Configuration Example
Prerequisites
glabCLI must be installed (installation guide)glabmust be authenticated with the target GitLab instanceTechnical Details
Screenshots
Works the same as GitHub mode, but connects to GitLab instances