fix(gh-tickets skill): 3 Bugs in next-ticket + create-next-ticket korrigiert

next-ticket.ps1:
- --json-Flag: Leerzeichen nach Kommas entfernt ('number, title, labels'
  → 'number,title,labels'). gh CLI interpretierte die Felder als 3
  separate Argumente → Fehler 'accepts 1 arg(s), received 3'.
- gh project item-list ohne --limit ergänzt (--limit 200). Das
  Standard-Limit von 20 führt bei >20 Board-Items dazu, dass Tickets
  nicht gefunden werden.

create-next-ticket.ps1:
- Type-Label-Validierung war unvollständig: nur migration, tech-decision
  und infrastructure wurden akzeptiert. Alle 8 gültigen Typen ergänzt
  (block-planning, feature, refactoring, planning, test).
This commit is contained in:
Jens Reinemann 2026-05-13 15:10:28 +02:00
parent 5030ac929a
commit 8a6882cc56
2 changed files with 5 additions and 4 deletions

View file

@ -25,9 +25,10 @@ $orderFieldId = "PVTF_lAHOCFqiJ84BXk9UzhSw4jo"
# --- 1. Type-Label validieren --- # --- 1. Type-Label validieren ---
$labelList = $Labels -split ',' | ForEach-Object { $_.Trim() } $labelList = $Labels -split ',' | ForEach-Object { $_.Trim() }
$hasType = ($labelList -contains "migration") -or ($labelList -contains "tech-decision") -or ($labelList -contains "infrastructure") $validTypes = @("migration","tech-decision","infrastructure","block-planning","feature","refactoring","planning","test")
$hasType = ($labelList | Where-Object { $validTypes -contains $_ }).Count -gt 0
if (-not $hasType) { if (-not $hasType) {
Write-Error "Mindestens ein Type-Label erforderlich: migration, tech-decision, infrastructure" Write-Error "Mindestens ein Type-Label erforderlich: $($validTypes -join ', ')"
exit 1 exit 1
} }

View file

@ -13,7 +13,7 @@ $repo = "jreinemann-euris/krisenvorrat"
if ($IssueNumber -gt 0) { if ($IssueNumber -gt 0) {
# Variante A: Explizite Issue-Nummer # Variante A: Explizite Issue-Nummer
$json = gh issue view $IssueNumber --repo $repo --json number, title, labels | ConvertFrom-Json $json = gh issue view $IssueNumber --repo $repo --json number,title,labels | ConvertFrom-Json
$labels = $json.labels | ForEach-Object { $_.name } $labels = $json.labels | ForEach-Object { $_.name }
$type = if ($labels -contains "block-planning") { "[B]" } $type = if ($labels -contains "block-planning") { "[B]" }
elseif ($labels -contains "migration") { "[M]" } elseif ($labels -contains "migration") { "[M]" }
@ -28,7 +28,7 @@ if ($IssueNumber -gt 0) {
} }
else { else {
# Variante B: Nächstes Ticket per Board-Query (client-seitig auf Todo gefiltert) # Variante B: Nächstes Ticket per Board-Query (client-seitig auf Todo gefiltert)
$raw = gh project item-list 2 --owner jreinemann-euris --format json | ConvertFrom-Json $raw = gh project item-list 2 --owner jreinemann-euris --format json --limit 200 | ConvertFrom-Json
if ($null -eq $raw -or $null -eq $raw.items) { if ($null -eq $raw -or $null -eq $raw.items) {
Write-Host "Keine offenen Tickets gefunden." Write-Host "Keine offenen Tickets gefunden."
return return