git-graphable 0.4.0__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. {git_graphable-0.4.0 → git_graphable-0.6.0}/.github/workflows/ci.yml +14 -1
  2. git_graphable-0.6.0/.github/workflows/pages.yml +65 -0
  3. {git_graphable-0.4.0 → git_graphable-0.6.0}/.gitignore +3 -3
  4. git_graphable-0.6.0/CHANGELOG.md +97 -0
  5. git_graphable-0.6.0/LICENSE +21 -0
  6. git_graphable-0.4.0/README.md → git_graphable-0.6.0/PKG-INFO +61 -14
  7. git_graphable-0.4.0/PKG-INFO → git_graphable-0.6.0/README.md +43 -30
  8. {git_graphable-0.4.0 → git_graphable-0.6.0}/USAGE.md +6 -2
  9. {git_graphable-0.4.0/.github/actions/git-graphable → git_graphable-0.6.0}/action.yml +18 -6
  10. git_graphable-0.6.0/examples/index_template.html +24 -0
  11. git_graphable-0.6.0/examples/publish_demos.py +110 -0
  12. {git_graphable-0.4.0 → git_graphable-0.6.0}/pyproject.toml +7 -1
  13. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/bare_cli.py +20 -1
  14. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/commands.py +26 -9
  15. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/core.py +5 -0
  16. git_graphable-0.6.0/src/git_graphable/github.py +25 -0
  17. git_graphable-0.6.0/src/git_graphable/highlighter.py +7 -0
  18. git_graphable-0.6.0/src/git_graphable/highlights/core.py +59 -0
  19. git_graphable-0.6.0/src/git_graphable/highlights/external.py +259 -0
  20. git_graphable-0.6.0/src/git_graphable/highlights/hygiene.py +212 -0
  21. git_graphable-0.6.0/src/git_graphable/highlights/visual.py +119 -0
  22. git_graphable-0.6.0/src/git_graphable/issues/__init__.py +46 -0
  23. git_graphable-0.6.0/src/git_graphable/issues/base.py +35 -0
  24. git_graphable-0.6.0/src/git_graphable/issues/github.py +50 -0
  25. git_graphable-0.6.0/src/git_graphable/issues/gitlab.py +40 -0
  26. git_graphable-0.6.0/src/git_graphable/issues/jira.py +59 -0
  27. git_graphable-0.6.0/src/git_graphable/issues/script.py +68 -0
  28. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/parser.py +1 -1
  29. git_graphable-0.6.0/src/git_graphable/prs/__init__.py +37 -0
  30. git_graphable-0.6.0/src/git_graphable/prs/base.py +40 -0
  31. git_graphable-0.6.0/src/git_graphable/prs/github.py +61 -0
  32. git_graphable-0.6.0/src/git_graphable/prs/gitlab.py +55 -0
  33. git_graphable-0.6.0/src/git_graphable/prs/script.py +56 -0
  34. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/rich_cli.py +15 -1
  35. git_graphable-0.6.0/src/git_graphable/styler.py +79 -0
  36. git_graphable-0.6.0/src/git_graphable/styling/base.py +133 -0
  37. git_graphable-0.6.0/src/git_graphable/styling/generic.py +132 -0
  38. git_graphable-0.6.0/src/git_graphable/styling/html.py +340 -0
  39. git_graphable-0.6.0/src/git_graphable/styling/mermaid.py +87 -0
  40. git_graphable-0.6.0/tests/__init__.py +0 -0
  41. git_graphable-0.6.0/tests/conftest.py +33 -0
  42. git_graphable-0.6.0/tests/highlights/__init__.py +0 -0
  43. git_graphable-0.6.0/tests/highlights/test_external.py +328 -0
  44. git_graphable-0.6.0/tests/highlights/test_hygiene.py +202 -0
  45. git_graphable-0.6.0/tests/highlights/test_visual.py +59 -0
  46. git_graphable-0.6.0/tests/issues/__init__.py +0 -0
  47. git_graphable-0.6.0/tests/issues/test_github.py +14 -0
  48. git_graphable-0.6.0/tests/issues/test_gitlab.py +25 -0
  49. git_graphable-0.6.0/tests/issues/test_jira_engine.py +21 -0
  50. git_graphable-0.6.0/tests/issues/test_script.py +106 -0
  51. git_graphable-0.6.0/tests/prs/__init__.py +0 -0
  52. git_graphable-0.6.0/tests/prs/test_github.py +32 -0
  53. git_graphable-0.6.0/tests/prs/test_gitlab.py +38 -0
  54. git_graphable-0.6.0/tests/prs/test_script.py +72 -0
  55. git_graphable-0.6.0/tests/styling/__init__.py +0 -0
  56. git_graphable-0.6.0/tests/styling/test_generic.py +111 -0
  57. git_graphable-0.6.0/tests/styling/test_mermaid.py +58 -0
  58. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_bare_cli.py +54 -25
  59. git_graphable-0.6.0/tests/test_commands.py +60 -0
  60. git_graphable-0.6.0/tests/test_highlighter.py +9 -0
  61. git_graphable-0.6.0/tests/test_hygiene_scorer.py +91 -0
  62. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_parser.py +10 -0
  63. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_rich_cli.py +26 -0
  64. git_graphable-0.6.0/tests/test_styler.py +15 -0
  65. {git_graphable-0.4.0 → git_graphable-0.6.0}/uv.lock +1 -1
  66. git_graphable-0.4.0/CHANGELOG.md +0 -51
  67. git_graphable-0.4.0/graph.html +0 -573
  68. git_graphable-0.4.0/report_output/final_report.json +0 -34
  69. git_graphable-0.4.0/report_output/plus_metadata.json +0 -8
  70. git_graphable-0.4.0/report_output/report.html +0 -700
  71. git_graphable-0.4.0/report_output/screenshots/test_interactivity_toggling_chromium__failure.png +0 -0
  72. git_graphable-0.4.0/src/git_graphable/github.py +0 -77
  73. git_graphable-0.4.0/src/git_graphable/highlighter.py +0 -640
  74. git_graphable-0.4.0/src/git_graphable/issues.py +0 -177
  75. git_graphable-0.4.0/src/git_graphable/styler.py +0 -709
  76. git_graphable-0.4.0/tests/test_highlighter.py +0 -198
  77. git_graphable-0.4.0/tests/test_hygiene.py +0 -540
  78. git_graphable-0.4.0/tests/test_issues.py +0 -42
  79. git_graphable-0.4.0/tests/test_styler.py +0 -64
  80. {git_graphable-0.4.0 → git_graphable-0.6.0}/.gemini/GEMINI.md +0 -0
  81. {git_graphable-0.4.0 → git_graphable-0.6.0}/.gemini/code-ordering.md +0 -0
  82. {git_graphable-0.4.0 → git_graphable-0.6.0}/.github/dependabot.yml +0 -0
  83. {git_graphable-0.4.0 → git_graphable-0.6.0}/.github/workflows/publish.yml +0 -0
  84. {git_graphable-0.4.0 → git_graphable-0.6.0}/.python-version +0 -0
  85. {git_graphable-0.4.0 → git_graphable-0.6.0}/Justfile +0 -0
  86. {git_graphable-0.4.0 → git_graphable-0.6.0}/SECURITY.md +0 -0
  87. {git_graphable-0.4.0 → git_graphable-0.6.0}/STYLING.md +0 -0
  88. {git_graphable-0.4.0 → git_graphable-0.6.0}/examples/EXAMPLES.md +0 -0
  89. {git_graphable-0.4.0 → git_graphable-0.6.0}/examples/generate_demos.py +0 -0
  90. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/__init__.py +0 -0
  91. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/cli.py +0 -0
  92. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/cli_utils.py +0 -0
  93. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/default_config.toml +0 -0
  94. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/hygiene.py +0 -0
  95. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/models.py +0 -0
  96. {git_graphable-0.4.0 → git_graphable-0.6.0}/src/git_graphable/templates.py +0 -0
  97. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_cli.py +0 -0
  98. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_cli_utils.py +0 -0
  99. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_config.py +0 -0
  100. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_core.py +0 -0
  101. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_examples_html.py +0 -0
  102. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_github.py +0 -0
  103. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_interactive_html.py +0 -0
  104. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_models.py +0 -0
  105. {git_graphable-0.4.0 → git_graphable-0.6.0}/tests/test_ui_interactive.py +0 -0
@@ -34,8 +34,21 @@ jobs:
34
34
  - name: Run checks
35
35
  run: just check
36
36
 
37
+ - name: Generate Coverage Badge
38
+ run: |
39
+ if [ -f "htmlcov/index.html" ]; then
40
+ COVERAGE=$(grep -oP 'pc_cov">\d+%' htmlcov/index.html | head -1 | grep -oP '\d+')
41
+ echo "{\"schemaVersion\": 1, \"label\": \"coverage\", \"message\": \"$COVERAGE%\", \"color\": \"brightgreen\"}" > coverage.json
42
+ fi
43
+
37
44
  - name: Git Graph Reports
38
- uses: ./.github/actions/git-graphable
45
+ uses: ./
39
46
  with:
40
47
  production_branch: 'main'
41
48
  output_dir: 'git-graph-reports'
49
+
50
+ - name: Copy Coverage to Reports
51
+ run: |
52
+ if [ -f "coverage.json" ]; then
53
+ cp coverage.json git-graph-reports/
54
+ fi
@@ -0,0 +1,65 @@
1
+ name: Deploy Demos to Pages
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ jobs:
14
+ deploy:
15
+ environment:
16
+ name: github-pages
17
+ url: ${{ steps.deployment.outputs.page_url }}
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - name: Checkout
21
+ uses: actions/checkout@v4
22
+ with:
23
+ fetch-depth: 0
24
+
25
+ - name: Setup uv
26
+ uses: astral-sh/setup-uv@v5
27
+ with:
28
+ enable-cache: true
29
+
30
+ - name: Install dependencies
31
+ run: uv sync --all-extras
32
+
33
+ - name: Install just
34
+ uses: extractions/setup-just@v3
35
+
36
+ - name: Generate Demos
37
+ run: uv run python examples/publish_demos.py
38
+
39
+ - name: Generate Coverage Badge
40
+ run: |
41
+ just coverage
42
+ if [ -f "htmlcov/index.html" ]; then
43
+ COVERAGE=$(grep -oP 'pc_cov">\d+%' htmlcov/index.html | head -1 | grep -oP '\d+')
44
+ echo "{\"schemaVersion\": 1, \"label\": \"coverage\", \"message\": \"$COVERAGE%\", \"color\": \"brightgreen\"}" > demo-site/coverage.json
45
+ fi
46
+
47
+ - name: Generate Hygiene Badge
48
+ run: |
49
+ uv run git-graphable analyze . --bare --hygiene-output hygiene.json --output -
50
+ SCORE=$(grep -oP '"score": \d+' hygiene.json | grep -oP '\d+')
51
+ GRADE=$(grep -oP '"grade": "[^"]+"' hygiene.json | cut -d'"' -f4)
52
+ COLOR=$(grep -oP '"color": "[^"]+"' hygiene.json | cut -d'"' -f4)
53
+ echo "{\"schemaVersion\": 1, \"label\": \"hygiene\", \"message\": \"$SCORE% ($GRADE)\", \"color\": \"$COLOR\"}" > demo-site/hygiene_badge.json
54
+
55
+ - name: Setup Pages
56
+ uses: actions/configure-pages@v4
57
+
58
+ - name: Upload artifact
59
+ uses: actions/upload-pages-artifact@v3
60
+ with:
61
+ path: 'demo-site'
62
+
63
+ - name: Deploy to GitHub Pages
64
+ id: deployment
65
+ uses: actions/deploy-pages@v4
@@ -39,6 +39,7 @@ pip-delete-this-directory.txt
39
39
  # Unit test / coverage reports
40
40
  htmlcov/
41
41
  htmlrep/
42
+ report_output/
42
43
  .pytest_worker_jsons/
43
44
  .tox/
44
45
  .nox/
@@ -131,8 +132,7 @@ cython_debug/
131
132
  .DS_Store
132
133
 
133
134
  # Examples
135
+ demo-site/
134
136
  examples/repos/
135
137
  examples/assets/
136
-
137
- # Temporary test assets
138
- test_pr.mmd
138
+ graph.html
@@ -0,0 +1,97 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.6.0] - 2026-03-06
6
+
7
+ ### Added
8
+ - **Native GitLab Support**: Added support for GitLab Merge Requests and Issues using the `glab` CLI.
9
+ - **Pull Request Provider Abstraction**: Introduced a new `PullRequestProvider` interface, decoupling PR status logic from GitHub.
10
+ - Added `GitHubPullRequestProvider` (default) using the `gh` CLI.
11
+ - Added `ScriptPullRequestProvider` for custom script-based PR status lookups.
12
+ - **Configuration Trust Mechanism**: Introduced a security layer for local repository configurations.
13
+ - Added `--trust` CLI flag to explicitly trust automatically loaded `.git-graphable.toml` or `pyproject.toml` files.
14
+ - Users are now warned when executing custom scripts from untrusted configurations.
15
+ - **Dynamic Project Badges**:
16
+ - Added automated generation of Shields.io-compatible JSON badges for **Git Hygiene** and **Code Coverage**.
17
+ - Updated `README.md` to display live status from GitHub Pages.
18
+ - Added `--hygiene-output <path>` to CLI for machine-readable (JSON) hygiene summaries.
19
+ - **Improved Automatic Visualization**:
20
+ - Restored the behavior of automatically opening a graph if no output path is provided.
21
+ - Changed default automatic visualization export format from SVG to **PNG** for broader compatibility.
22
+ - **Modular Architecture Refactor**: Substantially reorganized the codebase into specialized sub-packages for better maintainability:
23
+ - `src/git_graphable/prs/`: Modular PR providers.
24
+ - `src/git_graphable/issues/`: Modular issue tracker engines.
25
+ - `src/git_graphable/highlights/`: Specialized highlighting logic (visual, hygiene, external).
26
+ - `src/git_graphable/styling/`: Specialized styling logic per visualization engine.
27
+ - **Enhanced Issue Scripting**: `ScriptIssueEngine` now supports robust JSON output from scripts (with legacy CSV fallback).
28
+ - **Project Governance**: Added official **MIT License** to the repository.
29
+ - **Reorganized Test Suite**: Refactored tests into a modular structure mirroring the source code, including a global `conftest.py` for shared fixtures.
30
+
31
+ ### Fixed
32
+ - **Comprehensive Security Hardening**:
33
+ - Protected against argument injection in `git clone`, `glab`, `gh`, and `git rev-list` commands using the `--` separator.
34
+ - Resolved potential path traversal and SSRF risks in Jira issue lookups by properly URL-encoding IDs.
35
+ - Corrected argument passing logic for `git log` limits.
36
+ - **Mermaid Parser Reliability**: Fixed parsing errors in Mermaid graphs by substituting sensitive characters (brackets and parentheses) with visually similar full-width Unicode characters.
37
+ - **CI Stability**: Fixed CI failures in GitHub Pages deployment by preventing automatic visualization triggers during badge generation.
38
+ - **Naming Collisions**: Resolved pytest module collision issues by adding `__init__.py` files to test directories.
39
+ - **Code Maintenance**: Updated `.gitignore` to prevent tracking of build artifacts and coverage data.
40
+
41
+
42
+ ## [0.5.0] - 2026-03-06
43
+
44
+ ### Added
45
+ - **Interactive Demos**: Implemented `examples/publish_demos.py` to generate and host live HTML demos via GitHub Pages.
46
+ - **Marketplace Preparation**: Moved `action.yml` to the root directory for GitHub Marketplace publishing and updated related documentation and CI workflows.
47
+
48
+ ### Fixed
49
+ - **Squash Merge Detection**: Resolved a `KeyError` and `CycleError` in the logical merge visualization for squashed pull requests when local branch tips were present.
50
+
51
+ ## [0.4.0] - 2026-03-05
52
+
53
+ ### Added
54
+ - **Interactive HTML Viewer**: New `--engine html` output that generates a self-contained interactive graph using Cytoscape.js.
55
+ - Includes searchable nodes and a details sidebar with live highlight toggling.
56
+ - Preserves all visual themes and highlighting styles.
57
+ - Lightweight and portable with zero local dependencies.
58
+ - **Performance Optimizations**:
59
+ - **Parallel Log Parsing**: Parallelized `GitCommit` instantiation using `ProcessPoolExecutor` for large repositories.
60
+ - **Parallel Hygiene Scoring**: Concurrent execution of hygiene checks using `ThreadPoolExecutor` for faster report generation.
61
+ - **Modular CLI Architecture**:
62
+ - Split into `rich_cli` (Typer/Rich) and `bare_cli` (Argparse) for better environment support.
63
+ - Intelligent switcher logic in `cli.py` handles optional dependencies and fallbacks.
64
+ - **New `init` Command**: Easily initialize a default `.git-graphable.toml` configuration file.
65
+ - **Reusable GitHub Action**: Added a composite action in `.github/actions/git-graphable/` for automated reporting.
66
+ - **Robust Distance/Divergence Highlights**: Enhanced visualization of branch distance and divergence with clearer legend labels.
67
+ - **Remote URL Support**: Restored and improved ability to pass remote Git URLs (HTTPS/SSH) as the repository path.
68
+ - **Comprehensive UI Testing**: Integrated Playwright for automated browser-based UI testing of the interactive graph.
69
+
70
+ ### Changed
71
+ - **Command Renamed**: Renamed the primary command from `convert` to `analyze` for better semantic alignment.
72
+ - **Decoupled Hygiene Scoring**: Scoring logic is now independent of visual highlighting options, allowing for more granular configuration.
73
+ - **Template System Refactor**: Extracted large HTML/JS blocks into `src/git_graphable/templates.py` for improved maintainability.
74
+ - **Removed PlantUML Support**: Support for PlantUML has been removed in favor of more customizable engines (Mermaid, D2, HTML).
75
+
76
+ ## [0.3.0] - 2026-03-05
77
+
78
+ ### Added
79
+ - **Customizable Visual Styling**: Full override of node and edge styles (colors, widths, dash patterns) via CLI (`--style`) and TOML (`[git-graphable.theme]`).
80
+ - **Configurable Hygiene Scoring**: Customization of hygiene penalties and caps via TOML (`[git-graphable.hygiene_weights]`).
81
+ - **Advanced Issue Tracker Integration**:
82
+ - **Longevity Mismatch**: Detection of large time gaps between ticket creation and the first commit.
83
+ - **Collaboration Gaps**: Highlighting when the Git author doesn't match the Issue Tracker assignee.
84
+ - **Release Validation**: Verification that "Released" tickets are tagged in Git.
85
+ - **New Documentation**: Added `STYLING.md` guide for visual customization.
86
+ - **Engine Consistency**: Unified styling logic across Mermaid, D2, and Graphviz engines.
87
+
88
+ ### Changed
89
+ - **CLI Refactor**: Migrated to a more robust Typer/Rich implementation with enhanced command-line options.
90
+ - **Issue Engine**: Refactored `IssueTracker` to support richer metadata (assignees, timestamps).
91
+
92
+ ### Fixed
93
+ - Fixed inconsistent color application in Mermaid graphs.
94
+ - Improved cleanup of temporary files during image export.
95
+
96
+ ## [0.2.0] - 2026-03-04
97
+ - Initial functional release with basic Git hygiene scoring and GitHub/Jira integration.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Richard West
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,28 +1,51 @@
1
+ Metadata-Version: 2.4
2
+ Name: git-graphable
3
+ Version: 0.6.0
4
+ Summary: A powerful Git history visualizer and hygiene linter with CI gating.
5
+ Project-URL: Homepage, https://github.com/TheTrueSCU/git-graphable
6
+ Project-URL: Issues, https://github.com/TheTrueSCU/git-graphable/issues
7
+ Project-URL: Repository, https://github.com/TheTrueSCU/git-graphable
8
+ Author-email: Richard West <dopplereffect.us@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: analysis,automation,badges,ci,cytoscape,d2,devops,git,git-flow,github,github-actions,gitlab,graph,html,hygiene,interactive,jira,lint,mermaid,metrics,topology,visualization
12
+ Requires-Python: >=3.13
13
+ Requires-Dist: graphable>=0.6.0
14
+ Provides-Extra: cli
15
+ Requires-Dist: rich>=13.0.0; extra == 'cli'
16
+ Requires-Dist: typer>=0.12.0; extra == 'cli'
17
+ Description-Content-Type: text/markdown
18
+
1
19
  # Git Graphable
2
20
 
21
+ [![CI](https://github.com/TheTrueSCU/git-graphable/actions/workflows/ci.yml/badge.svg)](https://github.com/TheTrueSCU/git-graphable/actions/workflows/ci.yml)
22
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
23
+ [![Coverage](https://img.shields.io/endpoint?url=https://thetruescu.github.io/git-graphable/coverage.json)](https://thetruescu.github.io/git-graphable/)
24
+ [![Hygiene](https://img.shields.io/endpoint?url=https://thetruescu.github.io/git-graphable/hygiene_badge.json)](https://thetruescu.github.io/git-graphable/)
25
+
26
+
3
27
  A powerful Python tool to convert Git commit history into beautiful, interactive flowcharts using the `graphable` library. Supporting Mermaid, D2, Graphviz, and HTML.
4
28
 
5
29
  ## Git Plugin Support
6
30
  When installed in your PATH, you can use this as a native Git plugin:
7
31
  ```bash
8
- git graphable .
32
+ git graphable analyze .
9
33
  ```
10
34
 
35
+ ## 🚀 Live Interactive Demo
36
+ Check out the tool in action with our **[Live Interactive Demos](https://thetruescu.github.io/git-graphable/)**. Explore different hygiene scenarios and toggle overlays in real-time.
37
+
38
+
11
39
  ## Features
12
40
 
13
41
  - **Multi-Engine Support**: Export to Mermaid (.mmd), D2 (.d2), Graphviz (.dot), or HTML (.html).
14
- - **Automatic Visualization**: Generates and opens an image (SVG/PNG) automatically if no output is specified.
42
+ - **Automatic Visualization**: Generates and opens an image (PNG) automatically if no output is specified.
15
43
  - **Advanced Highlighting**: Visualize author patterns, topological distance, and specific merge paths.
16
- - **GitHub Integration**: Highlight commits based on pull request status (Merged, Open, Closed, Draft) using the `gh` CLI.
44
+ - **VCS Integration**: Highlight commits based on pull request/merge request status using `gh` (GitHub) or `glab` (GitLab) CLIs.
17
45
  - **Hygiene Analysis**: Automatically detect WIP commits, direct pushes to protected branches, squashed PRs, back-merges, and contributor silos.
18
- - **Issue Tracker Integration**: Connect to Jira, GitHub Issues, or custom scripts to highlight status desyncs.
19
- - **Release & Assignment Validation**: Verify that "Released" tickets are actually tagged in Git and that commit authors match ticket assignees.
20
- - **Health Scoring**: Get a numeric "Hygiene Score" (0-100%) with a color-coded grade and detailed breakdown of workflow anti-patterns.
21
- - **Visual Customization**: Fully customize colors, widths, and line styles for nodes and edges. See [STYLING.md](STYLING.md).
22
- - **Configurable Penalties**: Fully customize the scoring logic by adjusting penalties and caps for each metric.
23
- - **CI Gating**: Use the `--check` flag to return a non-zero exit code if the hygiene score falls below a threshold (configurable via `--min-score`).
24
- - **Flexible Input**: Works with local repository paths or remote Git URLs.
25
- - **Dual CLI**: Modern Rich/Typer interface with a robust argparse fallback for bare environments.
46
+ - **Issue Tracker Integration**: Connect to Jira, GitHub Issues, GitLab Issues, or custom scripts to highlight status desyncs.
47
+ - **Security First**: Configuration trust mechanism ensures custom scripts only run from trusted sources (use `--trust` to authorize local configs).
48
+ - **Dynamic Badges**: Host live Shields.io badges for Git Hygiene and Code Coverage on GitHub Pages.
26
49
 
27
50
  ## Installation
28
51
 
@@ -50,6 +73,7 @@ uv run git-graphable init
50
73
 
51
74
  # Simplify the graph (only show branches/tags)
52
75
  uv run git-graphable analyze . --simplify
76
+ ```
53
77
 
54
78
  ## GitHub Action
55
79
 
@@ -65,14 +89,37 @@ jobs:
65
89
  fetch-depth: 0 # Required to see full history
66
90
 
67
91
  - name: Generate Git Graph Reports
68
- uses: TheTrueSCU/git-graphable/.github/actions/git-graphable@v0.4.0
92
+ uses: TheTrueSCU/git-graphable@v0.6.0
69
93
  with:
70
94
  production_branch: 'main'
71
95
  output_dir: 'reports'
72
96
  ```
73
97
 
98
+ ### Inputs
99
+
100
+ The following inputs are available for the `git-graphable` action:
101
+
102
+ * **`path`**
103
+ * Description: Path to the git repository
104
+ * Required: `false`
105
+ * Default: `'.'`
106
+ * **`production_branch`**
107
+ * Description: The main production branch (e.g. main, master)
108
+ * Required: `false`
109
+ * Default: `'main'`
110
+ * **`issue_engine`**
111
+ * Description: Issue tracker engine (github or jira)
112
+ * Required: `false`
113
+ * **`github_token`**
114
+ * Description: GitHub token for issue integration
115
+ * Required: `false`
116
+ * Default: `${{ github.token }}`
117
+ * **`output_dir`**
118
+ * Description: Directory to save the generated reports
119
+ * Required: `false`
120
+ * Default: `'git-graph-reports'`
121
+
74
122
  The action generates a **simplified Mermaid summary** (for quick review) and a **full interactive HTML graph** (for deep-dive auditing), uploading them as workflow artifacts.
75
- ```
76
123
 
77
124
  ## Highlighting Options
78
125
 
@@ -81,7 +128,7 @@ Git Graphable provides several ways to highlight commits and relationships. Mult
81
128
  | Option | Target | Effect | Conflicts With |
82
129
  | :--- | :--- | :--- | :--- |
83
130
  | `--highlight-authors` | **Fill** | Unique color per author | PR Status, Distance, Stale |
84
- | `--highlight-pr-status` | **Fill/Stroke**| Color by PR state (Merged=Purple, Open=Green) | Authors, Distance, Stale |
131
+ | `--highlight-pr-status` | **Fill/Stroke**| Color by PR/MR state (Merged=Purple, Open=Green) | Authors, Distance, Stale |
85
132
  | `--highlight-distance-from` | **Fill** | Blue gradient fading by distance | Authors, PR Status, Stale |
86
133
  | `--highlight-stale` | **Fill** | Gradient white to red by age | Authors, PR Status, Distance |
87
134
  | `--highlight-path` | **Edge** | Thick Orange edge connecting nodes | None |
@@ -1,44 +1,33 @@
1
- Metadata-Version: 2.4
2
- Name: git-graphable
3
- Version: 0.4.0
4
- Summary: A powerful Git history visualizer and hygiene linter with CI gating.
5
- Project-URL: Homepage, https://github.com/TheTrueSCU/git-graphable
6
- Project-URL: Issues, https://github.com/TheTrueSCU/git-graphable/issues
7
- Project-URL: Repository, https://github.com/TheTrueSCU/git-graphable
8
- Author-email: Richard West <dopplereffect.us@gmail.com>
9
- Keywords: analysis,automation,ci,cytoscape,d2,git,git-flow,github,github-actions,graph,html,hygiene,interactive,lint,mermaid,topology,visualization
10
- Requires-Python: >=3.13
11
- Requires-Dist: graphable>=0.6.0
12
- Provides-Extra: cli
13
- Requires-Dist: rich>=13.0.0; extra == 'cli'
14
- Requires-Dist: typer>=0.12.0; extra == 'cli'
15
- Description-Content-Type: text/markdown
16
-
17
1
  # Git Graphable
18
2
 
3
+ [![CI](https://github.com/TheTrueSCU/git-graphable/actions/workflows/ci.yml/badge.svg)](https://github.com/TheTrueSCU/git-graphable/actions/workflows/ci.yml)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Coverage](https://img.shields.io/endpoint?url=https://thetruescu.github.io/git-graphable/coverage.json)](https://thetruescu.github.io/git-graphable/)
6
+ [![Hygiene](https://img.shields.io/endpoint?url=https://thetruescu.github.io/git-graphable/hygiene_badge.json)](https://thetruescu.github.io/git-graphable/)
7
+
8
+
19
9
  A powerful Python tool to convert Git commit history into beautiful, interactive flowcharts using the `graphable` library. Supporting Mermaid, D2, Graphviz, and HTML.
20
10
 
21
11
  ## Git Plugin Support
22
12
  When installed in your PATH, you can use this as a native Git plugin:
23
13
  ```bash
24
- git graphable .
14
+ git graphable analyze .
25
15
  ```
26
16
 
17
+ ## 🚀 Live Interactive Demo
18
+ Check out the tool in action with our **[Live Interactive Demos](https://thetruescu.github.io/git-graphable/)**. Explore different hygiene scenarios and toggle overlays in real-time.
19
+
20
+
27
21
  ## Features
28
22
 
29
23
  - **Multi-Engine Support**: Export to Mermaid (.mmd), D2 (.d2), Graphviz (.dot), or HTML (.html).
30
- - **Automatic Visualization**: Generates and opens an image (SVG/PNG) automatically if no output is specified.
24
+ - **Automatic Visualization**: Generates and opens an image (PNG) automatically if no output is specified.
31
25
  - **Advanced Highlighting**: Visualize author patterns, topological distance, and specific merge paths.
32
- - **GitHub Integration**: Highlight commits based on pull request status (Merged, Open, Closed, Draft) using the `gh` CLI.
26
+ - **VCS Integration**: Highlight commits based on pull request/merge request status using `gh` (GitHub) or `glab` (GitLab) CLIs.
33
27
  - **Hygiene Analysis**: Automatically detect WIP commits, direct pushes to protected branches, squashed PRs, back-merges, and contributor silos.
34
- - **Issue Tracker Integration**: Connect to Jira, GitHub Issues, or custom scripts to highlight status desyncs.
35
- - **Release & Assignment Validation**: Verify that "Released" tickets are actually tagged in Git and that commit authors match ticket assignees.
36
- - **Health Scoring**: Get a numeric "Hygiene Score" (0-100%) with a color-coded grade and detailed breakdown of workflow anti-patterns.
37
- - **Visual Customization**: Fully customize colors, widths, and line styles for nodes and edges. See [STYLING.md](STYLING.md).
38
- - **Configurable Penalties**: Fully customize the scoring logic by adjusting penalties and caps for each metric.
39
- - **CI Gating**: Use the `--check` flag to return a non-zero exit code if the hygiene score falls below a threshold (configurable via `--min-score`).
40
- - **Flexible Input**: Works with local repository paths or remote Git URLs.
41
- - **Dual CLI**: Modern Rich/Typer interface with a robust argparse fallback for bare environments.
28
+ - **Issue Tracker Integration**: Connect to Jira, GitHub Issues, GitLab Issues, or custom scripts to highlight status desyncs.
29
+ - **Security First**: Configuration trust mechanism ensures custom scripts only run from trusted sources (use `--trust` to authorize local configs).
30
+ - **Dynamic Badges**: Host live Shields.io badges for Git Hygiene and Code Coverage on GitHub Pages.
42
31
 
43
32
  ## Installation
44
33
 
@@ -66,6 +55,7 @@ uv run git-graphable init
66
55
 
67
56
  # Simplify the graph (only show branches/tags)
68
57
  uv run git-graphable analyze . --simplify
58
+ ```
69
59
 
70
60
  ## GitHub Action
71
61
 
@@ -81,14 +71,37 @@ jobs:
81
71
  fetch-depth: 0 # Required to see full history
82
72
 
83
73
  - name: Generate Git Graph Reports
84
- uses: TheTrueSCU/git-graphable/.github/actions/git-graphable@v0.4.0
74
+ uses: TheTrueSCU/git-graphable@v0.6.0
85
75
  with:
86
76
  production_branch: 'main'
87
77
  output_dir: 'reports'
88
78
  ```
89
79
 
80
+ ### Inputs
81
+
82
+ The following inputs are available for the `git-graphable` action:
83
+
84
+ * **`path`**
85
+ * Description: Path to the git repository
86
+ * Required: `false`
87
+ * Default: `'.'`
88
+ * **`production_branch`**
89
+ * Description: The main production branch (e.g. main, master)
90
+ * Required: `false`
91
+ * Default: `'main'`
92
+ * **`issue_engine`**
93
+ * Description: Issue tracker engine (github or jira)
94
+ * Required: `false`
95
+ * **`github_token`**
96
+ * Description: GitHub token for issue integration
97
+ * Required: `false`
98
+ * Default: `${{ github.token }}`
99
+ * **`output_dir`**
100
+ * Description: Directory to save the generated reports
101
+ * Required: `false`
102
+ * Default: `'git-graph-reports'`
103
+
90
104
  The action generates a **simplified Mermaid summary** (for quick review) and a **full interactive HTML graph** (for deep-dive auditing), uploading them as workflow artifacts.
91
- ```
92
105
 
93
106
  ## Highlighting Options
94
107
 
@@ -97,7 +110,7 @@ Git Graphable provides several ways to highlight commits and relationships. Mult
97
110
  | Option | Target | Effect | Conflicts With |
98
111
  | :--- | :--- | :--- | :--- |
99
112
  | `--highlight-authors` | **Fill** | Unique color per author | PR Status, Distance, Stale |
100
- | `--highlight-pr-status` | **Fill/Stroke**| Color by PR state (Merged=Purple, Open=Green) | Authors, Distance, Stale |
113
+ | `--highlight-pr-status` | **Fill/Stroke**| Color by PR/MR state (Merged=Purple, Open=Green) | Authors, Distance, Stale |
101
114
  | `--highlight-distance-from` | **Fill** | Blue gradient fading by distance | Authors, PR Status, Stale |
102
115
  | `--highlight-stale` | **Fill** | Gradient white to red by age | Authors, PR Status, Distance |
103
116
  | `--highlight-path` | **Edge** | Thick Orange edge connecting nodes | None |
@@ -50,7 +50,9 @@ Analyze git history and generate a graph. This is the default command; if no com
50
50
  * `--highlight-long-running`: Highlight long-running branches
51
51
  * `--long-running-days INTEGER`: Threshold in days for long-running branches
52
52
  * `--long-running-base TEXT`: Base branch for long-running analysis
53
- * `--highlight-pr-status`: Highlight commits based on GitHub PR status
53
+ * `--highlight-pr-status`: Highlight commits based on PR status (GitHub or GitLab)
54
+ * `--pr-provider [github|gitlab|script]`: Provider to fetch PR statuses (default: github)
55
+ * `--pr-script TEXT`: Path to a script that returns PR data in JSON format
54
56
  * `--highlight-wip`: Highlight WIP/TODO commits
55
57
  * `--wip-keyword TEXT`: Additional keyword to trigger WIP highlighting
56
58
  * `--highlight-direct-pushes`: Highlight non-merge commits on protected branches
@@ -61,7 +63,7 @@ Analyze git history and generate a graph. This is the default command; if no com
61
63
  * `--silo-author-count INTEGER`: Author count threshold for silo detection
62
64
  * `--highlight-issue-inconsistencies`: Highlight mismatches between Git and Issue Tracker
63
65
  * `--issue-pattern TEXT`: Regex pattern to extract issue IDs
64
- * `--issue-engine [github|jira|script]`: Engine to fetch issue statuses
66
+ * `--issue-engine [github|gitlab|jira|script]`: Engine to fetch issue statuses
65
67
  * `--jira-url TEXT`: Base URL for Jira instance
66
68
  * `--issue-script TEXT`: Shell command template for script engine
67
69
  * `--highlight-release-inconsistencies`: Highlight issues marked Released but not tagged
@@ -74,6 +76,8 @@ Analyze git history and generate a graph. This is the default command; if no com
74
76
  * `--check`: Exit with non-zero if hygiene score is below threshold
75
77
  * `--min-score INTEGER`: Minimum hygiene score required for --check
76
78
  * `--bare`: Force bare mode (no rich output)
79
+ * `--hygiene-output TEXT`: Path to save hygiene summary as JSON.
80
+ * `--trust`: Trust configuration files (.git-graphable.toml, pyproject.toml) found in the repository. Required to execute custom scripts from these sources.
77
81
  * `--help`: Show this message and exit.
78
82
 
79
83
  ---
@@ -1,9 +1,9 @@
1
1
  name: 'Git Graphable'
2
- description: 'Generate interactive Git hygiene graphs and reports.'
2
+ description: 'Analyze and visualize Git history hygiene with interactive graphs and reports.'
3
3
  author: 'TheTrueSCU'
4
4
  branding:
5
- icon: 'activity'
6
- color: 'blue'
5
+ icon: 'bar-chart'
6
+ color: 'green'
7
7
 
8
8
  inputs:
9
9
  path:
@@ -38,7 +38,8 @@ runs:
38
38
  shell: bash
39
39
  run: |
40
40
  # Prefer installing local source if we are in the git-graphable repo
41
- ROOT_DIR="${{ github.action_path }}/../../.."
41
+ # github.action_path points to the root in this case
42
+ ROOT_DIR="${{ github.action_path }}"
42
43
  if [ -f "$ROOT_DIR/pyproject.toml" ] && grep -q "name = \"git-graphable\"" "$ROOT_DIR/pyproject.toml"; then
43
44
  echo "Installing git-graphable from local source: $ROOT_DIR"
44
45
  uv tool install "$ROOT_DIR"
@@ -51,15 +52,26 @@ runs:
51
52
  shell: bash
52
53
  run: mkdir -p ${{ inputs.output_dir }}
53
54
 
54
- - name: Generate Simplified Graph (Mermaid)
55
+ - name: Generate Simplified Graph (Mermaid) and Hygiene Stats
55
56
  shell: bash
56
57
  run: |
57
- ARGS="--production-branch ${{ inputs.production_branch }} --simplify --engine mermaid -o ${{ inputs.output_dir }}/summary.mmd"
58
+ ARGS="--production-branch ${{ inputs.production_branch }} --simplify --engine mermaid -o ${{ inputs.output_dir }}/summary.mmd --hygiene-output ${{ inputs.output_dir }}/hygiene.json"
58
59
  if [ -n "${{ inputs.issue_engine }}" ]; then ARGS="$ARGS --issue-engine ${{ inputs.issue_engine }}"; fi
59
60
  uv tool run git-graphable --bare ${{ inputs.path }} $ARGS
60
61
  env:
61
62
  GITHUB_TOKEN: ${{ inputs.github_token }}
62
63
 
64
+ - name: Generate Hygiene Badge Data
65
+ shell: bash
66
+ run: |
67
+ if [ -f "${{ inputs.output_dir }}/hygiene.json" ]; then
68
+ SCORE=$(grep -oP '"score": \d+' ${{ inputs.output_dir }}/hygiene.json | grep -oP '\d+')
69
+ GRADE=$(grep -oP '"grade": "[^"]+"' ${{ inputs.output_dir }}/hygiene.json | cut -d'"' -f4)
70
+ COLOR=$(grep -oP '"color": "[^"]+"' ${{ inputs.output_dir }}/hygiene.json | cut -d'"' -f4)
71
+ # Shields.io JSON endpoint format
72
+ echo "{\"schemaVersion\": 1, \"label\": \"hygiene\", \"message\": \"$SCORE% ($GRADE)\", \"color\": \"$COLOR\"}" > ${{ inputs.output_dir }}/hygiene_badge.json
73
+ fi
74
+
63
75
  - name: Generate Full Interactive Graph (HTML)
64
76
  shell: bash
65
77
  run: |
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Git Graphable Demos</title>
5
+ <style>
6
+ body { font-family: sans-serif; line-height: 1.6; max-width: 800px; margin: 40px auto; padding: 0 20px; }
7
+ h1 { border-bottom: 2px solid #eee; padding-bottom: 10px; }
8
+ ul { list-style: none; padding: 0; }
9
+ li { margin-bottom: 10px; background: #f9f9f9; padding: 15px; border-radius: 8px; border: 1px solid #ddd; }
10
+ a { text-decoration: none; color: #007bff; font-weight: bold; font-size: 1.2em; }
11
+ a:hover { text-decoration: underline; }
12
+ .badge { display: inline-block; padding: 2px 8px; background: #eee; border-radius: 4px; font-size: 0.8em; margin-left: 10px; color: #666; }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <h1>Git Graphable Interactive Demos</h1>
17
+ <p>Select a scenario below to explore the interactive Git hygiene visualization.</p>
18
+ <ul>
19
+ $html_links
20
+ </ul>
21
+ <hr>
22
+ <p><a href="https://github.com/TheTrueSCU/git-graphable" style="font-size: 1em;">Back to GitHub Repository</a></p>
23
+ </body>
24
+ </html>