Skip to content

Refactor monolithic gitHappens.py into modular architecture #116

Description

@zigcBenx

Problem

The entire CLI tool is currently contained in a single gitHappens.py file, making it difficult to maintain, test, and extend. This monolithic structure violates separation of concerns and makes the codebase harder to navigate.

Solution

Split the monolithic file into a modular architecture with clear separation of responsibilities.

Proposed Structure

├── main.py                 # Entry point and argument parsing
├── gitlab_api.py           # GitLab API interactions
├── config.py              # Configuration management
├── templates.py           # Template processing
├── git_utils.py           # Git operations
├── interactive.py         # User prompts and CLI interactions
└── commands/
    ├── create_issue.py     # Issue creation logic
    ├── review.py          # Review workflow
    ├── deploy.py          # Deployment checks
    └── open_mr.py         # Merge request operations

Acceptance Criteria

  • Extract GitLab API calls into gitlab_api.py
  • Move configuration handling to config.py
  • Separate template logic into templates.py
  • Create command-specific modules in commands/ folder
  • Ensure all existing functionality works unchanged
  • Add basic unit tests for each module
  • Update README with new structure

Benefits

  • Improved code maintainability
  • Easier testing and debugging
  • Better separation of concerns
  • Simpler onboarding for contributors

Priority: Medium
Labels: refactoring, technical-debt, enhancement

Metadata

Metadata

Assignees

No one assigned

    Labels

    PledgeableThis issue can receive pledges/donations on OpenPledge

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions