Page MenuHomeSoftware Heritage

gitlab: Update requests query parameters
ClosedPublic

Authored by anlambert on Jul 23 2021, 2:07 PM.

Details

Summary

Increase number of origins per page to the maximum value allowed
by GitLab API (100) to send less requests.

Ask for simple responses to reduce size of JSON data.

Differences between non simple and simple responses:

simple=false

curl -H "Authorization: Bearer xxxxxxxx" "https://gitlab.com/api/v4/projects?id_after=13842415&membership=false&order_by=id&owned=false&page=1&pagination=keyset&per_page=100&repository_checksum_failed=false&simple=false&sort=asc&starred=false&statistics=false&wiki_checksum_failed=false&with_custom_attributes=false&with_issues_enabled=false&with_merge_requests_enabled=false" | jq

{
  "id": 13843320,
  "description": "",
  "name": "TaskDag4",
  "name_with_namespace": "Kenneth Olsen / TaskDag4",
  "path": "taskdag4",
  "path_with_namespace": "KennethOlsen/taskdag4",
  "created_at": "2019-08-16T09:50:59.646Z",
  "default_branch": "master",
  "tag_list": [],
  "topics": [],
  "ssh_url_to_repo": "git@gitlab.com:KennethOlsen/taskdag4.git",
  "http_url_to_repo": "https://gitlab.com/KennethOlsen/taskdag4.git",
  "web_url": "https://gitlab.com/KennethOlsen/taskdag4",
  "readme_url": "https://gitlab.com/KennethOlsen/taskdag4/-/blob/master/README.md",
  "avatar_url": null,
  "forks_count": 0,
  "star_count": 0,
  "last_activity_at": "2019-08-16T20:39:36.868Z",
  "namespace": {
    "id": 5846074,
    "name": "Kenneth Olsen",
    "path": "KennethOlsen",
    "kind": "user",
    "full_path": "KennethOlsen",
    "parent_id": null,
    "avatar_url": "https://secure.gravatar.com/avatar/6a8f21d3e41f8fb64b0a1ed459a6fca7?s=80&d=identicon",
    "web_url": "https://gitlab.com/KennethOlsen"
  },
  "container_registry_image_prefix": "registry.gitlab.com/kennetholsen/taskdag4",
  "_links": {
    "self": "https://gitlab.com/api/v4/projects/13843320",
    "issues": "https://gitlab.com/api/v4/projects/13843320/issues",
    "merge_requests": "https://gitlab.com/api/v4/projects/13843320/merge_requests",
    "repo_branches": "https://gitlab.com/api/v4/projects/13843320/repository/branches",
    "labels": "https://gitlab.com/api/v4/projects/13843320/labels",
    "events": "https://gitlab.com/api/v4/projects/13843320/events",
    "members": "https://gitlab.com/api/v4/projects/13843320/members"
  },
  "packages_enabled": true,
  "empty_repo": false,
  "archived": false,
  "visibility": "public",
  "owner": {
    "id": 4455920,
    "name": "Kenneth Olsen",
    "username": "KennethOlsen",
    "state": "active",
    "avatar_url": "https://secure.gravatar.com/avatar/6a8f21d3e41f8fb64b0a1ed459a6fca7?s=80&d=identicon",
    "web_url": "https://gitlab.com/KennethOlsen"
  },
  "resolve_outdated_diff_discussions": false,
  "issues_enabled": true,
  "merge_requests_enabled": true,
  "wiki_enabled": true,
  "jobs_enabled": true,
  "snippets_enabled": true,
  "container_registry_enabled": true,
  "service_desk_enabled": true,
  "service_desk_address": "incoming+kennetholsen-taskdag4-13843320-issue-@incoming.gitlab.com",
  "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": "enabled",
  "builds_access_level": "enabled",
  "snippets_access_level": "enabled",
  "pages_access_level": "enabled",
  "operations_access_level": "enabled",
  "analytics_access_level": "enabled",
  "emails_disabled": null,
  "shared_runners_enabled": true,
  "lfs_enabled": true,
  "creator_id": 4455920,
  "import_status": "none",
  "open_issues_count": 0,
  "ci_default_git_depth": 50,
  "ci_forward_deployment_enabled": null,
  "ci_job_token_scope_enabled": false,
  "public_jobs": true,
  "build_timeout": 3600,
  "auto_cancel_pending_pipelines": "enabled",
  "build_coverage_regex": null,
  "ci_config_path": null,
  "shared_with_groups": [],
  "only_allow_merge_if_pipeline_succeeds": false,
  "allow_merge_on_skipped_pipeline": null,
  "restrict_user_defined_variables": false,
  "request_access_enabled": false,
  "only_allow_merge_if_all_discussions_are_resolved": false,
  "remove_source_branch_after_merge": null,
  "printing_merge_request_link_enabled": true,
  "merge_method": "merge",
  "squash_option": "default_off",
  "suggestion_commit_message": null,
  "auto_devops_enabled": false,
  "auto_devops_deploy_strategy": "continuous",
  "autoclose_referenced_issues": true,
  "keep_latest_artifact": true,
  "approvals_before_merge": 0,
  "mirror": false,
  "external_authorization_classification_label": "",
  "marked_for_deletion_at": null,
  "marked_for_deletion_on": null,
  "requirements_enabled": true,
  "security_and_compliance_enabled": false,
  "compliance_frameworks": [],
  "issues_template": null,
  "merge_requests_template": null,
  "merge_pipelines_enabled": false,
  "merge_trains_enabled": false,
  "permissions": {
    "project_access": null,
    "group_access": null
  }
}

simple=true

{
  "id": 13843320,
  "description": "",
  "name": "TaskDag4",
  "name_with_namespace": "Kenneth Olsen / TaskDag4",
  "path": "taskdag4",
  "path_with_namespace": "KennethOlsen/taskdag4",
  "created_at": "2019-08-16T09:50:59.646Z",
  "default_branch": "master",
  "tag_list": [],
  "topics": [],
  "ssh_url_to_repo": "git@gitlab.com:KennethOlsen/taskdag4.git",
  "http_url_to_repo": "https://gitlab.com/KennethOlsen/taskdag4.git",
  "web_url": "https://gitlab.com/KennethOlsen/taskdag4",
  "readme_url": "https://gitlab.com/KennethOlsen/taskdag4/-/blob/master/README.md",
  "avatar_url": null,
  "forks_count": 0,
  "star_count": 0,
  "last_activity_at": "2019-08-16T20:39:36.868Z",
  "namespace": {
    "id": 5846074,
    "name": "Kenneth Olsen",
    "path": "KennethOlsen",
    "kind": "user",
    "full_path": "KennethOlsen",
    "parent_id": null,
    "avatar_url": "https://secure.gravatar.com/avatar/6a8f21d3e41f8fb64b0a1ed459a6fca7?s=80&d=identicon",
    "web_url": "https://gitlab.com/KennethOlsen"
  }
}

Diff Detail

Repository
rDLS Listers
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D6021 (id=21761)

Rebasing onto 73f85c0b8a...

Current branch diff-target is up to date.
Changes applied before test
commit 52c315015543340c9647174f206aabcfa438feb4
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Jul 23 13:59:52 2021 +0200

    gitlab: Update requests query parameters
    
    Increase number of origins per page to the maximum value allowed
    by GitLab API (100) to send less requests.
    
    Ask for simple responses to reduce size of JSON data.

See https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/334/ for more details.

This revision is now accepted and ready to land.Jul 23 2021, 2:38 PM
This revision was automatically updated to reflect the committed changes.