Skip to main content

GitLab issue anomaly detection and page generation

Project description

GitLab Issue Anomaly Detector

A Python package for detecting anomalies in GitLab issues and generating HTML reports.

Overview

This package analyzes GitLab issues to detect various anomalies such as:

  • Missing milestones or iterations
  • Insufficient descriptions
  • Stale issues
  • Blocked issues without details
  • And many more

It generates a comprehensive HTML report with interactive visualizations to help teams identify and address these anomalies.

Installation

pip install gitlab-detector

Usage

Command Line

# Run the anomaly detector and generate a report
gitlab-anomaly-detector

Environment Variables

Create a .env file with the following variables:

GITLAB_URL=https://gitlab.com
GITLAB_TOKEN=your_personal_access_token
GITLAB_PROJECT_ID=your_project_id

Viewing the Report

After running the tool, you can view the generated report by starting a local HTTP server:

python -m http.server 8008 -d public/

Then open your browser to http://localhost:8008

Features

Anomaly Detection

  • Issue Hygiene: Detect issues with poor descriptions, missing milestones, or missing iterations
  • Workflow Impediments: Identify blocked issues, stale issues, and scope creep
  • Priority Management: Flag high-priority issues that lack proper attention
  • Timeline Analysis: Track issues that are at risk of missing deadlines

Reporting

  • Interactive Dashboard: Filter and sort anomalies by type, severity, and owner
  • Milestone View: Group anomalies by milestone to identify at-risk deliverables
  • Iteration View: Track anomalies within your agile iterations
  • Export Functionality: Export data to Excel for further analysis

Testing

This package follows strict test-driven development practices. To run the tests:

# Activate the virtual environment
source .venv/bin/activate

# Run tests with pytest
python -m pytest tests/

Logging

The package implements robust logging throughout the codebase. Logs are output to stdout by default but can be configured via Python's standard logging module.

Example log output:

2025-05-15 22:57:01,584 - scripts.issue_anomaly_detector - DEBUG - Categorized anomaly 'poor_description' as 'hygiene'
2025-05-15 22:57:01,584 - scripts.issue_anomaly_detector - DEBUG - Categorized anomaly 'missing_milestone' as 'hygiene'

GitLab Pages with Dynamic Content

This project includes a custom GitLab CI/CD pipeline for GitLab Pages that generates dynamic content:

  1. A prepare-pages stage runs before the pages stage
  2. A Python script (scripts/prepare_pages.py) generates dynamic content:
    • Creates a data.json file with timestamp and sample data
    • Updates index.html to load and display the dynamic content
  3. The pages stage deploys the generated content

When you push to the main branch, the pipeline automatically runs and deploys your site to GitLab Pages.


Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin feature/your-feature-name
  5. Submit a pull request

Development Setup

# Clone the repository
git clone https://gitlab.com/my-group-name2452611/my-project-name.git
cd my-project-name

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate

# Install development dependencies
pip install -e .[dev]

Coding Standards

This project follows strict test-driven development practices:

  • Write tests before implementing features
  • Maintain high test coverage
  • Implement robust logging throughout the codebase
  • Follow PEP 8 style guidelines

License

This project is licensed under the MIT License - see the LICENSE file for details.

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_detector-0.0.1.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitlab_detector-0.0.1-py3-none-any.whl (59.5 kB view details)

Uploaded Python 3

File details

Details for the file gitlab_detector-0.0.1.tar.gz.

File metadata

  • Download URL: gitlab_detector-0.0.1.tar.gz
  • Upload date:
  • Size: 54.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for gitlab_detector-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f6e9e965a77f04379004d04d12be07005af45e795779626e66cb7f8376ddf4a1
MD5 79dc09c1c471a52f6184fbdf8b85dcf2
BLAKE2b-256 fba07e8c162098e569fbdc2b186bfa50cc5c8d0a879ecc43e891393ddc2dae28

See more details on using hashes here.

File details

Details for the file gitlab_detector-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gitlab_detector-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5436e243ab9bd0028c2138de9ad6cee6116ef5610edd8ad5245c77744eb3f36
MD5 30009cedf8dabff71efcbeba81bff4c8
BLAKE2b-256 9e005ee8be907e923137276b944c8ad6aae759bb5c848a98afc23bfbf944f0f4

See more details on using hashes here.

Supported by

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