steampipe plugin install theapsgroup/gitlab

Table: gitlab_project

The gitlab_project table will obtain information from all projects the user would be able to see, public/associated.

Note: When used with the Public GitLab you must specify an = qualifier for at least one of the following fields.

  • id
  • owner_id
  • owner_username

This is to prevent attempting to return ALL public projects which would result in an error.

Examples

Get all projects

Note: This query will not work on the hosted SaaS (See note at top of page).

select
*
from
gitlab_project;

Get all projects for a specific owner

select
id,
namespace_full_path as project
from
gitlab_project
where
owner_username = 'test';

Get top 10 projects based on stars

Note: This query will not work on the hosted SaaS (See note at top of page).

select
namespace_full_path as project,
star_count
from
gitlab_project
order by
star_count desc
limit
10;

Get project creation information

select
u.username as creator,
p.full_path as project,
p.created_at as created
from
gitlab_project p
inner join gitlab_user u on p.creator_id = u.id
and u.username = 'test';

Query examples

Schema for gitlab_project

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
allow_merge_on_skipped_pipelinebooleanIndicates if merges are allowed if the pipeline is skipped.
analytics_access_leveltextThe access level for analytics.
approvals_before_mergebigintThe project setting for number of approvals required before a merge request can be merged.
archivedbooleanIndicates if the project is archived.
autoclose_referenced_issuesbooleanIndicates if referenced issues will be automatically closed by merges in the project.
avatar_urltextThe url for the projects avatar.
builds_access_leveltextThe access level for builds.
ci_config_pathtextThe path of the CI configuration.
ci_forward_deployment_enabledbooleanIndicates if ci forward deployments are enabled.
ci_separated_cachesbooleanIndicates if the CI uses separate caches.
commit_countbigintThe number of commits on the project.
container_expiration_policyjsonbJSON Object outlining the expiration policy attached to the container registry.
container_registry_access_leveltextAccess level of current user for the container registry.
container_registry_enabledbooleanIndicates if the project has the container registry enabled.
container_registry_image_prefixtextThe image prefix for the container registry.
created_attimestamp with time zoneTimestamp of when project was created.
creator_idbigintThe ID of the projects creator. - link to `gitlab_user.id`
default_branchtextThe projects default branch name.
descriptiontextThe projects description.
empty_repobooleanIndicates if the repository of the project is empty.
fork_parent_idbigintID of the fork parent.
fork_parent_nametextFull name of the fork parent.
fork_parent_pathtextFull path of the fork parent.
fork_parent_urltextThe url of the fork parent.
forking_access_leveltextThe access level for forks/forking.
forks_countbigintThe number of forks of the project.
full_nametextThe projects name including namespace.
full_pathtextThe projects path including namespace.
http_urltextThe http url to the project repository.
idbigint=The ID of the project.
import_errortextError of importing project (if any).
import_statustextStatus of project import.
issues_access_leveltextThe access level for issues.
issues_enabledbooleanIndicates if project has issues enabled.
job_artifacts_sizebigintThe size of projects job artifacts on disk.
jobs_enabledbooleanIndicates if the project has jobs enabled.
last_activity_attimestamp with time zoneTimestamp of when last activity happened on the project.
lfs_enabledbooleanIndicates if the project has large file system enabled.
lfs_objects_sizebigintThe size of the projects LFS objects on disk.
licensetextThe projects license type.
license_keytextThe projects license spdx id/key.
license_urltextThe url for the license of the project.
marked_for_deletion_attimestamp with time zoneTimestamp of when project was marked for deletion.
merge_methodtextThe projects default merge method (merge, squash, rebase, etc).
merge_requests_access_leveltextThe access level for merge requests.
merge_requests_enabledbooleanIndicates if merge requests are enabled on the project
mirrorbooleanIndicates if the project is a mirror
mirror_overwrites_diverged_branchesbooleanIndicates if the mirror can overwrite diverged branches.
mirror_trigger_buildsbooleanIndicates if the mirror can trigger builds.
mirror_user_idbigintID of the user whom configured the mirror
nametextThe projects name.
namespace_full_pathtextThe full path of the namespace to which the project belongs.
namespace_idbigintThe ID of the namespace to which the project belongs.
namespace_kindtextThe kind of the namespace to which the project belongs.
namespace_nametextThe name of the namespace to which the project belongs.
namespace_pathtextThe path of the namespace to which the project belongs.
only_allow_merge_if_all_discussions_are_resolvedbooleanIndicates if merges are only allowed when all discussions are resolved.
only_allow_merge_if_pipeline_succeedsbooleanIndicates if merges are only allowed when the pipeline succeeds.
only_mirror_protected_branchesbooleanIndicates if only protected branches are mirrored.
open_issues_countbigintA count of open issues on the project.
operations_access_leveltextThe access level for operations.
owner_idbigint=The projects owner ID. (null if owned by a group) - link to `gitlab_user.id`
owner_nametextThe display name for the projects owner.
owner_usernametext=The projects owner username. (null if owned by a group) - link to `gitlab_user.username`
packages_enabledbooleanIndicates if the project has packages enabled.
pages_access_leveltextThe access level for pages.
pathtextThe projects path.
publicbooleanIndicates if the project is public
public_jobsbooleanIndicates if the project has/allows public jobs.
readme_urltextThe url for the projects readme file
remove_source_branch_after_mergebooleanIndicates if source branches are removed after merge by default on the project.
repository_access_leveltextThe access level for the repository.
repository_sizebigintThe size of the projects repository on disk.
repository_storagetextThe type of storage used by the repository.
request_access_enabledbooleanIndicates if the project has request access enabled.
resolve_outdated_diff_discussionsbooleanIndicates if outdated diff discussions should be resolved.
runners_tokentextThe token used for runners by the project.
shared_runners_enabledbooleanIndicates if the project has shared runners enabled.
snippets_access_leveltextThe access level for snippets.
snippets_enabledbooleanIndicates if the project has snippets enabled.
ssh_urltextThe ssh url for the project repository.
star_countbigintThe number of stars given to the project.
storage_sizebigintThe size of the project on disk.
tag_listjsonbAn array of tags associated to the project.
topicsjsonbAn array of topics associated to the project.
visibilitytextThe projects visibility level (private/public/internal)
web_urltextThe projects url.
wiki_access_leveltextThe access level for the wiki.
wiki_enabledbooleanIndicates if the project has the wiki enabled.