Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
Commit4b81e57unknown_key

Merge PR #43: migrate script body format fix

Merge PR #43: migrate script body format fix

fix(phase-b): migrate script body format</title>
<parameter name="body">/import/github/repo expects form-urlencoded body, not JSON. Returns 302 not 200. Script updated to match.</parameter>
</invoke>
CC LABS App committed on May 3, 2026Parents: c3cf48a 61a6049
1 file changed+34144b81e57a66f50573f181634bffec8c0dc210dd95
1 changed file+34−14
Modifiedscripts/migrate-to-gluecron.ps1+34−14View fileUnifiedSplit
5757
5858# ─── 3. Trigger import from GitHub ──────────────────────────────────────────
5959Write-Host "[3/5] Importing $GH_OWNER/$GH_REPO from GitHub..."
60$importBody = @{
61 source = "github"
62 owner = $GH_OWNER
63 repo = $GH_REPO
64} | ConvertTo-Json
60$importForm = "repo_url=$([uri]::EscapeDataString("https://github.com/$GH_OWNER/$GH_REPO"))"
6561try {
66 $imported = Invoke-RestMethod -Method POST -Uri "$GLUECRON/import/github/repo" `
62 $r = Invoke-WebRequest -Method POST -Uri "$GLUECRON/import/github/repo" `
6763 -Headers @{ Authorization = "Bearer $PAT" } `
68 -ContentType "application/json" `
69 -Body $importBody -TimeoutSec 120
70 Write-Host " ✓ Repo mirrored to $GLUECRON/$GLUECRON_OWNER/$GH_REPO" -ForegroundColor Green
64 -ContentType "application/x-www-form-urlencoded" `
65 -Body $importForm `
66 -MaximumRedirection 0 `
67 -ErrorAction SilentlyContinue
68 $loc = $r.Headers.Location
69 if ($loc -match "success") {
70 Write-Host " ✓ Repo mirrored to $GLUECRON/$GLUECRON_OWNER/$GH_REPO" -ForegroundColor Green
71 } elseif ($loc -match "error=([^&]+)") {
72 $err = [uri]::UnescapeDataString($matches[1])
73 if ($err -match "already") {
74 Write-Host " ✓ Already imported (existing mirror)" -ForegroundColor Yellow
75 } else {
76 Write-Host " ✗ Import error: $err" -ForegroundColor Red
77 Write-Host " Manual import: $GLUECRON/import" -ForegroundColor Yellow
78 exit 1
79 }
80 } else {
81 Write-Host " ? Unexpected response (location: $loc)" -ForegroundColor Yellow
82 }
7183} catch {
72 $resp = $_.Exception.Response
73 if ($resp -and $resp.StatusCode -eq 409) {
74 Write-Host " ✓ Already imported (409 conflict is fine)" -ForegroundColor Yellow
84 # Invoke-WebRequest treats 302 as terminating in some PowerShell versions
85 if ($_.Exception.Response -and $_.Exception.Response.StatusCode.value__ -eq 302) {
86 $loc = $_.Exception.Response.Headers.Location.OriginalString
87 if ($loc -match "success") {
88 Write-Host " ✓ Repo mirrored to $GLUECRON/$GLUECRON_OWNER/$GH_REPO" -ForegroundColor Green
89 } elseif ($loc -match "already") {
90 Write-Host " ✓ Already imported (existing mirror)" -ForegroundColor Yellow
91 } else {
92 Write-Host " ✗ Import response: $loc" -ForegroundColor Red
93 Write-Host " Manual import: $GLUECRON/import" -ForegroundColor Yellow
94 }
7595 } else {
76 Write-Host " ✗ Import failed: $_" -ForegroundColor Red
77 Write-Host " You can also import manually at $GLUECRON/import"
96 Write-Host " ✗ Import call failed: $_" -ForegroundColor Red
97 Write-Host " Manual import: $GLUECRON/import" -ForegroundColor Yellow
7898 exit 1
7999 }
80100}
81101