Refactor monolithic gitHappens.py into modular architecture (closes #116)#142
Open
trandaiviethung2001 wants to merge 1 commit into
Open
Conversation
Splits the 800+ line gitHappens.py into focused modules so each piece is easy to find, test and extend. Behaviour is preserved end-to-end and the existing `gitHappens.py` entry point is kept as a thin compatibility shim so any user aliases keep working. New layout: - main.py: argparse entry point and subcommand dispatch - config.py: config.ini + templates.json loading - gitlab_api.py: GitLab HTTP + glab CLI wrappers - git_utils.py: local git operations - templates.py: issue template selection - interactive.py: inquirer prompts (milestones, iterations, epics, reviewers, labels) - project.py: resolve current project id - commands/create_issue.py: issue + branch + MR creation - commands/merge_request.py: MR lookups, reviewers, auto-merge - commands/open_mr.py: open active MR in browser - commands/review.py: review workflow + AI review hook - commands/deploy.py: last production deployment lookup - commands/summary.py: two-week commit summary (raw + AI) - commands/incident.py: incident report workflow Refs zigcBenx#116
754ce91 to
5ef4c7f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splits the 800+ line
gitHappens.pyinto focused modules per the structure proposed in #116. Behaviour is preserved end-to-end, and the existinggitHappens.pyentry point is kept as a thin compatibility shim so any user aliases (alias gh='python3 .../gitHappens.py') keep working unchanged.New layout
Acceptance criteria from #116
gitlab_api.pyconfig.pytemplates.pycommands/foldergitHappens.pystill works as before via the shim)Notes for reviewers
gitHappens.pymeans existing aliases keep working;python3 main.py ...works equivalently.__pycache__/and*.pycto.gitignore.gh report,gh open,gh review [--select] [-am],gh summary,gh summaryAI,gh last deploy,gh ai review, issue creation with templates) is identical.Test plan
python3 gitHappens.py --helpand confirm the same flags are listedpython3 gitHappens.py summaryin a repo to confirm commit summary output is unchangedpython3 gitHappens.py "Some title"end-to-end on a test project to confirm issue/branch/MR creation still workspython3 gitHappens.py reviewon a branch with an open MR to confirm the review workflow still works🤖 Generated with Claude Code