-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Feature: gitlab service widget #4317
Conversation
# Conflicts: # public/locales/en/common.json
… number of blocks that can be displayed. * Removed unused code from gitlab widget
API output for [
{
"id": 36,
"project_id": 7,
"action_name": "closed",
"target_id": 2,
"target_iid": 2,
"target_type": "Issue",
"author_id": 34,
"target_title": "dddddddddd",
"created_at": "2024-11-15T22:20:57.593Z",
"author": {
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
},
"imported": false,
"imported_from": "none",
"author_username": "user"
},
{
"id": 35,
"project_id": 7,
"action_name": "opened",
"target_id": 2,
"target_iid": 2,
"target_type": "Issue",
"author_id": 34,
"target_title": "dddddddddd",
"created_at": "2024-11-15T22:20:36.887Z",
"author": {
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
},
"imported": false,
"imported_from": "none",
"author_username": "user"
},
{
"id": 34,
"project_id": 7,
"action_name": "opened",
"target_id": 1,
"target_iid": 1,
"target_type": "Issue",
"author_id": 34,
"target_title": "Issue 1",
"created_at": "2024-11-15T21:46:14.248Z",
"author": {
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
},
"imported": false,
"imported_from": "none",
"author_username": "user"
},
{
"id": 33,
"project_id": 7,
"action_name": "pushed to",
"target_id": null,
"target_iid": null,
"target_type": null,
"author_id": 34,
"target_title": null,
"created_at": "2024-11-15T21:22:14.015Z",
"author": {
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
},
"imported": false,
"imported_from": "none",
"push_data": {
"commit_count": 1,
"action": "pushed",
"ref_type": "branch",
"commit_from": "4a322bef03607e2aa9e70d88d568f7df464d1882",
"commit_to": "e305e9d0e8a01524c8bbdfadcf15333c96b77fc7",
"ref": "main",
"commit_title": "Add new file",
"ref_count": null
},
"author_username": "user"
}
] |
API output for [
{
"id": 1,
"iid": 1,
"project_id": 7,
"title": "Issue 1",
"description": "This is just an issue",
"state": "opened",
"created_at": "2024-11-15T21:46:13.978Z",
"updated_at": "2024-11-15T21:46:13.978Z",
"closed_at": null,
"closed_by": null,
"labels": [],
"milestone": null,
"assignees": [
{
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
}
],
"author": {
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
},
"type": "ISSUE",
"assignee": {
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
},
"user_notes_count": 0,
"merge_requests_count": 0,
"upvotes": 0,
"downvotes": 0,
"due_date": "2025-09-12",
"confidential": false,
"discussion_locked": null,
"issue_type": "issue",
"web_url": "http://gitlab.example.com/user/gitlab-openapi/-/issues/1",
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"has_tasks": true,
"task_status": "0 of 0 checklist items completed",
"_links": {
"self": "http://gitlab.example.com/api/v4/projects/7/issues/1",
"notes": "http://gitlab.example.com/api/v4/projects/7/issues/1/notes",
"award_emoji": "http://gitlab.example.com/api/v4/projects/7/issues/1/award_emoji",
"project": "http://gitlab.example.com/api/v4/projects/7",
"closed_as_duplicate_of": null
},
"references": {
"short": "#1",
"relative": "#1",
"full": "user/gitlab-openapi#1"
},
"severity": "UNKNOWN",
"moved_to_id": null,
"imported": false,
"imported_from": "none",
"service_desk_reply_to": null
}
] |
API output for [
{
"id": 1,
"iid": 1,
"project_id": 4,
"title": "Feature/cool-feature",
"description": "Adds cool-feature",
"state": "opened",
"created_at": "2024-11-22T00:51:31.181Z",
"updated_at": "2024-11-22T00:51:33.478Z",
"merged_by": null,
"merge_user": null,
"merged_at": null,
"closed_by": null,
"closed_at": null,
"target_branch": "main",
"source_branch": "feature/cool-feature",
"user_notes_count": 0,
"upvotes": 0,
"downvotes": 0,
"author": {
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
},
"assignees": [
{
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
}
],
"assignee": {
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
},
"reviewers": [
{
"id": 34,
"username": "user",
"name": "User N",
"state": "active",
"locked": false,
"avatar_url": null,
"web_url": "http://gitlab.example.com/user"
}
],
"source_project_id": 4,
"target_project_id": 4,
"labels": [],
"draft": false,
"imported": false,
"imported_from": "none",
"work_in_progress": false,
"milestone": null,
"merge_when_pipeline_succeeds": false,
"merge_status": "can_be_merged",
"detailed_merge_status": "mergeable",
"merge_after": null,
"sha": "b86a6d6c91ef014368a959cd3c3ea890ca8ecf19",
"merge_commit_sha": null,
"squash_commit_sha": null,
"discussion_locked": null,
"should_remove_source_branch": null,
"force_remove_source_branch": false,
"prepared_at": "2024-11-22T00:51:33.472Z",
"reference": "!1",
"references": {
"short": "!1",
"relative": "!1",
"full": "user/cool-repo!1"
},
"web_url": "http://gitlab.example.com/user/cool-repo/-/merge_requests/1",
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"squash": false,
"squash_on_merge": false,
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"has_conflicts": false,
"blocking_discussions_resolved": true
}
] |
Thanks. Is there an obvious way to reduce the amount of requests here without nuking the value of the widget? I.e. some other endpoint? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look and we should use https://docs.gitlab.com/ee/api/users.html#get-a-count-of-a-users-projects-groups-issues-and-merge-requests . I realize it's not a perfect replacement for what you had but fewer requests is an important target to aim for.
I just pushed the changes rather than make all of the suggestions. I'll hold off on merging until I hear back, and no hard feelings if you dont agree with the choice.
Thanks for contributing
No everything's good. That's the better endpoint to use. I guess I just overlooked it. So from my side it's good to go |
Thanks for your hard work on the project 👍 |
Proposed change
This adds a widget for Gitlab. It is able to list the amount of
events
as well as the openissues
and openmerge requests
Closes #3406
Type of change
Checklist: