From 489473e11292d967c626ea0eca93c76a57b599a7 Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Wed, 24 Jun 2026 17:26:00 +0100 Subject: [PATCH] fixed ( partial) for ticket level commits --- ...Helpdesk_GitHub_Gitea_Integration_Guide.md | 226 ++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 Modules/Helpdesk/Helpdesk_GitHub_Gitea_Integration_Guide.md diff --git a/Modules/Helpdesk/Helpdesk_GitHub_Gitea_Integration_Guide.md b/Modules/Helpdesk/Helpdesk_GitHub_Gitea_Integration_Guide.md new file mode 100644 index 00000000..d88b2c6b --- /dev/null +++ b/Modules/Helpdesk/Helpdesk_GitHub_Gitea_Integration_Guide.md @@ -0,0 +1,226 @@ +# Helpdesk Git Integration Guide + +## Gitea & GitHub Integration, Ticket Linking, Development Workflow, and Deployment Standards + +Version: 1.0 +Module: Helpdesk +Platform: WMS Core +Last Updated: June 2026 + +## Overview + +The Helpdesk Git Integration allows tickets to be linked directly to commits, branches, pull requests, merges, repository activity, and deployments. + +### Ticket Reference Format + +```text +HD-YYYY-NNNNN +``` + +Example: + +```text +HD-2026-00012 +``` + +## Automatic Linking Rules + +The integration searches for ticket references in: + +- Commit messages +- Branch names +- Pull request titles +- Merge commits + +### Example Commit + +```text +HD-2026-00012 Fix ticket-level Git commit display +``` + +### Example Branch + +```text +bugfix/HD-2026-00012-fix-ticket-display +``` + +## GitFlow Branch Standards + +### Feature + +```text +feature/HD-2026-00012-add-sla-dashboard +``` + +### Bugfix + +```text +bugfix/HD-2026-00012-fix-ticket-display +``` + +### Hotfix + +```text +hotfix/HD-2026-00012-production-fix +``` + +## Commit Standards + +Always place the ticket reference first. + +```text +HD-2026-00012 Fix ticket-level Git commit display +``` + +## GitHub Setup + +### Repository + +```bash +git init +git remote add origin https://github.com/company/repository.git +git remote -v +``` + +### Webhook + +Settings → Webhooks → Add Webhook + +Webhook URL: + +```text +https://your-domain/helpdesk/git/github/webhook +``` + +Events: + +- Push +- Pull Request +- Pull Request Review +- Release + +## Gitea Setup + +### Repository + +```bash +git init +git remote add origin http://git.vm:3000/Admin/WMS-Core.git +git remote -v +``` + +### Webhook + +Settings → Webhooks → Add Webhook + +Webhook URL: + +```text +https://your-domain/helpdesk/git/gitea/webhook +``` + +Events: + +- Push +- Pull Request +- Merge +- Tags + +## Standard Workflow + +### Create Ticket + +```text +HD-2026-00012 +``` + +### Create Branch + +```bash +git checkout develop +git checkout -b bugfix/HD-2026-00012-fix-ticket-display +``` + +### Test + +```bash +composer test +``` + +### Commit + +```bash +git add . +git commit -m "HD-2026-00012 Fix ticket-level Git commit display" +``` + +### Push + +```bash +git push origin bugfix/HD-2026-00012-fix-ticket-display +``` + +### Pull Request + +```text +HD-2026-00012 Fix ticket-level Git commit display +``` + +## Manual Linking + +```php +Modules\Helpdesk\Models\GitCommit::find(7)->update([ + 'ticket_id' => 18, +]); +``` + +## Troubleshooting + +### Verify Commits + +```bash +php artisan tinker +``` + +```php +Modules\Helpdesk\Models\GitCommit::count(); +``` + +### Ticket Shows No Commits + +```php +Modules\Helpdesk\Models\GitCommit + ::where('ticket_id', 18) + ->get(); +``` + +or + +```php +Modules\Helpdesk\Models\GitCommit + ::where('message', 'like', '%HD-2026-00012%') + ->get(); +``` + +## Recommended Standard + +Every code change should contain: + +- Ticket reference in branch name +- Ticket reference in commit message +- Ticket reference in PR title + +Example: + +```text +Branch: +bugfix/HD-2026-00012-fix-ticket-display + +Commit: +HD-2026-00012 Fix ticket-level Git commit display + +PR: +HD-2026-00012 Fix ticket-level Git commit display +``` + +This ensures automatic linking and complete traceability.