+2
−0
testdata/get_workitem.json
0 → 100644
+56
−0
testdata/get_workitem_by_id.json
0 → 100644
+50
−0
+1
−0
Loading
Introduce a new `WorkItemsService` to provide high-level API access to GitLab's work items (epics, issues, and tasks) through GraphQL. This implementation includes: - `GetWorkItem(projectPath, iid)`: Get work item by project path and IID - `GetWorkItemByID(gid)`: Get work item by global ID (string or int64) - `WorkItem` struct with common fields in idiomatic Go types - Type conversion utilities for GraphQL responses: - `gidGQL`: Parse global IDs (e.g. "gid://gitlab/WorkItem/179785913") - `iidGQL`: Convert IID strings to int64 - `userCoreGQL`: Convert GraphQL UserCore to BasicUser - `workItemGQL`: Internal GraphQL response representation with unwrap() - Comprehensive test coverage including success and error scenarios - Generated mock interfaces and client registration This addresses the current gaps in the GitLab Go client: - No API support for tasks - Deprecated REST API for epics (replaced by work items) - High friction for GraphQL usage (manual query construction, custom struct definitions, type conversions) The service follows established patterns in the Go client (service-based architecture, `RequestOptionFunc` support, `ErrNotFound` for missing resources, separate internal/public types). Issue: #2213