steampipe plugin install theapsgroup/gitlab

Table: gitlab_user_event

The gitlab_user_event table can be used to query information about user activity on a gitlab system.

Examples

List all issues worked on in the last week by user alice

select
project.full_path,
event.target_iid,
event.action_name
from
gitlab_user_event as event,
gitlab_project as project,
gitlab_user as u
where
event.project_id = project.id
and target_type = 'Issue'
and event.created_at > current_date - interval '7 days'
and event.author_id = u.id
and u.username = 'alice';

Get activity counts by project over the last 30 days by user bob

select
project.full_path,
count(project.full_path) as events
from
gitlab_user_event as event,
gitlab_project as project
where
event.project_id = project.id
and event.created_at > current_date - interval '30 days'
and event.author_id = u.id
and u.username = 'bob'
group by
project.full_path
order by
events;

Schema for gitlab_user_event

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
action_nametext=The action this event tracks: approved, closed, commented on, created, destroyed, expired, joined, left, merged, pushed to, reopened, updated
authorjsonbJSON struct describing the user
author_idbigint=The ID of the user who created the event
author_usernametextauthor_username
created_attimestamp with time zone>, >=, =, <, <=When the event was created
idbigintThe event ID
notejsonbJSON struct if there's a note
project_idbigintThe project ID
push_datajsonbJSON struct if there's push data
target_idbigintThe target ID
target_iidbigintThe target IID
target_titletextThe title of the target
target_typetext=What the event was: issue, milestone, merge_request, note, project, snippet, user