Skip to main content

Scans GitLab instance and ranks projects against a set of criteria. Can be used to identiy projects that may have too much metadata/size to reliably export or import.

Project description

Evaluate

Evaluate is a script that can be run to gather information about all projects of a GitLab

  • Instance
  • Group (including sub-groups)

This information is useful to the GitLab Professional Services (PS) team to accurately scope migration services.

Use Case

GitLab PS plans to share this script with a Customer to run against their GitLab instance or group. Then the customer can send back the output files to enable GitLab engagement managers to scope engagements accurately. There are 3 output files.

Install Method

Usage

System level data gathering

Evaluate is meant to be run by an OWNER (ideally system ADMINISTRATOR) of a GitLab instance to gather data about every project on the instance or group (including sub-groups).

  1. A GitLab OWNER (ideally system ADMINISTRATOR) should provision an access token with api scope:

  2. Install gitlab-evaluate from the Install section above,

  3. Run :point_down:

    For evaluating a GitLab instance

    evaluate-gitlab -t <access-token-with-api-scope> -s https://gitlab.example.com
    

    For evaluating a GitLab group (including sub-groups)

    evaluate-gitlab -t <access-token-with-api-scope> -s https://gitlab.example.com -g 42
    
  4. This should create three files:

    • evaluate_output.csv
    • flags_evaluate_output.csv
    • report.txt

    For more information on these files, see reading the output

  5. If you're coordinating a GitLab PS engagement, email these files to the GitLab account team.

To gather CI data from a single repo

# For evaluating a single git repo's CI readiness
evaluate-ci-readiness -r|--repo <git-repo-url>

Command help screen

usage: evaluate-gitlab [-h] [-t TOKEN] [-s SOURCE] [-f FILENAME] [-o] [-i] [-p PROCESSES] [-g GROUP_ID]

optional arguments:
  -h, --help            show this help message and exit
  -t TOKEN, --token TOKEN
                        Personal Access Token: REQ'd
  -s SOURCE, --source SOURCE
                        Source URL: REQ'd
  -f FILENAME, --filename FILENAME
                        CSV Output File Name. If not set, will default to 'evaluate_output.csv'
  -o, --output          Output Per Project Stats to screen
  -i, --insecure        Set to ignore SSL warnings.
  -p PROCESSES, --processes PROCESSES
                        Number of processes. Defaults to number of CPU cores
  -g GROUP_ID, --group GROUP_ID
                        Group ID. Evaluate all group projects (including sub-groups)
usage: evaluate-ci-readiness [-h] [-r REPO]

optional arguments:
  -h, --help            show this help message and exit
  -r REPO, --repo REPO  Git Repository To Clone (ex: https://username:password@repo.com

pip Install

pip install gitlab-evaluate

Docker Container

Docker containers with evaluate installed are also available to use.

Local Usage

# Spin up container
docker run --name evaluate -it registry.gitlab.com/gitlab-org/professional-services-automation/tools/utilities/evaluate:latest /bin/bash

# In docker shell
evaluate-ci-readiness -r|--repo <git-repo-url>
evaluate-gitlab -t <access-token-with-api-scope> -s https://gitlab.example.com

Example GitLab CI job using evaluate ci readiness script

evaluate node-js:
  stage: test
  script:
    - evaluate-ci-readiness --repo=https://github.com/nodejs/node.git
  artifacts:
    paths:
      - node.csv

To test, consider standing up a local docker container of GitLab. Provision an access token with api scope and OWNER (ideally system ADMINISTRATOR) privileges. Create multiple projects with varying number of commits, pipelines, merge requests, issues. Consider importing an open source repo or using GPT to add projects to the system.

Design

Design for the script can be found here

Project Thresholds

Below are the thresholds we will use to determine whether a project can be considered for normal migration or needs to have special steps taken in order to migrate

Project Data

  • Project Size - 20GB
  • Pipelines - 5,000 max
  • Issues - 5,000 total (not just open)
  • Merge Requests - 5,000 total (not just merged)
  • Container images - 20GB per project
  • Packages - Any packages present

Repository Data

  • Repository Size - 5GB
  • Commits - 50K
  • Branches - 1K
  • Tags - 5K

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitlab_evaluate-0.9.0.tar.gz (20.4 kB view hashes)

Uploaded Source

Built Distribution

gitlab_evaluate-0.9.0-py3-none-any.whl (24.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page