Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vlauciani/gitlab-reporter
A Python script that interacts with GitLab APIs to generate detailed commit reports grouped by project, including author, message, and timestamp.
https://github.com/vlauciani/gitlab-reporter
gitlab python report
Last synced: 16 days ago
JSON representation
A Python script that interacts with GitLab APIs to generate detailed commit reports grouped by project, including author, message, and timestamp.
- Host: GitHub
- URL: https://github.com/vlauciani/gitlab-reporter
- Owner: vlauciani
- License: apache-2.0
- Created: 2024-11-25T08:45:38.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-12-08T16:07:32.000Z (2 months ago)
- Last Synced: 2024-12-08T17:19:10.698Z (2 months ago)
- Topics: gitlab, python, report
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gitlab-reporter
This script is designed to fetch and display a structured summary of commits from GitLab projects using the GitLab API. \
The output groups commits by project, showing the author, commit message, and timestamp.Example:
```sh
Project: group_1/project_1
- Author: user_1
Message: Added Priority parameter. issue: #205
Date: 2024-11-21T15:25:22.000+01:00- Author: user_2
Message: Remove unused code
Date: 2024-11-20T18:12:40.000+01:00Project: group_3/project_1
- Author: user_1
Message: Fix bug on Shop table
Date: 2024-11-22T10:47:05.000+01:00
```## Getting started
Run the following command to execute the script using Docker
```sh
docker run -it --rm -v $(pwd):/opt -w /opt python:3.12.5 bash -c "pip install -r requirements.txt && clear && python script.py --help"usage: script.py [-h] -s STARTTIME -e ENDTIME -t TOKEN -g GITLAB [-u USER] [-p PROJECT] [-o OUTPUT]
Generate a GitLab commit report.
options:
-h, --help show this help message and exit
-s STARTTIME, --starttime STARTTIME
Start date (format: YYYY-MM-DD)
-e ENDTIME, --endtime ENDTIME
End date (format: YYYY-MM-DD)
-t TOKEN, --token TOKEN
Personal Access Token for GitLab API
-g GITLAB, --gitlab GITLAB
GitLab server URL (e.g., https://gitlab.example.com)
-u USER, --user USER Filter commits by a comma-separated list of users (author_name or author_email)
-p PROJECT, --project PROJECT
Filter by a comma-separated list of project names
-o OUTPUT, --output OUTPUT
Output file name (default: gitlab_report.txt)
```## Example
Generate a report for a specific date and user:
```sh
docker run -it --rm -v $(pwd):/opt -w /opt python:3.12.5 bash -c "pip install -r requirements.txt && clear && python script.py -s 2024-11-22 -e 2024-11-22 -t -g https://gitlab.com -u [email protected]"
```Generate a report for multiple projects and a specific user:
```sh
docker run -it --rm -v $(pwd):/opt -w /opt python:3.12.5 bash -c "pip install -r requirements.txt && clear && python script.py -s 2024-11-22 -e 2024-11-22 -t -g https://gitlab.com -p proxysql,dante8 -u [email protected]"
```Generate a report for a single project and multiple users:
```sh
docker run -it --rm -v $(pwd):/opt -w /opt python:3.12.5 bash -c "pip install -r requirements.txt && clear && python script.py -s 2024-11-22 -e 2024-11-22 -t -g https://gitlab.com -u [email protected],[email protected] -p bea"
```# Contribute
Thanks to your contributions!Here is a list of users who already contributed to this repository: \
![]()
# Author
(c) 2024 Valentino Lauciani vlauciani[at]gmail.com