Skip to content

Releases: carefree666/gitlab-code-stats

v1.0.1

04 Nov 08:04

Choose a tag to compare

GitLab Stats v1.0.1 – 2025-11-04

Overview

This release introduces key optimizations to enhance configuration flexibility and user management. The tool now provides smarter fallback behavior for user queries and allows customizing the web service port.

What's Improved

🔧 Configuration & Behavior Optimizations
Smart User Query Fallback:
When no users are specified in the configuration file, the system now automatically queries and collects statistics for all GitLab users, eliminating the need for manual user list maintenance in basic setups.

Customizable Web Service Port:
Added support for defining the web server startup port via configuration file, providing greater deployment flexibility and avoiding port conflicts in multi-instance environments.

v1.0.0

31 Oct 07:50

Choose a tag to compare

GitLab Stats v1.0.0 – 2025-10-31

Overview

First stable release of GitLab Stats, a Python-based tool to collect GitLab commit statistics and export results in CSV format.
Also provides a Web API for querying statistics and downloading CSV reports.

Features

  • CLI support: Generate CSV reports from terminal.
  • Web API support: Start a FastAPI server to query statistics.
  • Configurable users: Collect stats for specific GitLab usernames.
  • Date range filtering: Specify start_date and end_date.
  • Maximum lines per commit: Limit counted additions/deletions per commit (max_lines_per_commit in config, default 1000).
  • Friendly error handling: Empty or invalid user lists are reported clearly.
  • Docker support: Build and run container images.
  • Makefile support: Run, package, and build Docker images easily.

CLI Usage

make run
  • Generates CSV output (gitlab_code_stats.csv by default).
  • Configurable via config.json.

Web API Usage

make web
{
  "start_date": "2025-10-01T00:00:00Z",
  "end_date": "2025-10-31T23:59:59Z",
  "users": ["zhangsan"]
}
  • Example CSV response fields:
    Username, Name, CommitCount, TotalLines, Additions, Deletions

Docker Usage

Build and run Docker image:

make docker-build

Or manually:

docker build -t gitlab-stats .
docker run -v $(pwd)/config.json:/app/config.json gitlab-stats
  • Multi-arch supported: linux/amd64, linux/arm64.

Packaging

Create source tar.gz package:

make package

Configuration

Example config.json:

{
  "api_url": "https://gitlab.example.com/api/v4",
  "private_token": "YOUR_TOKEN_HERE",
  "start_date": "2025-10-01T00:00:00Z",
  "end_date": "2025-10-31T23:59:59Z",
  "users": ["zhangsan"],
  "output_filename": "gitlab_code_stats.csv",
  "max_lines_per_commit": 1000
}

Known Issues

  • Only supports GitLab REST API v4.
  • Fetching commits for very large repositories may be slow.

Future Improvements

  • Optimize pagination for massive commit histories.
  • Support self-hosted GitLab instances with custom SSL certificates.
  • Web UI dashboard for visualization.

Full Changelog: https://github.com/carefree666/gitlab-code-stats/commits/v1.0.0