Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c7d68c742d | |||
| baf829349c | |||
| 3145acc423 | |||
| ce3fc36835 |
+3
-3
@@ -73,9 +73,9 @@ curl -s https://gitea-mobile.testing.leeworks.dev | head -5
|
|||||||
3. Tap on a PR to see details
|
3. Tap on a PR to see details
|
||||||
4. **Expected**: PR diff summary or review status displays correctly
|
4. **Expected**: PR diff summary or review status displays correctly
|
||||||
|
|
||||||
## Step 7: Core Functionality -- Triage Queue
|
## Step 7: Core Functionality -- Dashboard / Triage Queue
|
||||||
|
|
||||||
1. Navigate to the Triage tab (`/triage`)
|
1. Navigate to the Dashboard/Triage tab (`/`)
|
||||||
2. **Expected**: Unassigned issues and PRs awaiting review appear sorted by priority
|
2. **Expected**: Unassigned issues and PRs awaiting review appear sorted by priority
|
||||||
|
|
||||||
## Step 8: Create Issue (Write Operation)
|
## Step 8: Create Issue (Write Operation)
|
||||||
@@ -116,7 +116,7 @@ curl -s https://gitea-mobile.testing.leeworks.dev | head -5
|
|||||||
| 4 | Auth | Token saved, API calls work |
|
| 4 | Auth | Token saved, API calls work |
|
||||||
| 5 | Issues | List loads, filter works |
|
| 5 | Issues | List loads, filter works |
|
||||||
| 6 | PRs | List loads with review status |
|
| 6 | PRs | List loads with review status |
|
||||||
| 7 | Triage | Queue displays correctly |
|
| 7 | Dashboard/Triage | Queue displays correctly at `/` |
|
||||||
| 8 | Create issue | Issue created in Gitea |
|
| 8 | Create issue | Issue created in Gitea |
|
||||||
| 9 | Apply label | Label applied via API |
|
| 9 | Apply label | Label applied via API |
|
||||||
| 10 | PWA | Standalone mode, safe areas, dark mode |
|
| 10 | PWA | Standalone mode, safe areas, dark mode |
|
||||||
|
|||||||
+34
-3
@@ -1,10 +1,14 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"log"
|
"log"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
"time"
|
||||||
|
|
||||||
"gitea.leeworks.dev/0xwheatyz/gitea-mobile/internal/config"
|
"gitea.leeworks.dev/0xwheatyz/gitea-mobile/internal/config"
|
||||||
giteaclient "gitea.leeworks.dev/0xwheatyz/gitea-mobile/internal/gitea"
|
giteaclient "gitea.leeworks.dev/0xwheatyz/gitea-mobile/internal/gitea"
|
||||||
@@ -36,8 +40,35 @@ func main() {
|
|||||||
handler = middleware.Auth(cfg.SessionSecret, cfg.GiteaToken)(handler)
|
handler = middleware.Auth(cfg.SessionSecret, cfg.GiteaToken)(handler)
|
||||||
handler = middleware.Logging()(handler)
|
handler = middleware.Logging()(handler)
|
||||||
|
|
||||||
slog.Info("server starting", "addr", cfg.ListenAddr, "gitea_url", cfg.GiteaURL)
|
srv := &http.Server{
|
||||||
if err := http.ListenAndServe(cfg.ListenAddr, handler); err != nil {
|
Addr: cfg.ListenAddr,
|
||||||
log.Fatalf("server error: %v", err)
|
Handler: handler,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Channel to receive shutdown signals.
|
||||||
|
quit := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(quit, syscall.SIGTERM, syscall.SIGINT)
|
||||||
|
|
||||||
|
// Start server in a goroutine.
|
||||||
|
go func() {
|
||||||
|
slog.Info("server starting", "addr", cfg.ListenAddr, "gitea_url", cfg.GiteaURL)
|
||||||
|
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||||
|
log.Fatalf("server error: %v", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// Block until a shutdown signal is received.
|
||||||
|
sig := <-quit
|
||||||
|
slog.Info("shutdown signal received, draining in-flight requests", "signal", sig.String())
|
||||||
|
|
||||||
|
// Give in-flight requests up to 15 seconds to complete.
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
if err := srv.Shutdown(ctx); err != nil {
|
||||||
|
slog.Error("server forced to shutdown", "error", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
slog.Info("server stopped gracefully")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user