Skip to main content

Automatyczne generowanie ticketów GitHub na podstawie plików markdown z błędami poleceń

Project description

mdiss - Markdown Issues

PyPI version Python Version License Tests Coverage Documentation Status Code style: black PyPI Downloads GitHub last commit

Automatyczne generowanie ticketów GitHub na podstawie plików markdown z błędami poleceń.

🚀 Szybki start

# Instalacja
pip install mdiss

# Konfiguracja tokenu GitHub
mdiss setup

# Analiza pliku markdown
mdiss analyze paste.txt

# Tworzenie issues na GitHub (dry run)
mdiss create paste.txt owner repo --dry-run

# Tworzenie rzeczywistych issues
mdiss create paste.txt owner repo

📋 Funkcje

  • Automatyczne parsowanie - Wyodrębnia nieudane polecenia z plików markdown
  • Inteligentna analiza - Określa priorytet i kategorię błędów
  • Sugestie rozwiązań - Automatyczne sugerowanie sposobów naprawy
  • GitHub Integration - Bezpośrednie tworzenie issues z odpowiednimi labelami
  • Bezpieczny token management - Automatyczne konfigurowanie uprawnień
  • Dry run mode - Testowanie bez tworzenia rzeczywistych issues
  • Export danych - JSON, CSV, tabele
  • Rich CLI - Kolorowy interfejs wiersza poleceń

🛠️ Instalacja

Z PyPI

pip install mdiss

Z kodu źródłowego

git clone https://github.com/wronai/mdiss.git
cd mdiss
poetry install

Deweloperska

git clone https://github.com/wronai/mdiss.git
cd mdiss
make dev

📖 Użycie

1. Konfiguracja

# Interaktywna konfiguracja tokenu GitHub
mdiss setup

Automatycznie otworzy stronę GitHub z formularzem generowania tokenu z odpowiednimi uprawnieniami:

  • repo - dostęp do repozytoriów
  • write:issues - tworzenie issues

2. Analiza pliku markdown

# Podstawowa analiza
mdiss analyze paste.txt

# Eksport do różnych formatów
mdiss export paste.txt --format json --output data.json
mdiss export paste.txt --format csv --output data.csv

3. Tworzenie issues

# Dry run (tylko podgląd)
mdiss create paste.txt owner repo --dry-run

# Tworzenie z tokenem z pliku
mdiss create paste.txt owner repo --token-file .mdiss_token

# Z dodatkowymi opcjami
mdiss create paste.txt owner repo \
    --assignees "user1,user2" \
    --milestone 5 \
    --skip-existing

4. Zarządzanie issues

# Lista issues w repozytorium
mdiss list-issues owner repo

# Z filtrami
mdiss list-issues owner repo --state closed --labels "bug,high"

📊 Analiza błędów

mdiss automatycznie kategoryzuje błędy i określa priorytety:

Kategorie błędów

| Kategoria | Opis | Przykład |
|-----------|------|----------|
| `dependencies` | Problemy z zależnościami | Poetry lock file issues |
| `missing-files` | Brakujące pliki | package.json not found |
| `permissions` | Problemy z uprawnieniami | Cannot install --user in venv |
| `timeout` | Przekroczenie czasu | Command timed out |
| `syntax` | Błędy składni | YAML parsing errors |
| `configuration` | Problemy konfiguracji | Invalid config files |

Priorytety

  • CRITICAL - Segmentation faults, krytyczne błędy systemu
  • HIGH - Timeouts, problemy z dependencies
  • MEDIUM - Standardowe błędy, brakujące pliki
  • LOW - Drobne problemy

Sugestie rozwiązań

Dla każdej kategorii mdiss generuje konkretne kroki naprawy:

**Rozwiązanie problemu z zależnościami:**

1. **Aktualizacja lock file:**
   ```bash
   poetry lock --no-update
   poetry install
  1. Jeśli nadal problemy:
    poetry lock
    poetry install --sync
    

## 🔧 Format pliku markdown

mdiss rozpoznaje pliki w formacie:

```markdown
## X. Nazwa polecenia

**Command:** `polecenie`
**Source:** ścieżka/do/pliku
**Type:** typ_polecenia
**Status:** ❌ Failed
**Return Code:** kod_błędu
**Execution Time:** czas_w_sekundach

**Output:**

standardowy output


**Error Output:**

komunikaty błędów


**Metadata:**
- **klucz1:** wartość1
- **klucz2:** wartość2

---

🏷️ Przykład wygenerowanego issue

Tytuł: Fix failed command: Make target: install

Treść:

## Problem Description
Command `make install` is failing consistently.

**Priority**: HIGH  
**Category**: dependencies  
**Confidence**: 90%

### Error Analysis
🔍 **Root Cause**: Poetry lock file is out of sync with pyproject.toml...

### Suggested Solution
1. Run `poetry lock` to regenerate the lock file
2. Run `poetry install` to install dependencies
3. Commit the updated poetry.lock file

### Labels
- bug
- high  
- dependencies
- make_target

🛡️ Bezpieczeństwo

  • Token GitHub przechowywany lokalnie w pliku .mdiss_token
  • Automatyczna walidacja uprawnień
  • Opcja dry-run do bezpiecznego testowania
  • Nie przesyła wrażliwych danych

🔄 Workflow CI/CD

mdiss doskonale integruje się z CI/CD:

# .github/workflows/issues.yml
name: Auto Issues
on:
  workflow_run:
    workflows: ["CI"]
    types: [completed]
    
jobs:
  create-issues:
    if: ${{ github.event.workflow_run.conclusion == 'failure' }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install mdiss
        run: pip install mdiss
      - name: Create issues from failures
        run: |
          mdiss create failure_report.md ${{ github.repository_owner }} ${{ github.event.repository.name }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

🤝 Programowy API

from mdiss import MarkdownParser, GitHubClient, ErrorAnalyzer
from mdiss.models import GitHubConfig

# Parsowanie pliku
parser = MarkdownParser()
commands = parser.parse_file("paste.txt")

# Analiza błędów
analyzer = ErrorAnalyzer()
for cmd in commands:
    analysis = analyzer.analyze(cmd)
    print(f"Priority: {analysis.priority.value}")
    print(f"Category: {analysis.category.value}")

# Tworzenie issues
config = GitHubConfig(token="...", owner="...", repo="...")
client = GitHubClient(config)

for cmd in commands:
    issue = client.create_issue_from_command(cmd)
    print(f"Created: {issue['html_url']}")

📁 Struktura projektu

mdiss/
├── mdiss/              # Kod źródłowy
│   ├── __init__.py
│   ├── cli.py         # CLI interface
│   ├── parser.py      # Markdown parser
│   ├── github_client.py  # GitHub API
│   ├── analyzer.py    # Error analyzer
│   └── models.py      # Data models
├── tests/             # Testy
├── docs/              # Dokumentacja
└── examples/          # Przykłady

🧪 Development

# Klonowanie
git clone https://github.com/wronai/mdiss.git
cd mdiss

# Instalacja zależności deweloperskich
make dev

# Uruchomienie testów
make test

# Sprawdzenie jakości kodu
make lint

# Formatowanie kodu
make format

# Pełny CI pipeline
make ci

Dostępne komendy make

make help           # Pokaż wszystkie dostępne komendy
make test           # Uruchom testy
make test-coverage  # Testy z pokryciem kodu
make lint           # Sprawdź jakość kodu
make format         # Sformatuj kod
make build          # Zbuduj pakiet
make docs           # Zbuduj dokumentację
make demo           # Uruchom demo

📄 Licencja

Apache-2.0 License - zobacz LICENSE

🤝 Współpraca

  1. Fork projektu
  2. Stwórz branch dla swojej funkcji (git checkout -b feature/amazing-feature)
  3. Commit zmian (git commit -m 'Add amazing feature')
  4. Push do brancha (git push origin feature/amazing-feature)
  5. Otwórz Pull Request

Guidelines

  • Dodaj testy dla nowych funkcji
  • Zachowaj 100% pokrycie kodu testami
  • Używaj konwencjonalnych commitów
  • Aktualizuj dokumentację

📈 Statystyki

  • 🐍 Python 3.8+
  • 📦 Zbudowany z Poetry
  • 🧪 100% pokrycie testami
  • 📖 Kompletna dokumentacja
  • 🚀 Rich CLI interface

🔗 Linki


Stworzone przez WRONAI Team ❤️

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

mdiss-1.0.62.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

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

mdiss-1.0.62-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file mdiss-1.0.62.tar.gz.

File metadata

  • Download URL: mdiss-1.0.62.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.12 Linux/6.14.9-300.fc42.x86_64

File hashes

Hashes for mdiss-1.0.62.tar.gz
Algorithm Hash digest
SHA256 58eeb2df413db5ca42493542302944e6438b2f892f60587caaa0e6a1a3b2a721
MD5 0b99d568ed08c200980a77de35f6a976
BLAKE2b-256 4f260726511718d19cc179863f1783dc0b4c0142ace64357fa9874b98c749917

See more details on using hashes here.

File details

Details for the file mdiss-1.0.62-py3-none-any.whl.

File metadata

  • Download URL: mdiss-1.0.62-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.12 Linux/6.14.9-300.fc42.x86_64

File hashes

Hashes for mdiss-1.0.62-py3-none-any.whl
Algorithm Hash digest
SHA256 3103fa7703a4fee394439c2271feb374d59e0ce57abfd81e50863f5d1af078e6
MD5 1be26fa5363becda2976a8947572fc5e
BLAKE2b-256 548cc9c46a042b69c22c1046908758c5d3d0ce2af2e73e1faa5cd5a7a8957e60

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