Page MenuHomeSoftware Heritage

fetch extrinsic origin metadata from GitLab instances
Closed, MigratedEdits Locked

Description

(analogous to T1740, but for repos hosted on GitLab instances)

Info about an individual repository (called "project" in GitLab terminology) can be obtained using the /projects endpoint, e.g.:

$ curl --silent "https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab" | jq     
{
  "id": 278964,
  "description": "GitLab is an open source end-to-end software development platform with built-in version control, issue tracking, code review, CI/CD, and more. Self-host GitLab on your own servers, in a container, or on a cloud provider.",
  "name": "GitLab",
  "name_with_namespace": "GitLab.org / GitLab",
  "path": "gitlab",
  "path_with_namespace": "gitlab-org/gitlab",
  "created_at": "2015-05-20T10:47:11.949Z",
  "default_branch": "master",
  "tag_list": [],
  "ssh_url_to_repo": "git@gitlab.com:gitlab-org/gitlab.git",
  "http_url_to_repo": "https://gitlab.com/gitlab-org/gitlab.git",
  "web_url": "https://gitlab.com/gitlab-org/gitlab",
  "readme_url": "https://gitlab.com/gitlab-org/gitlab/-/blob/master/README.md",
  "avatar_url": "https://assets.gitlab-static.net/uploads/-/system/project/avatar/278964/logo-extra-whitespace.png",
  "forks_count": 2523,
  "star_count": 2188,
  "last_activity_at": "2020-10-13T07:46:13.144Z",
  "namespace": {
    "id": 9970,
    "name": "GitLab.org",
    "path": "gitlab-org",
    "kind": "group",
    "full_path": "gitlab-org",
    "parent_id": null,
    "avatar_url": "/uploads/-/system/group/avatar/9970/logo-extra-whitespace.png",
    "web_url": "https://gitlab.com/groups/gitlab-org"
  }
}

Event Timeline

zack updated the task description. (Show Details)
zack updated the task description. (Show Details)

GitLab returns very little data while logged out, so we won't be able to collect much. This seems to differ from their documentation, so I opened a ticket https://gitlab.com/gitlab-org/gitlab/-/issues/361952

For comparison, here is what I get while authenticated (despite not having any particular permission):

{
  "id": 278964,
  "description": "GitLab is an open source end-to-end software development platform with built-in version control, issue tracking, code review, CI/CD, and more. Self-host GitLab on your own servers, in a container, or on a cloud provider.",
  "name": "GitLab",
  "name_with_namespace": "GitLab.org / GitLab",
  "path": "gitlab",
  "path_with_namespace": "gitlab-org/gitlab",
  "created_at": "2015-05-20T10:47:11.949Z",
  "default_branch": "master",
  "tag_list": [],
  "topics": [],
  "ssh_url_to_repo": "git@gitlab.com:gitlab-org/gitlab.git",
  "http_url_to_repo": "https://gitlab.com/gitlab-org/gitlab.git",
  "web_url": "https://gitlab.com/gitlab-org/gitlab",
  "readme_url": "https://gitlab.com/gitlab-org/gitlab/-/blob/master/README.md",
  "avatar_url": "https://gitlab.com/uploads/-/system/project/avatar/278964/project_avatar.png",
  "forks_count": 6343,
  "star_count": 3813,
  "last_activity_at": "2022-07-06T10:24:34.644Z",
  "namespace": {
    "id": 9970,
    "name": "GitLab.org",
    "path": "gitlab-org",
    "kind": "group",
    "full_path": "gitlab-org",
    "parent_id": null,
    "avatar_url": "/uploads/-/system/group/avatar/9970/project_avatar.png",
    "web_url": "https://gitlab.com/groups/gitlab-org"
  },
  "container_registry_image_prefix": "registry.gitlab.com/gitlab-org/gitlab",
  "_links": {
    "self": "https://gitlab.com/api/v4/projects/278964",
    "issues": "https://gitlab.com/api/v4/projects/278964/issues",
    "merge_requests": "https://gitlab.com/api/v4/projects/278964/merge_requests",
    "repo_branches": "https://gitlab.com/api/v4/projects/278964/repository/branches",
    "labels": "https://gitlab.com/api/v4/projects/278964/labels",
    "events": "https://gitlab.com/api/v4/projects/278964/events",
    "members": "https://gitlab.com/api/v4/projects/278964/members",
    "cluster_agents": "https://gitlab.com/api/v4/projects/278964/cluster_agents"
  },
  "packages_enabled": true,
  "empty_repo": false,
  "archived": false,
  "visibility": "public",
  "resolve_outdated_diff_discussions": false,
  "container_expiration_policy": {
    "cadence": "1d",
    "enabled": true,
    "keep_n": 100,
    "older_than": "90d",
    "name_regex": ".*",
    "name_regex_keep": "(?:v.+|master|main)",
    "next_run_at": "2022-07-07T01:31:58.754Z"
  },
  "issues_enabled": true,
  "merge_requests_enabled": true,
  "wiki_enabled": false,
  "jobs_enabled": true,
  "snippets_enabled": true,
  "container_registry_enabled": true,
  "service_desk_enabled": false,
  "can_create_merge_request_in": true,
  "issues_access_level": "enabled",
  "repository_access_level": "enabled",
  "merge_requests_access_level": "enabled",
  "forking_access_level": "enabled",
  "wiki_access_level": "disabled",
  "builds_access_level": "enabled",
  "snippets_access_level": "enabled",
  "pages_access_level": "enabled",
  "operations_access_level": "enabled",
  "analytics_access_level": "enabled",
  "container_registry_access_level": "enabled",
  "security_and_compliance_access_level": "private",
  "emails_disabled": false,
  "shared_runners_enabled": true,
  "lfs_enabled": true,
  "creator_id": 5497,
  "import_status": "finished",
  "open_issues_count": 43850,
  "ci_default_git_depth": null,
  "ci_forward_deployment_enabled": false,
  "ci_job_token_scope_enabled": false,
  "ci_separated_caches": false,
  "ci_opt_in_jwt": false,
  "public_jobs": true,
  "build_timeout": 10800,
  "auto_cancel_pending_pipelines": "enabled",
  "build_coverage_regex": "",
  "ci_config_path": "",
  "shared_with_groups": [
    {
      "group_id": 10589162,
      "group_name": "cicd-templates",
      "group_full_path": "gitlab-org/maintainers/cicd-templates",
      "group_access_level": 40,
      "expires_at": null
    },
    {
      "group_id": 8306194,
      "group_name": "Manage Auth Group",
      "group_full_path": "gitlab-org/manage/authentication-and-authorization",
      "group_access_level": 30,
      "expires_at": null
    },
    {
      "group_id": 4654006,
      "group_name": "Application Security",
      "group_full_path": "gitlab-com/gl-security/appsec",
      "group_access_level": 30,
      "expires_at": null
    },
    {
      "group_id": 8552558,
      "group_name": "Threat Insights Backend Team",
      "group_full_path": "gitlab-org/secure/threat-insights-backend-team",
      "group_access_level": 30,
      "expires_at": null
    },
    {
      "group_id": 6150316,
      "group_name": "frontend",
      "group_full_path": "gitlab-org/maintainers/frontend",
      "group_access_level": 40,
      "expires_at": null
    },
    {
      "group_id": 3910297,
      "group_name": "GitLab Delivery",
      "group_full_path": "gitlab-org/delivery",
      "group_access_level": 40,
      "expires_at": null
    },
    {
      "group_id": 7196368,
      "group_name": "product-intelligence",
      "group_full_path": "gitlab-org/growth/product-intelligence",
      "group_access_level": 30,
      "expires_at": null
    },
    {
      "group_id": 5924764,
      "group_name": "database",
      "group_full_path": "gitlab-org/maintainers/database",
      "group_access_level": 40,
      "expires_at": null
    },
    {
      "group_id": 3205033,
      "group_name": "gl-quality",
      "group_full_path": "gl-quality",
      "group_access_level": 30,
      "expires_at": null
    },
    {
      "group_id": 1356356,
      "group_name": "GitLab docs team",
      "group_full_path": "gl-docsteam",
      "group_access_level": 30,
      "expires_at": null
    },
    {
      "group_id": 5747833,
      "group_name": "eng-prod",
      "group_full_path": "gl-quality/eng-prod",
      "group_access_level": 30,
      "expires_at": null
    },
    {
      "group_id": 3887968,
      "group_name": "rails-backend",
      "group_full_path": "gitlab-org/maintainers/rails-backend",
      "group_access_level": 40,
      "expires_at": null
    }
  ],
  "only_allow_merge_if_pipeline_succeeds": true,
  "allow_merge_on_skipped_pipeline": false,
  "restrict_user_defined_variables": false,
  "request_access_enabled": false,
  "only_allow_merge_if_all_discussions_are_resolved": true,
  "remove_source_branch_after_merge": true,
  "printing_merge_request_link_enabled": true,
  "merge_method": "merge",
  "squash_option": "default_off",
  "enforce_auth_checks_on_uploads": true,
  "suggestion_commit_message": "",
  "merge_commit_template": null,
  "squash_commit_template": "%{first_multiline_commit}",
  "auto_devops_enabled": false,
  "auto_devops_deploy_strategy": "continuous",
  "autoclose_referenced_issues": false,
  "keep_latest_artifact": true,
  "runner_token_expiration_interval": null,
  "approvals_before_merge": 1,
  "mirror": false,
  "external_authorization_classification_label": "",
  "marked_for_deletion_at": null,
  "marked_for_deletion_on": null,
  "requirements_enabled": true,
  "requirements_access_level": "enabled",
  "security_and_compliance_enabled": false,
  "compliance_frameworks": [],
  "issues_template": "",
  "merge_requests_template": "",
  "merge_pipelines_enabled": true,
  "merge_trains_enabled": false,
  "permissions": {
    "project_access": null,
    "group_access": null
  }
}