Skip to content

Modern Docker Management, Designed for Everyone

refactor: upgrade to go 1.27.0 (#3680)

Kyle Mendellb22edb6909c5
diff --git a/.custom-gcl.yml b/.custom-gcl.yml
index b5289dede..7f4941e9b 100644
--- a/.custom-gcl.yml
+++ b/.custom-gcl.yml
@@ -1,7 +1,7 @@
-version: v2.12.2
+version: v2.13.0
name: golangci-lint-custom
destination: ./.bin
plugins:
- module: go.ofkm.dev/shimbad
- version: v0.1.2
\ No newline at end of file
+ version: v0.1.2
diff --git a/.depot/workflows/ci.yml b/.depot/workflows/ci.yml
index 0b517de02..54de4b401 100644
--- a/.depot/workflows/ci.yml
+++ b/.depot/workflows/ci.yml
@@ -1,8 +1,5 @@
name: CI
-env:
- GOEXPERIMENT: jsonv2
-
on:
push:
branches: [main]
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index a5ca145cd..a927ae13d 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -5,10 +5,10 @@
"workspaceFolder": "/workspace",
"features": {
"ghcr.io/devcontainers/features/go:1": {
- "version": "1.26.6"
+ "version": "1.27"
},
"ghcr.io/devcontainers/features/node:2": {
- "version": "26.5.0",
+ "version": "26",
"pnpm": "11.21.0"
},
"ghcr.io/jsburckhardt/devcontainer-features/just:1": {
@@ -42,14 +42,13 @@
}
},
"mounts": [
- "source=node_modules,target=/workspace/node_modules,type=volume",
- "source=pnpm_store,target=/workspace/.pnpm-store,type=volume"
+ "source=node_modules,target=/workspace/node_modules,type=volume",
+ "source=pnpm_store,target=/workspace/.pnpm-store,type=volume"
],
"postCreateCommand": "just deps install all",
"remoteUser": "root",
"containerEnv": {
- "TZ": "Pacific/Auckland",
- "GOEXPERIMENT": "jsonv2"
+ "TZ": "Pacific/Auckland"
},
"remoteEnv": {
"HOST_PROJECT_ROOT": "${localWorkspaceFolder}"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 96c5f7333..4b3c997c3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,8 +1,5 @@
name: CI
-env:
- GOEXPERIMENT: jsonv2
-
on:
pull_request:
branches: [main, "release/**", "breaking/**"]
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 08db28319..b4ffd11d9 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,8 +1,5 @@
name: Release New Arcane Version
-env:
- GOEXPERIMENT: jsonv2
-
on:
push:
tags:
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index fdc1b3d5c..acaf5279a 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -13,7 +13,6 @@ git:
before:
hooks:
- # - just deps install all
- just build single frontend
builds:
@@ -23,7 +22,6 @@ builds:
binary: arcane
env:
- CGO_ENABLED=0
- - GOEXPERIMENT=jsonv2
goos:
- linux
- darwin
@@ -64,7 +62,6 @@ builds:
- exclude_frontend
env:
- CGO_ENABLED=0
- - GOEXPERIMENT=jsonv2
goos:
- linux
- darwin
@@ -101,7 +98,6 @@ builds:
binary: arcane-cli
env:
- CGO_ENABLED=0
- - GOEXPERIMENT=jsonv2
goos:
- linux
- darwin
diff --git a/.vscode/settings.json b/.vscode/settings.json
index beb4be9b1..61847b62a 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,18 +1,5 @@
{
- "github.copilot.enable": {
- "*": false,
- "plaintext": false,
- "markdown": false,
- "scminput": false,
- "typescript": true
- },
"go.buildTags": "playwright,buildables",
- "go.toolsEnvVars": {
- "GOEXPERIMENT": "jsonv2"
- },
- "go.testEnvVars": {
- "GOEXPERIMENT": "jsonv2"
- },
"gopls": {
"ui.diagnostic.analyses": {
"stdversion": false
@@ -35,7 +22,5 @@
},
"tasks.statusbar.default.hide": true,
"tasks.statusbar.limit": 8,
- "github.copilot.chat.summarizeAgentConversationHistory.enabled": false,
- "snyk.advanced.autoSelectOrganization": false,
"js/ts.tsdk.path": "node_modules/@typescript/native-preview"
}
diff --git a/Justfile b/Justfile
index d29e13a66..b51fb428a 100644
--- a/Justfile
+++ b/Justfile
@@ -4,8 +4,6 @@
set working-directory := './'
-export GOEXPERIMENT := "jsonv2"
-
edge_proto_dir := 'backend/proto'
_default:
diff --git a/README.md b/README.md
index d7a5a44f5..1fd86e468 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
<p>Modern Docker Management, Designed for Everyone.</p>
<a title="Crowdin" target="_blank" href="https://crowdin.com/project/arcane-docker-management"><img src="https://badges.crowdin.net/arcane-docker-management/localized.svg"></a>
-<a href="https://pkg.go.dev/github.com/getarcaneapp/arcane/backend"><img src="https://pkg.go.dev/badge/github.com/getarcaneapp/arcane/backend.svg" alt="Go Reference"></a>
+<a href="https://pkg.go.dev/github.com/getarcaneapp/arcane/backend/v2"><img src="https://pkg.go.dev/badge/github.com/getarcaneapp/arcane/backend.svg" alt="Go Reference"></a>
<a href="https://github.com/getarcaneapp/arcane/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-BSD--3--Clause-blue.svg" alt="License"></a>
<a href="https://snyk.io/test/github/getarcaneapp/arcane"><img src="https://snyk.io/test/github/getarcaneapp/arcane/badge.svg" alt="Known Vulnerabilities"></a>
[![Greptile: The War on Bugs](https://www.greptile.com/badge.svg)](https://www.greptile.com/?utm_source=oss_badge&utm_medium=readme&utm_campaign=greptile_for_open_source)
diff --git a/backend/.air.toml b/backend/.air.toml
index ce7cd713a..90ec24640 100644
--- a/backend/.air.toml
+++ b/backend/.air.toml
@@ -5,7 +5,7 @@ env_files = [".env"]
[build]
#cmd = "CGO_ENABLED=1 go build -tags 'exclude_frontend,buildables' -ldflags='-X github.com/getarcaneapp/arcane/backend/buildables.EnabledFeatures=autologin' -o ./.bin/arcane ./cmd"
- cmd = "GOEXPERIMENT=jsonv2 CGO_ENABLED=1 go build -tags 'exclude_frontend' -o ./.bin/arcane ./cmd"
+ cmd = "CGO_ENABLED=1 go build -tags 'exclude_frontend' -o ./.bin/arcane ./cmd"
bin = "./.bin/arcane"
entrypoint = ["./.bin/arcane"]
include_ext = ["go", "tpl", "tmpl", "html"]
diff --git a/backend/api/api.go b/backend/api/api.go
index c0b6e2679..440e3ac23 100644
--- a/backend/api/api.go
+++ b/backend/api/api.go
@@ -165,8 +165,8 @@ func qualifyGenericArcaneArgumentsInternal(pkgPath, typeName, schemaName string)
}
outerPackage := strings.TrimPrefix(pkgPath, arcaneTypesPrefix)
- if separator := strings.LastIndexByte(outerPackage, '/'); separator >= 0 {
- outerPackage = outerPackage[separator+1:]
+ if _, after, found := strings.CutLast(outerPackage, "/"); found {
+ outerPackage = after
}
plainSchemaName := huma.DefaultSchemaNamer(reflect.TypeFor[struct{}](), typeName)
@@ -191,8 +191,8 @@ func qualifyGenericArcaneArgumentsInternal(pkgPath, typeName, schemaName string)
}
innerPackage := afterPrefix[:separator]
- if nestedSeparator := strings.LastIndexByte(innerPackage, '/'); nestedSeparator >= 0 {
- innerPackage = innerPackage[nestedSeparator+1:]
+ if _, after, found := strings.CutLast(innerPackage, "/"); found {
+ innerPackage = after
}
replacement := ""
diff --git a/backend/api/handlers/diagnostics.go b/backend/api/handlers/diagnostics.go
index d93351c33..fd66cb351 100644
--- a/backend/api/handlers/diagnostics.go
+++ b/backend/api/handlers/diagnostics.go
@@ -4,6 +4,7 @@ import (
"context"
"net/http"
+ "emperror.dev/errors"
"github.com/danielgtaylor/huma/v2"
"github.com/getarcaneapp/arcane/backend/v2/api/ws"
@@ -32,6 +33,12 @@ type GetDiagnosticsLogsOutput struct {
Body []logs.Entry
}
+type ScanGoroutineLeaksInput struct{}
+
+type ScanGoroutineLeaksOutput struct {
+ Body system.GoroutineLeakReport
+}
+
// RegisterDiagnostics registers the Huma diagnostics REST endpoints.
func RegisterDiagnostics(api huma.API, diag *diagnostics.DiagnosticsService) {
h := &DiagnosticsHandler{diag: diag}
@@ -57,6 +64,17 @@ func RegisterDiagnostics(api huma.API, diag *diagnostics.DiagnosticsService) {
Security: handlerutil.DefaultOperationSecurity(),
Middlewares: middleware.RequirePermission(api, authz.PermDiagnosticsRead),
}, h.GetRecentLogs)
+
+ huma.Register(api, huma.Operation{
+ OperationID: "scan-goroutine-leaks",
+ Method: http.MethodPost,
+ Path: "/diagnostics/goroutineleak",
+ Summary: "Scan for leaked goroutines",
+ Description: "Runs a goroutine leak-detection GC cycle and returns the goroutineleak pprof profile as text (leaked stacks only).",
+ Tags: []string{"Diagnostics"},
+ Security: handlerutil.DefaultOperationSecurity(),
+ Middlewares: middleware.RequirePermission(api, authz.PermDiagnosticsRead),
+ }, h.ScanGoroutineLeaks)
}
func (h *DiagnosticsHandler) GetDiagnostics(_ context.Context, _ *DiagnosticsInput) (*GetDiagnosticsOutput, error) {
@@ -66,3 +84,11 @@ func (h *DiagnosticsHandler) GetDiagnostics(_ context.Context, _ *DiagnosticsInp
func (h *DiagnosticsHandler) GetRecentLogs(_ context.Context, _ *DiagnosticsInput) (*GetDiagnosticsLogsOutput, error) {
return &GetDiagnosticsLogsOutput{Body: ws.LogBroadcaster().Recent()}, nil
}
+
+func (h *DiagnosticsHandler) ScanGoroutineLeaks(_ context.Context, _ *ScanGoroutineLeaksInput) (*ScanGoroutineLeaksOutput, error) {
+ report, err := h.diag.ScanGoroutineLeaks()
+ if err != nil {
+ return nil, huma.Error500InternalServerError(errors.WithMessage(err, "Failed to collect goroutine leak profile").Error())
+ }
+ return &ScanGoroutineLeaksOutput{Body: report}, nil
+}
diff --git a/backend/cli/admin/reset_mfa_test.go b/backend/cli/admin/reset_mfa_test.go
index 1adf7c3a7..a07eb180c 100644
--- a/backend/cli/admin/reset_mfa_test.go
+++ b/backend/cli/admin/reset_mfa_test.go
@@ -58,13 +58,13 @@ func TestResetMFACommandServiceStatePreservesPasskey(t *testing.T) {
db := newResetMFATestDBInternal(t)
ctx := context.Background()
user := &common.User{
- BaseModel: database.BaseModel{ID: "mfa-reset-user"},
+ ID: "mfa-reset-user",
Username: "alice",
PasskeyMFAEnabled: true,
}
require.NoError(t, db.Create(user).Error)
passkeyRecord := &passkey.Passkey{
- BaseModel: database.BaseModel{ID: "mfa-reset-passkey"},
+ ID: "mfa-reset-passkey",
UserID: user.ID,
RPID: "arcane.example.test",
CredentialID: []byte("credential"),
@@ -78,12 +78,12 @@ func TestResetMFACommandServiceStatePreservesPasskey(t *testing.T) {
secondSession, _, err := sessionService.CreateSession(ctx, user.ID, time.Now().Add(time.Hour), auth.SessionMeta{})
require.NoError(t, err)
require.NoError(t, db.Create(&passkey.PasskeyRecoveryCode{
- BaseModel: database.BaseModel{ID: "mfa-reset-code"},
- UserID: user.ID,
- CodeHash: "stored-hash",
+ ID: "mfa-reset-code",
+ UserID: user.ID,
+ CodeHash: "stored-hash",
}).Error)
transaction := &passkey.AuthTransaction{
- BaseModel: database.BaseModel{ID: "mfa-reset-transaction"},
+ ID: "mfa-reset-transaction",
Kind: "mfa",
UserID: user.ID,
Source: session.UserSessionSourceLocal,
@@ -92,7 +92,7 @@ func TestResetMFACommandServiceStatePreservesPasskey(t *testing.T) {
}
require.NoError(t, db.Create(transaction).Error)
require.NoError(t, db.Create(&passkey.PasskeyCeremony{
- BaseModel: database.BaseModel{ID: "mfa-reset-ceremony"},
+ ID: "mfa-reset-ceremony",
Purpose: "mfa",
UserID: new(user.ID),
AuthTransactionID: new(transaction.ID),
diff --git a/backend/cli/admin/reset_password_test.go b/backend/cli/admin/reset_password_test.go
index 72dbd910c..5b4aff201 100644
--- a/backend/cli/admin/reset_password_test.go
+++ b/backend/cli/admin/reset_password_test.go
@@ -49,7 +49,7 @@ func createGlobalAdminInternal(t *testing.T, db *database.DB) (*common.User, *ro
passwordHash, err := userService.HashPassword("old-password")
require.NoError(t, err)
adminUser, err := userService.CreateUser(ctx, &common.User{
- BaseModel: database.BaseModel{ID: "admin-1"},
+ ID: "admin-1",
Username: "arcane",
PasswordHash: passwordHash,
RequiresPasswordChange: true,
@@ -124,7 +124,7 @@ func TestResetPasswordInternalRejectsNonAdmin(t *testing.T) {
passwordHash, err := userService.HashPassword("old-password")
require.NoError(t, err)
nonAdmin, err := userService.CreateUser(ctx, &common.User{
- BaseModel: database.BaseModel{ID: "user-1"},
+ ID: "user-1",
Username: "operator",
PasswordHash: passwordHash,
RequiresPasswordChange: true,
diff --git a/backend/go.mod b/backend/go.mod
index 5d414b15e..09d2d3457 100644
--- a/backend/go.mod
+++ b/backend/go.mod
@@ -1,6 +1,6 @@
module github.com/getarcaneapp/arcane/backend/v2
-go 1.26.6
+go 1.27
replace (
github.com/getarcaneapp/arcane/cli/v2 => ../cli
@@ -11,14 +11,14 @@ require (
emperror.dev/emperror v0.33.0
emperror.dev/errors v0.8.1
github.com/anthdm/hollywood v1.0.5
- github.com/aws/aws-sdk-go-v2/config v1.32.36
- github.com/aws/aws-sdk-go-v2/credentials v1.19.35
- github.com/aws/aws-sdk-go-v2/service/ecr v1.60.5
+ github.com/aws/aws-sdk-go-v2/config v1.32.37
+ github.com/aws/aws-sdk-go-v2/credentials v1.19.36
+ github.com/aws/aws-sdk-go-v2/service/ecr v1.60.6
github.com/cenkalti/backoff/v5 v5.0.3
github.com/coder/websocket v1.8.15
github.com/compose-spec/compose-go/v2 v2.14.0
github.com/containerd/errdefs v1.0.0
- github.com/containerd/platforms v1.0.0-rc.4
+ github.com/containerd/platforms v1.0.0-rc.5
github.com/coreos/go-oidc/v3 v3.20.0
github.com/danielgtaylor/huma/v2 v2.39.1
github.com/distribution/reference v0.6.0
@@ -26,14 +26,13 @@ require (
github.com/docker/compose/v5 v5.5.0
github.com/docker/go-units v0.5.0
github.com/fsnotify/fsnotify v1.10.1
- github.com/getarcaneapp/arcane/cli/v2 v2.6.0
- github.com/getarcaneapp/arcane/types/v2 v2.6.0
+ github.com/getarcaneapp/arcane/cli/v2 v2.8.1
+ github.com/getarcaneapp/arcane/types/v2 v2.8.1
github.com/go-git/go-git/v5 v5.19.2
github.com/go-webauthn/webauthn v0.17.4
github.com/gofrs/flock v0.13.0
github.com/golang-jwt/jwt/v5 v5.3.1
github.com/google/go-containerregistry v0.21.9
- github.com/google/uuid v1.6.0
github.com/jinzhu/copier v0.4.0
github.com/klauspost/compress v1.19.2
github.com/labstack/echo/v5 v5.3.1
@@ -42,7 +41,7 @@ require (
github.com/moby/buildkit v0.32.2
github.com/moby/moby/api v1.55.0
github.com/moby/moby/client v0.5.1
- github.com/nicholas-fedor/shoutrrr v0.17.0
+ github.com/nicholas-fedor/shoutrrr v0.17.1
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.1
github.com/orandin/slog-gorm v1.4.0
@@ -53,7 +52,7 @@ require (
github.com/samber/slog-echo/v2 v2.0.0
github.com/shirou/gopsutil/v4 v4.26.7
github.com/spf13/cobra v1.10.2
- github.com/stretchr/testify v1.11.1
+ github.com/stretchr/testify v1.12.1
github.com/subosito/gotenv v1.6.0
github.com/wneessen/go-mail v0.8.1
go.getarcane.app/acfs v0.4.1
@@ -62,19 +61,19 @@ require (
go.getarcane.app/streams v0.4.0
go.getarcane.app/sys/cgroup v0.1.1
go.getarcane.app/sys/crypto v0.1.0
- go.getarcane.app/updater v0.7.1
+ go.getarcane.app/updater v0.7.2
go.uber.org/fx v1.24.0
go.yaml.in/yaml/v4 v4.0.0-rc.6
- golang.org/x/crypto v0.54.0
- golang.org/x/mod v0.39.0
- golang.org/x/net v0.57.0
+ golang.org/x/crypto v0.55.0
+ golang.org/x/mod v0.40.0
+ golang.org/x/net v0.58.0
golang.org/x/oauth2 v0.36.0
golang.org/x/sync v0.22.0
golang.org/x/sys v0.47.0
golang.org/x/term v0.45.0
- golang.org/x/text v0.40.0
+ golang.org/x/text v0.41.0
golang.org/x/time v0.15.0
- google.golang.org/grpc v1.83.0
+ google.golang.org/grpc v1.83.1
google.golang.org/protobuf v1.36.12
gorm.io/driver/postgres v1.6.2
gorm.io/gorm v1.31.2
@@ -92,18 +91,18 @@ require (
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/agnivade/levenshtein v1.2.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
- github.com/aws/aws-sdk-go-v2 v1.43.5 // indirect
- github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.36 // indirect
- github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.36 // indirect
- github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.36 // indirect
- github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.37 // indirect
- github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.16 // indirect
- github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.36 // indirect
- github.com/aws/aws-sdk-go-v2/service/signin v1.5.5 // indirect
- github.com/aws/aws-sdk-go-v2/service/sso v1.33.5 // indirect
- github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.5 // indirect
- github.com/aws/aws-sdk-go-v2/service/sts v1.45.5 // indirect
- github.com/aws/smithy-go v1.27.7 // indirect
+ github.com/aws/aws-sdk-go-v2 v1.43.6 // indirect
+ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.37 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.37 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.37 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.38 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.17 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.37 // indirect
+ github.com/aws/aws-sdk-go-v2/service/signin v1.5.6 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sso v1.33.6 // indirect
+ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.6 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sts v1.45.6 // indirect
+ github.com/aws/smithy-go v1.27.8 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/buger/goterm v1.0.4 // indirect
@@ -120,7 +119,6 @@ require (
github.com/containerd/typeurl/v2 v2.3.0 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 // indirect
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
- github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/depot/depot-go v0.5.2 // indirect
github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect
@@ -128,7 +126,7 @@ require (
github.com/docker/buildx v0.36.1 // indirect
github.com/docker/docker v28.5.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.9.8 // indirect
- github.com/docker/go-connections v0.7.0 // indirect
+ github.com/docker/go-connections v0.8.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ebitengine/purego v0.10.2 // indirect
github.com/eclipse/paho.golang v0.23.0 // indirect
@@ -175,7 +173,9 @@ require (
github.com/google/certificate-transparency-go v1.3.3 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/go-tpm v0.9.8 // indirect
+ github.com/google/go-tpm-tools v0.4.8 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
+ github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
@@ -212,6 +212,7 @@ require (
github.com/mattn/go-runewidth v0.0.27 // indirect
github.com/mattn/go-shellwords v1.0.14 // indirect
github.com/mfridman/interpolate v0.0.2 // indirect
+ github.com/miekg/dns v1.1.62 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/go-archive v0.3.3 // indirect
@@ -237,7 +238,6 @@ require (
github.com/pjbgf/sha1cd v0.6.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
- github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/prometheus/client_golang v1.24.1 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
@@ -259,7 +259,7 @@ require (
github.com/sigstore/sigstore v1.10.8 // indirect
github.com/sigstore/sigstore-go v1.2.2 // indirect
github.com/sigstore/timestamp-authority/v2 v2.1.2 // indirect
- github.com/sirupsen/logrus v1.9.4 // indirect
+ github.com/sirupsen/logrus v1.10.0 // indirect
github.com/skeema/knownhosts v1.3.2 // indirect
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
github.com/spf13/pflag v1.0.10 // indirect
@@ -293,17 +293,17 @@ require (
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect
- go.opentelemetry.io/otel v1.44.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 // indirect
+ go.opentelemetry.io/otel v1.45.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 // indirect
- go.opentelemetry.io/otel/metric v1.44.0 // indirect
- go.opentelemetry.io/otel/sdk v1.44.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.44.0 // indirect
- go.opentelemetry.io/otel/trace v1.44.0 // indirect
+ go.opentelemetry.io/otel/metric v1.45.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.45.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.45.0 // indirect
+ go.opentelemetry.io/otel/trace v1.45.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
go.uber.org/dig v1.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
diff --git a/backend/go.sum b/backend/go.sum
index 4944fbe88..36a1b844b 100644
--- a/backend/go.sum
+++ b/backend/go.sum
@@ -79,38 +79,38 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
-github.com/aws/aws-sdk-go-v2 v1.43.5 h1:yKT5GYnFWhuDo+DqKvE5ZPwVn3RjC4MAeBtZGlh6AVM=
-github.com/aws/aws-sdk-go-v2 v1.43.5/go.mod h1:wZjAJppCntyOGgVSmgVTfDyRJK5PHOasO6Wsy8U7Axk=
-github.com/aws/aws-sdk-go-v2/config v1.32.36 h1:mX6ietU7UlB4w/2IUaexJdsyUDvhTd+jYPjVePiyi6s=
-github.com/aws/aws-sdk-go-v2/config v1.32.36/go.mod h1:rMpV4xk7ZK59edraSaHP0jsWrztWTT5tbCwWY495hug=
-github.com/aws/aws-sdk-go-v2/credentials v1.19.35 h1:Cxua2RVdRwL0sfjHM/SnQoOnQ7xKng9m5EQBO8BnZlg=
-github.com/aws/aws-sdk-go-v2/credentials v1.19.35/go.mod h1:9XQ+RSIGPkycr+oCJYnB1uTv5kMVVR+rd2vYK0Hxj2w=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.36 h1:gucL1KH/PAYbpTpBg09CiVpBdTu4qkCl8C7xOTBixUg=
-github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.36/go.mod h1:usTB+PHhNMhrx2dxUeHcM7OrT5pySvmjYI++IsefPN0=
-github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.36 h1:5CrzwxDqf4w3x1Vs3/NiZ0nsC34Hbm3pIDMWbsLebOE=
-github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.36/go.mod h1:A3gHdKZIvG/QXERzZwcxNS3RNDFcRCuhhTFBYp+V/nw=
-github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.36 h1:A4N2f4YPcST0v+dWtX+xrpPPCL9VTBhoIFFUWYqbacE=
-github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.36/go.mod h1:B/Qr859uxWUEfZeGotK5KAEoof4Q9YWgNtPSwV6jcyk=
-github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.37 h1:oyd3ke4V9AhKcRR7rRgxk1VyI+DjK2CBQtbxh3OkdaA=
-github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.37/go.mod h1:aA9D7SqfG9IC1b7FLD7Iyc8Q4JN0a8gHhNjN4zPlIaI=
-github.com/aws/aws-sdk-go-v2/service/ecr v1.60.5 h1:ft7DMzCb1eHoJgjcupW/wc/kDLQ+rEX1vezAEELQlOM=
-github.com/aws/aws-sdk-go-v2/service/ecr v1.60.5/go.mod h1:U3M6X8k67rGWURiJVFbCcStvupDc44wq+HoLBEaK/is=
-github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.16 h1:iE4NGbvqUZnHDqddQAauZzCILYtFjOHwRM5MOOKLB5A=
-github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.16/go.mod h1:VsjEgrP+ibcou8TlWA4tYaB+0OojuhirsmCe+U60hTA=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.36 h1:fx2ujmozWn+C/GtfXfz5k6Ckzza40ElOpIW7d92fLWQ=
-github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.36/go.mod h1:QT2ufGVJ+xTRxtXPHTQ1kHkAdWIKPCmD+BqYAXWv8/4=
+github.com/aws/aws-sdk-go-v2 v1.43.6 h1:RrmFcqCBxkJuf7g1axVo5krB4jM/AO8r5e5oujrgdoQ=
+github.com/aws/aws-sdk-go-v2 v1.43.6/go.mod h1:tXpPM+v0D1lndmga+HqqLDIzUFJlEeR21aspVklHF00=
+github.com/aws/aws-sdk-go-v2/config v1.32.37 h1:Ljl7LOJB6ym0liuEl0+TZ3d7f5I8MEZN1Cj9PINlj/g=
+github.com/aws/aws-sdk-go-v2/config v1.32.37/go.mod h1:WJ7pe7ZPpmG8Q5kKS53zeypIV4FBGACxmte8Uc6SgUc=
+github.com/aws/aws-sdk-go-v2/credentials v1.19.36 h1:84s5xMme6ENYEdKG8rsbSFFg/8+lbHBeM9QYSO0gnDk=
+github.com/aws/aws-sdk-go-v2/credentials v1.19.36/go.mod h1:c46BLdagDLIswjgt+GeQOslXgeS0E6wCacs5yZbxPGk=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.37 h1:b5tb+CZItBkydC7r3hTNdSO3pszG1R2EtnA+7TePQPk=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.37/go.mod h1:ZQ+6SU9X0oz6+7MUCSswv9Mjci4eaqZr21HI2RVy/yA=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.37 h1:lznzIOvvbqjfe8UAaciCRJgBgJsxuTROKlhZuXQWfv8=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.37/go.mod h1:otfkzyfQeMMLZAqX59GSXTL3o22BR/l6HFaRzzbWSqA=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.37 h1:zCEORWo0eU0gDjG+IyApE/2B+ZGG1m+GU7B263XV8ds=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.37/go.mod h1:i6c0PEl3TNOWxRbQ++KQcVenPWS/GoQeiklKhNuqzJ8=
+github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.38 h1:A3UAuCmx7LyUcrixBTzKJYYIUZ2yTvn6ZhT8PB+7APk=
+github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.38/go.mod h1:1PDUYG9Z+JrbbsobsAZHjWOm9QBT/djiK3QbykTL5Z4=
+github.com/aws/aws-sdk-go-v2/service/ecr v1.60.6 h1:RbjO6G1wu+q43r0322sDABXi9vq/YZp254BBKAeLtRI=
+github.com/aws/aws-sdk-go-v2/service/ecr v1.60.6/go.mod h1:snsosIuclt9tpFKzldCnu1ykT5SYEND/bK9qTJmoJ+o=
+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.17 h1:OvYZOB3qA6zvfdRFiRFRzVSiElMYrz3GdntkXZxlp1o=
+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.17/go.mod h1:JgR/2Ew50ACfIWau1oeMRX59tMtC0kM+PYQGEaT04cY=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.37 h1:a3D4AjrOrTrP8+d9ILBthqrElf0z1JNol09Xvnwcys8=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.37/go.mod h1:ky0gTu+ukvUTuUKFIpp6Wid4oninrkCyvbFkVs0kpHM=
github.com/aws/aws-sdk-go-v2/service/kms v1.52.0 h1:QNtg+Mtj1zmepk568+UKBD5DFfqh+ESTUUqQT27JkQc=
github.com/aws/aws-sdk-go-v2/service/kms v1.52.0/go.mod h1:Y0+uxvxz6ib4KktRdK0V4X45Vcs/JyYoz8H71pO8xeI=
-github.com/aws/aws-sdk-go-v2/service/signin v1.5.5 h1:0VTFBfOgPJrUSpGMgzoi8qLcXF5dbmiBuxpo14eBWUw=
-github.com/aws/aws-sdk-go-v2/service/signin v1.5.5/go.mod h1:sNZYlBxoohYMBYl47BO/bFtAM6I8HSsPa1qwwPPRGoQ=
-github.com/aws/aws-sdk-go-v2/service/sso v1.33.5 h1:jDQARFp1mJ2PEnllQf01nfFXGfWMJ59e0/HCHUTTZCk=
-github.com/aws/aws-sdk-go-v2/service/sso v1.33.5/go.mod h1:OcT2AhgTuxGAwZk5hgxaNLGpS33W8s8dUQadGVDVY9I=
-github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.5 h1:8xo1q9ttkYqMJ6vOXX67FPSpVEI7BWKVTKh77g82w+8=
-github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.5/go.mod h1:hbBeEUrZg6VddXYZpbKPyF0tl4XEnM+Dbx92RW3vmZI=
-github.com/aws/aws-sdk-go-v2/service/sts v1.45.5 h1:eQ5BtXDrPg2wK0AjtVPzeBhUpYPeqHE/ptiH7xJRGek=
-github.com/aws/aws-sdk-go-v2/service/sts v1.45.5/go.mod h1:f9ImhnOISY7BuTZLM8qHepCYnglHBVLk5wVzatmP++w=
-github.com/aws/smithy-go v1.27.7 h1:Zgj5z4LfcDYoQIVk+n/yGdTkP/2y6ZT5vYxe0fp7bqE=
-github.com/aws/smithy-go v1.27.7/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
+github.com/aws/aws-sdk-go-v2/service/signin v1.5.6 h1:i68sFvXidKlkiSvI7d7Ilc1/UvW4CtBOaivH7jhG4fs=
+github.com/aws/aws-sdk-go-v2/service/signin v1.5.6/go.mod h1:/h7Obr9WTtzbjTHGASRQwLN7Bupw+TC3x8x7fyx39hE=
+github.com/aws/aws-sdk-go-v2/service/sso v1.33.6 h1:tpfGChmjUmv3W9WlRvy+stwKDTbFFdq8Zk9DbFPrfMU=
+github.com/aws/aws-sdk-go-v2/service/sso v1.33.6/go.mod h1:CSjiDzmG/lsKkTOYjbkM+duLmRlW+LOxD64Na44ijnI=
+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.6 h1:49BBtY68A+KJCQ3a2F3eUe6ROsKucxUdfHKoqorc0wI=
+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.6/go.mod h1:ptG2hbs7QltE1GcQY0MpS4bfrc51KCnBXUr7OT1EEfE=
+github.com/aws/aws-sdk-go-v2/service/sts v1.45.6 h1:JvExZWabChDM0qJAirQYGfOYo0ndT3edXj+fqSPNjkE=
+github.com/aws/aws-sdk-go-v2/service/sts v1.45.6/go.mod h1:XZcaQkV2cItp6yEkrwljyaPOf22RuX7T43jxap/FOmM=
+github.com/aws/smithy-go v1.27.8 h1:FR0dxZfIlV7Z8eh2iHfIofdunw382XsDV3Mxt9nUvRY=
+github.com/aws/smithy-go v1.27.8/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
@@ -156,8 +156,8 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/containerd/nydus-snapshotter v0.15.15 h1:kVYbFpYA4K43qxGVoc/VBwRXLAVWn4X9mdwGrR+HsLk=
github.com/containerd/nydus-snapshotter v0.15.15/go.mod h1:L96yO+4iE6qqDiqXKhxMXBoPeaE7JgzXir9yanUVuOY=
-github.com/containerd/platforms v1.0.0-rc.4 h1:M42JrUT4zfZTqtkUwkr0GzmUWbfyO5VO0Q5b3op97T4=
-github.com/containerd/platforms v1.0.0-rc.4/go.mod h1:lKlMXyLybmBedS/JJm11uDofzI8L2v0J2ZbYvNsbq1A=
+github.com/containerd/platforms v1.0.0-rc.5 h1:vXd569rDrz8LeMXzAnBsy6LADV5YtsD8oyaRarxdmSU=
+github.com/containerd/platforms v1.0.0-rc.5/go.mod h1:lKlMXyLybmBedS/JJm11uDofzI8L2v0J2ZbYvNsbq1A=
github.com/containerd/plugin v1.1.0 h1:O+7lczNJVMy8rz0YNx3xGB8tTf5qY4i5abF041Ew19U=
github.com/containerd/plugin v1.1.0/go.mod h1:qBTum+A8lJ6lO44A19Eo7y1OlcLj4OWFH1DA/vnHmcc=
github.com/containerd/stargz-snapshotter v0.18.2 h1:Ev/sxfQUjwzJQ9eqy3XzttcQ3osMIqkQgMYlcET+10M=
@@ -182,8 +182,6 @@ github.com/danieljoos/wincred v1.2.3 h1:v7dZC2x32Ut3nEfRH+vhoZGvN72+dQ/snVXo/vMF
github.com/danieljoos/wincred v1.2.3/go.mod h1:6qqX0WNrS4RzPZ1tnroDzq9kY3fu1KwE7MRLQK4X0bs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
-github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40=
github.com/depot/depot-go v0.5.2 h1:mQHyy1tGdmMKnlmsThjAc9mU3NHGUUUyzmnkhyotV+E=
@@ -215,8 +213,8 @@ github.com/docker/docker v28.5.2+incompatible h1:DBX0Y0zAjZbSrm1uzOkdr1onVghKaft
github.com/docker/docker v28.5.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.9.8 h1:bIREROb7So6PRlq6KTtdS9MPEjC29OQRkFNlvK2OX8Q=
github.com/docker/docker-credential-helpers v0.9.8/go.mod h1:v1S+hepowrQXITkEfw6o4+BMbGot02wiKpzWhGUZK6c=
-github.com/docker/go-connections v0.7.0 h1:6SsRfJddP22WMrCkj19x9WKjEDTB+ahsdiGYf0mN39c=
-github.com/docker/go-connections v0.7.0/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
+github.com/docker/go-connections v0.8.1 h1:JibmG5hULs5qXSr/cp/w3Pw5fZuStt4MOHMUExb29/M=
+github.com/docker/go-connections v0.8.1/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
@@ -356,8 +354,8 @@ github.com/google/go-containerregistry v0.21.9 h1:F+D4uZ3iA3DLMJLfhaqMdHJbzeqm/2
github.com/google/go-containerregistry v0.21.9/go.mod h1:dP5XNKcL7kMFF/TB3LfvWmVhAcv7iqkHb3oDK8aauTo=
github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo=
github.com/google/go-tpm v0.9.8/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY=
-github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba h1:qJEJcuLzH5KDR0gKc0zcktin6KSAwL7+jWKBYceddTc=
-github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba/go.mod h1:EFYHy8/1y2KfgTAsx7Luu7NGhoxtuVHnNo8jE7FikKc=
+github.com/google/go-tpm-tools v0.4.8 h1:V4oIYyAD3BykOycwYQzO29WefDouQMTsYZqmG3HxOfM=
+github.com/google/go-tpm-tools v0.4.8/go.mod h1:4DfiOtiS1KppJjwf1+tqtW4K3PrCJjAAqFKj/TYTJKg=
github.com/google/pprof v0.0.0-20260802141513-ef3492d7dac3 h1:LMLX+LgTNWpfvCBdFebv6EsYotImrt/Ppc5cXIriCSo=
github.com/google/pprof v0.0.0-20260802141513-ef3492d7dac3/go.mod h1:jl5iWTm0/hd5PjEYEOuwAJ57L/CibdZfrqZ5XA5GrCk=
github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0=
@@ -496,8 +494,8 @@ github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBW
github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY=
github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg=
-github.com/miekg/dns v1.1.57 h1:Jzi7ApEIzwEPLHWRcafCN9LZSBbqQpxjt/wpgvg7wcM=
-github.com/miekg/dns v1.1.57/go.mod h1:uqRjCRUuEAA6qsOiJvDd+CFo/vW+y5WR6SNmHE55hZk=
+github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ=
+github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
@@ -548,12 +546,12 @@ github.com/natefinch/atomic v1.0.1 h1:ZPYKxkqQOx3KZ+RsbnP/YsgvxWQPGxjC0oBt2AhwV0
github.com/natefinch/atomic v1.0.1/go.mod h1:N/D/ELrljoqDyT3rZrsUmtsuzvHkeB/wWjHV22AZRbM=
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
-github.com/nicholas-fedor/shoutrrr v0.17.0 h1:xfp3z5QbE8jXvUhUEwWDk47SJ/b912VoB8MJJDU+q4E=
-github.com/nicholas-fedor/shoutrrr v0.17.0/go.mod h1:s4ldyLs6uwBy9lIjYrY+8lyTqJtPvZSrILw0CyMLock=
+github.com/nicholas-fedor/shoutrrr v0.17.1 h1:tpIM/hBgM1RKmfcoGsVsfvra5EsQClH8qFkvMoP6fVs=
+github.com/nicholas-fedor/shoutrrr v0.17.1/go.mod h1:vMer/4ey2s4xF8mHyeIOwq5ze8outIMvJZ0DuqE8kvc=
github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s=
github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ=
-github.com/onsi/ginkgo/v2 v2.32.0 h1:Hw7s2pVrQo/8Yz5N77qdnpHaoc+c6cC9WIV1Jce+J6E=
-github.com/onsi/ginkgo/v2 v2.32.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44=
+github.com/onsi/ginkgo/v2 v2.32.1 h1:6tlvcDm/3sE8lGJbZ4+d4mO3RLy24/tQWOFzVSQNIfw=
+github.com/onsi/ginkgo/v2 v2.32.1/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44=
github.com/onsi/gomega v1.42.1 h1:iN1rCUX+44NZ1Dc97MPoeFYbFR0vh8zxoxMFwKdyZ6I=
github.com/onsi/gomega v1.42.1/go.mod h1:REff/hsDsodHoKlWsP2mAPhu1+5/6hVYNf9rIEBpeSg=
github.com/open-policy-agent/opa v1.14.1 h1:MhurLB9mSbXmojYFCmGbiC1Uagu1+aFAV4XVotDA86M=
@@ -656,8 +654,8 @@ github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.10.8/go.mod h1:6IDF
github.com/sigstore/timestamp-authority/v2 v2.1.2 h1:7DDhnknLL4w8VwomyvW2W8qblOS9LDR8oihna+jc7Ls=
github.com/sigstore/timestamp-authority/v2 v2.1.2/go.mod h1:o6rAVZceFyejClIj/uStRNIemP16bVMZtbMmhk6pr0U=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
-github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
-github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
+github.com/sirupsen/logrus v1.10.0 h1:T8MxJJXVZkfcC5zSRMRAg2F8+lxjmUCGGWPzFxO+Msc=
+github.com/sirupsen/logrus v1.10.0/go.mod h1:FXZFonkDAnFozmO+5hGAFvB0Yg9/j2SIhA/QuIkP180=
github.com/skeema/knownhosts v1.3.2 h1:EDL9mgf4NzwMXCTfaxSD/o/a5fxDw/xL9nkU28JjdBg=
github.com/skeema/knownhosts v1.3.2/go.mod h1:bEg3iQAuw+jyiw+484wwFJoKSLwcfd7fqRy+N0QTiow=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=
@@ -682,8 +680,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
-github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
+github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
+github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/tchap/go-patricia/v2 v2.3.3 h1:xfNEsODumaEcCcY3gI0hYPZ/PcpVv5ju6RMAhgwZDDc=
@@ -772,8 +771,8 @@ go.getarcane.app/sys/cgroup v0.1.1 h1:c39W8FDqMXlKOZrpH+itaY+t8oC0tva0+6ztTrKvVI
go.getarcane.app/sys/cgroup v0.1.1/go.mod h1:2dUDhWV8qe9LRnLIqa5VQDhdWbTQ04EepttdIAe9dcM=
go.getarcane.app/sys/crypto v0.1.0 h1:HDQ2CKHkm+wZe5xb/qR7MzW5fKi0Wq8Jcyr7qDVgRWg=
go.getarcane.app/sys/crypto v0.1.0/go.mod h1:YtoRB0TENwfdNl0ZUTWkeas/8rT7NhCbI8ENsZzCCdU=
-go.getarcane.app/updater v0.7.1 h1:MuS+mOEwlYpCx44Fvmj1CkOdju4d4/OaAYzZUpJll+U=
-go.getarcane.app/updater v0.7.1/go.mod h1:6b8zVFJEUMhLzDOi4jwKBA/GmbVgguv0FeGOoO67JW8=
+go.getarcane.app/updater v0.7.2 h1:kJUBUgc7DLgyMD0ZKbGa2FafsTiI+hjJpIFzlI93VUc=
+go.getarcane.app/updater v0.7.2/go.mod h1:0zMnkBlRjcKTugKJE03c4ZAx/1HtwgHayFVroHrQcrg=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
@@ -782,10 +781,10 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0/go.mod h1:D7J12YRapIekYyPWgGPlA/23pRmpSEZC5xJC/TTLI9U=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0 h1:MCcYL7J6Vt/X0kjqbMZkekCmwsurbQRbL69vkiye2lk=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.69.0/go.mod h1:3jnStNwSufK+f5ktjL4EPcwtig4rtd81NS70lqHuXl8=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI=
-go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU=
-go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 h1:LMuyCAyfalSjDyjdC65nK6N0zoTT63+E/u95X0JovZI=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0/go.mod h1:085m8qbm4hgc8rZWGDEa4vmyyo2c3nPxUslYUKUIU04=
+go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU=
+go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.44.0 h1:SUplec5dp06reu1zaXmOXdvqH398taqrDXqUl99jxSc=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.44.0/go.mod h1:ho2g4N+ane+swq5I/VBkKWnRDY4kUINH3FuqyZqX/Ug=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.44.0 h1:RuynHbfU8JUEw7DyONgkVYg2SVtsoF28y0LGIr69jgA=
@@ -796,16 +795,16 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 h1:qazEJ
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0/go.mod h1:fOD2Yefuxixkx3ahVNf0O/PERb6r4OlbxfATVnYvzCo=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0 h1:lgh3PiVrRUWMLOVSkQicxzZll5NjF1r+AtsX1XRIHw0=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.44.0/go.mod h1:5Cnhth3m/AgOeTgE3ex12pPmiu/gGtZit03kSzx9X7s=
-go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc=
-go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo=
-go.opentelemetry.io/otel/metric/x v0.66.0 h1:YkCrx1zLOChi9ZcZ6euupOcsgzbVlec7D/xoEU1+cTA=
-go.opentelemetry.io/otel/metric/x v0.66.0/go.mod h1:d1+BDj9t96do0/1LoU1ayfCv79ZgNE41qbhBvnMOBZk=
-go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58=
-go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0=
-go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI=
-go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA=
-go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk=
-go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE=
+go.opentelemetry.io/otel/metric v1.45.0 h1:7Eg1uH7CJ5cXv9is6tnBe1FI6rj1nwUdbFypRm3br/M=
+go.opentelemetry.io/otel/metric v1.45.0/go.mod h1:HAPbm1nd3p1PmFH7v2dR+6BjXxw+Lq4a2+pndMAm08s=
+go.opentelemetry.io/otel/metric/x v0.67.0 h1:PcicCNZFkZ4bXfSooXdo3WN7RBOVOtjVdo1wD358Uns=
+go.opentelemetry.io/otel/metric/x v0.67.0/go.mod h1:FBjCWZe6wgcqxcMtjdGiClDKXb2YxxXii0CXftE4QtI=
+go.opentelemetry.io/otel/sdk v1.45.0 h1:4VVSMgQ83dUgW2aoX5f6JgLvHwIvzcuLnF9lUdCSpCw=
+go.opentelemetry.io/otel/sdk v1.45.0/go.mod h1:Sr40LgXV7DsKMMJMKOhUWOgMWTfAaqvm2kF0g7ilwuA=
+go.opentelemetry.io/otel/sdk/metric v1.45.0 h1:oVFszMfyj1Am6s24Vtc7wBb8BKLcwepJjNEYILuiE3o=
+go.opentelemetry.io/otel/sdk/metric v1.45.0/go.mod h1:vUWUxDZvu1WVRj8JA8S0AdhsPrZoDpA2DdZauIh4mDA=
+go.opentelemetry.io/otel/trace v1.45.0 h1:l/mP6Uv7oNO7/TblbhpbgMidxhq1uO/rPsikOyVhxag=
+go.opentelemetry.io/otel/trace v1.45.0/go.mod h1:qoJJA2xNMnxRrdISU/kLtfUH2wNeQbiv+jhs/CxI8bc=
go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g=
go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk=
go.step.sm/crypto v0.77.7 h1:6azC+pD678Vjju8yXnMDHCZJ+HzFaEmL3sCryiezTIA=
@@ -832,13 +831,13 @@ go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
go.yaml.in/yaml/v4 v4.0.0-rc.6 h1:1h7H1ohdUh93/FyE4YaDa1Zh64K6VVbjF4K6WUxMtH4=
go.yaml.in/yaml/v4 v4.0.0-rc.6/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
-golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
-golang.org/x/mod v0.39.0 h1:UF5zwQdCRRUpHfyPwr7d4UrGiVeldIsogtzWVnczL74=
-golang.org/x/mod v0.39.0/go.mod h1:bvIbwjQ0HUFFf5AKukeeYQG4ZBUG9yxQbR9aEweIwYY=
+golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M=
+golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis=
+golang.org/x/mod v0.40.0 h1:hUv+3cXcdRHz08UmSiOob7sadHig73uo5bkXxQ/tvUs=
+golang.org/x/mod v0.40.0/go.mod h1:0/weTWkPWGBikyTWAX3dkjVztMmBA5hM0DH6BElSupE=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
-golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
+golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To=
+golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU=
golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q=
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
@@ -861,13 +860,13 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn
golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0=
golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
-golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
+golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
+golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE=
-golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk=
+golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI=
+golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo=
gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4=
gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E=
google.golang.org/api v0.283.0 h1:0lkp8u0MPwJVHqRL+nJlMAoZVVzbmiXmFHXMOTmSPik=
@@ -878,8 +877,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa h1:
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:q4lMZS6kskjT5HvCPrnnypcDPVJqT/f4nfxmkE7gryY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260720211330-0afa2a65878a h1:qI/YMH1ep2qQtqcp00gMQyoU7mjvbhg88GJKCvfoLj0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20260720211330-0afa2a65878a/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=
-google.golang.org/grpc v1.83.0 h1:JeNZEKJFbQxArAMl+hiytHauacDNqJUllNfmIMmpqnQ=
-google.golang.org/grpc v1.83.0/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ=
+google.golang.org/grpc v1.83.1 h1:HIO0+BEtBP6soyqvqC8sNUjZ7bTs+0hFQuFF+RAy++Y=
+google.golang.org/grpc v1.83.1/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ=
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/backend/internal/activity/handler.go b/backend/internal/activity/handler.go
index 6ac54664e..1e71b3463 100644
--- a/backend/internal/activity/handler.go
+++ b/backend/internal/activity/handler.go
@@ -284,7 +284,7 @@ func (h *ActivityHandler) cancelRequestedByInternal(ctx context.Context, forward
func (h *ActivityHandler) RunLocalStreamProducer(ctx context.Context, limit int, events chan<- activitytypes.StreamEvent) {
sendSnapshot := func() bool {
activities, _, err := h.activityService.ListActivitiesPaginated(ctx, "0", pagination.QueryParams{
- Params: pagination.Params{Limit: resolveActivityStreamLimitInternal(limit)},
+ Limit: resolveActivityStreamLimitInternal(limit),
})
if err != nil {
if ctx.Err() == nil {
diff --git a/backend/internal/activity/service.go b/backend/internal/activity/service.go
index 5ac77fdc4..cd0940951 100644
--- a/backend/internal/activity/service.go
+++ b/backend/internal/activity/service.go
@@ -344,9 +344,7 @@ func (s *ActivityService) StartActivity(ctx context.Context, req StartActivityRe
LatestMessage: strings.TrimSpace(req.LatestMessage),
StartedAt: now,
Metadata: cloneJSONInternal(req.Metadata),
- BaseModel: database.BaseModel{
- CreatedAt: now,
- },
+ CreatedAt: now,
}
if model.Type == "" {
model.Type = activitytypes.TypeAutoUpdate
@@ -586,11 +584,9 @@ func buildAppendBatchInternal(activityID string, reqs []AppendActivityMessageReq
Level: level,
Message: messageText,
Payload: cloneJSONInternal(req.Payload),
- BaseModel: database.BaseModel{
- // Spread inside the shared timestamp so the created_at sort
- // used for retrieval keeps the original line order.
- CreatedAt: now.Add(time.Duration(len(messages)) * time.Microsecond),
- },
+ // Spread inside the shared timestamp so the created_at sort
+ // used for retrieval keeps the original line order.
+ CreatedAt: now.Add(time.Duration(len(messages)) * time.Microsecond),
})
latestMessage = messageText
diff --git a/backend/internal/activity/service_test.go b/backend/internal/activity/service_test.go
index 6d44d33c9..57b77eccd 100644
--- a/backend/internal/activity/service_test.go
+++ b/backend/internal/activity/service_test.go
@@ -37,7 +37,7 @@ func TestActivityServiceLifecycleInternal(t *testing.T) {
progress := 5
startedBy := &common.User{
- BaseModel: database.BaseModel{ID: "user-1"},
+ ID: "user-1",
Username: "arcane",
DisplayName: new("Arcane Admin"),
}
@@ -81,7 +81,7 @@ func TestActivityServiceLifecycleInternal(t *testing.T) {
require.Equal(t, 100, *completed.Progress)
list, paginationResp, err := service.ListActivitiesPaginated(ctx, "0", pagination.QueryParams{
- Params: pagination.Params{Limit: 10},
+ Limit: 10,
})
require.NoError(t, err)
require.Len(t, list, 1)
@@ -343,7 +343,7 @@ func TestActivityServiceListOrderStableUnderProgressUpdatesInternal(t *testing.T
listIDs := func() []string {
list, _, listErr := service.ListActivitiesPaginated(ctx, "0", pagination.QueryParams{
- Params: pagination.Params{Limit: 10},
+ Limit: 10,
})
require.NoError(t, listErr)
ids := make([]string, 0, len(list))
diff --git a/backend/internal/apikey/service_test.go b/backend/internal/apikey/service_test.go
index 58e2bb232..905fdea6d 100644
--- a/backend/internal/apikey/service_test.go
+++ b/backend/internal/apikey/service_test.go
@@ -69,8 +69,8 @@ func createTestAPIKeyUser(t *testing.T, ctx context.Context, userService *user.U
}
user := &common.User{
- BaseModel: database.BaseModel{ID: id},
- Username: username,
+ ID: id,
+ Username: username,
}
created, err := userService.CreateUser(ctx, user)
@@ -112,8 +112,8 @@ func createDefaultAdminUser(t *testing.T, ctx context.Context, userService *user
t.Helper()
user := &common.User{
- BaseModel: database.BaseModel{ID: "default-admin-user"},
- Username: defaultAdminUsername,
+ ID: "default-admin-user",
+ Username: defaultAdminUsername,
}
created, err := userService.CreateUser(ctx, user)
@@ -136,7 +136,7 @@ func TestListApiKeysPermissionQueryCountIsConstant(t *testing.T) {
for i := range keyCount {
keyID := fmt.Sprintf("key-%d", i)
apiKeys[i] = ApiKey{
- BaseModel: database.BaseModel{ID: keyID},
+ ID: keyID,
Name: keyID,
KeyHash: "hash",
KeyPrefix: fmt.Sprintf("arc_%04d", i),
@@ -144,7 +144,7 @@ func TestListApiKeysPermissionQueryCountIsConstant(t *testing.T) {
UserID: &userID,
}
permissions[i] = role.ApiKeyPermission{
- BaseModel: database.BaseModel{ID: fmt.Sprintf("permission-%d", i)},
+ ID: fmt.Sprintf("permission-%d", i),
ApiKeyID: keyID,
Permission: authz.PermContainersList,
}
@@ -158,7 +158,7 @@ func TestListApiKeysPermissionQueryCountIsConstant(t *testing.T) {
}))
result, _, err := service.ListApiKeys(context.Background(), pagination.QueryParams{
- Params: pagination.Params{Limit: 100},
+ Limit: 100,
})
require.NoError(t, err)
require.Len(t, result, keyCount)
@@ -756,10 +756,10 @@ func TestApiKeyProtectedWhileEnvironmentReferenced(t *testing.T) {
require.NoError(t, err)
env := &testEnvironmentRow{
- BaseModel: database.BaseModel{ID: "env-referenced"},
- Name: "referenced",
- ApiUrl: "http://localhost:2375",
- ApiKeyID: &created.ID,
+ ID: "env-referenced",
+ Name: "referenced",
+ ApiUrl: "http://localhost:2375",
+ ApiKeyID: &created.ID,
}
require.NoError(t, db.WithContext(ctx).Create(env).Error)
@@ -772,7 +772,7 @@ func TestApiKeyProtectedWhileEnvironmentReferenced(t *testing.T) {
// still protect them.
legacyUserID := "legacy-owner"
legacy := &ApiKey{
- BaseModel: database.BaseModel{ID: "legacy-key"},
+ ID: "legacy-key",
Name: "Environment Bootstrap Key - legacy",
KeyHash: "hash",
KeyPrefix: "arc_lgcy",
@@ -933,11 +933,11 @@ func TestBackfillPermsForKeyDeduplicatesGlobalAndEnvironmentPermissions(t *testi
envID := "env-1"
now := time.Now()
require.NoError(t, db.WithContext(ctx).Create(&testEnvironmentRow{
- BaseModel: database.BaseModel{ID: envID, CreatedAt: now, UpdatedAt: &now},
- Name: "env-" + envID,
- ApiUrl: "http://localhost:3552",
- Status: "online",
- Enabled: true,
+ ID: envID, CreatedAt: now, UpdatedAt: &now,
+ Name: "env-" + envID,
+ ApiUrl: "http://localhost:3552",
+ Status: "online",
+ Enabled: true,
}).Error)
require.NoError(t, roleSvc.SetUserAssignments(ctx, owner.ID, []role.UserRoleAssignment{
diff --git a/backend/internal/auth/huma_middleware.go b/backend/internal/auth/huma_middleware.go
index e03d65a55..c821c6891 100644
--- a/backend/internal/auth/huma_middleware.go
+++ b/backend/internal/auth/huma_middleware.go
@@ -3,8 +3,6 @@ package auth
import (
"github.com/getarcaneapp/arcane/backend/v2/internal/environment"
- "github.com/getarcaneapp/arcane/backend/v2/internal/database"
-
"context"
"errors"
"log/slog"
@@ -146,9 +144,9 @@ func tryAgentAuthInternal(ctx huma.Context, cfg *config.Config) (*common.User, b
// bypasses every check; the user's Roles field is intentionally empty.
func createAgentSudoUserInternal() *common.User {
return &common.User{
- BaseModel: database.BaseModel{ID: "agent"},
- Email: new("[email protected]"),
- Username: "agent",
+ ID: "agent",
+ Email: new("[email protected]"),
+ Username: "agent",
}
}
@@ -173,8 +171,8 @@ func applyProxiedIconCatalogInternal(ctx huma.Context, user *common.User) {
func createEnvironmentUserInternal(env *environment.Environment) *common.User {
return &common.User{
- BaseModel: database.BaseModel{ID: "environment:" + env.ID},
- Username: env.Name,
+ ID: "environment:" + env.ID,
+ Username: env.Name,
}
}
diff --git a/backend/internal/auth/huma_middleware_test.go b/backend/internal/auth/huma_middleware_test.go
index 032315142..1d7c05a79 100644
--- a/backend/internal/auth/huma_middleware_test.go
+++ b/backend/internal/auth/huma_middleware_test.go
@@ -59,7 +59,7 @@ func TestNewHumaMiddleware_AcceptsEnvironmentAccessTokenViaAPIKey(t *testing.T)
api := humaecho.NewWithGroup(router, apiGroup, humaConfig)
api.UseMiddleware(NewHumaMiddleware(api, &AuthService{}, nil, nil, testEnvironmentAccessResolver{
env: &environment.Environment{
- BaseModel: database.BaseModel{ID: "env-self"},
+ ID: "env-self",
Name: "Self Target",
AccessToken: &token,
},
@@ -123,7 +123,7 @@ func TestNewHumaMiddleware_UsesBearerWhenLoopbackProxySendsEnvironmentAccessToke
api := humaecho.NewWithGroup(router, apiGroup, humaConfig)
api.UseMiddleware(NewHumaMiddleware(api, authSvc, nil, staticPermissionResolverInternal{ps: ps}, testEnvironmentAccessResolver{
env: &environment.Environment{
- BaseModel: database.BaseModel{ID: "remote-env"},
+ ID: "remote-env",
Name: "Remote Env",
AccessToken: &envToken,
},
@@ -270,8 +270,8 @@ func TestNewHumaMiddleware_OpportunisticAuthOnPublicRoute(t *testing.T) {
authSvc := NewAuthService(userSvc, nil, nil, sessionSvc, nil, jwtSecret, cfg, nil)
_, err := userSvc.CreateUser(context.Background(), &common.User{
- BaseModel: database.BaseModel{ID: "u-logout"},
- Username: "logouttest",
+ ID: "u-logout",
+ Username: "logouttest",
})
require.NoError(t, err)
@@ -358,8 +358,8 @@ func TestNewHumaMiddleware_VersionMismatchIsRecoverable(t *testing.T) {
authSvc := NewAuthService(userSvc, nil, nil, sessionSvc, nil, jwtSecret, cfg, nil)
_, err := userSvc.CreateUser(context.Background(), &common.User{
- BaseModel: database.BaseModel{ID: "u-ver"},
- Username: "vertest",
+ ID: "u-ver",
+ Username: "vertest",
})
require.NoError(t, err)
@@ -487,8 +487,8 @@ func mintHumaMiddlewareTestTokenInternal(t *testing.T, userSvc *user.UserService
t.Helper()
_, err := userSvc.CreateUser(context.Background(), &common.User{
- BaseModel: database.BaseModel{ID: userID},
- Username: userID,
+ ID: userID,
+ Username: userID,
})
require.NoError(t, err)
diff --git a/backend/internal/auth/middleware.go b/backend/internal/auth/middleware.go
index 3c72a112e..00a28c036 100644
--- a/backend/internal/auth/middleware.go
+++ b/backend/internal/auth/middleware.go
@@ -5,8 +5,6 @@ import (
"github.com/getarcaneapp/arcane/backend/v2/internal/apikey"
- "github.com/getarcaneapp/arcane/backend/v2/internal/database"
-
"github.com/samber/mo"
"context"
@@ -305,9 +303,9 @@ func isPreflightInternal(c *echo.Context) bool {
func agentSudoInternal(c *echo.Context) {
agentUser := &common.User{
- BaseModel: database.BaseModel{ID: "agent"},
- Email: new("[email protected]"),
- Username: "agent",
+ ID: "agent",
+ Email: new("[email protected]"),
+ Username: "agent",
}
c.Set(string(middleware.ContextKeyUserID), agentUser.ID)
c.Set(string(middleware.ContextKeyCurrentUser), agentUser)
@@ -317,8 +315,8 @@ func agentSudoInternal(c *echo.Context) {
func environmentScopedInternal(c *echo.Context, env *environment.Environment) {
envUser := &common.User{
- BaseModel: database.BaseModel{ID: "environment:" + env.ID},
- Username: env.Name,
+ ID: "environment:" + env.ID,
+ Username: env.Name,
}
c.Set(string(middleware.ContextKeyUserID), envUser.ID)
c.Set(string(middleware.ContextKeyCurrentUser), envUser)
diff --git a/backend/internal/auth/middleware_test.go b/backend/internal/auth/middleware_test.go
index af2665b88..747b064ea 100644
--- a/backend/internal/auth/middleware_test.go
+++ b/backend/internal/auth/middleware_test.go
@@ -7,8 +7,6 @@ import (
"github.com/getarcaneapp/arcane/backend/v2/internal/common"
- "github.com/getarcaneapp/arcane/backend/v2/internal/database"
-
"context"
"net/http"
"net/http/httptest"
@@ -63,7 +61,7 @@ func (testPermissionResolver) ResolveApiKeyPermissions(_ context.Context, _ stri
func TestAuthMiddleware_ManagerAuthResolvesPermissionsByKeyKind(t *testing.T) {
userID := "key-owner"
- user := &common.User{BaseModel: database.BaseModel{ID: userID}, Username: "owner"}
+ user := &common.User{ID: userID, Username: "owner"}
cases := []struct {
name string
@@ -82,7 +80,7 @@ func TestAuthMiddleware_ManagerAuthResolvesPermissionsByKeyKind(t *testing.T) {
NewAuthMiddleware(nil, &config.Config{}).
WithApiKeyValidator(testApiKeyValidator{
user: user,
- key: &apikey.ApiKey{BaseModel: database.BaseModel{ID: "key-1"}, Kind: tc.kind, UserID: &userID},
+ key: &apikey.ApiKey{ID: "key-1", Kind: tc.kind, UserID: &userID},
}).
WithPermissionResolver(testPermissionResolver{}).
Add(),
@@ -112,7 +110,7 @@ func TestAuthMiddleware_ManagerAuthAcceptsEnvironmentAccessTokenViaAPIKey(t *tes
NewAuthMiddleware(nil, &config.Config{}).
WithEnvironmentAccessTokenResolver(testEnvironmentTokenResolver{
env: &environment.Environment{
- BaseModel: database.BaseModel{ID: "env-self"},
+ ID: "env-self",
Name: "Self Target",
AccessToken: &token,
},
diff --git a/backend/internal/auth/service.go b/backend/internal/auth/service.go
index f7a0b3016..730e4ddd2 100644
--- a/backend/internal/auth/service.go
+++ b/backend/internal/auth/service.go
@@ -11,6 +11,7 @@ import (
"maps"
"strings"
"time"
+ "uuid"
"emperror.dev/emperror"
"emperror.dev/errors"
@@ -26,7 +27,6 @@ import (
"github.com/getarcaneapp/arcane/backend/v2/pkg/utils/validation"
"github.com/getarcaneapp/arcane/types/v2/auth"
"github.com/golang-jwt/jwt/v5"
- "github.com/google/uuid"
"github.com/samber/hot"
)
@@ -495,7 +495,7 @@ func (s *AuthService) createOidcUser(ctx context.Context, userInfo auth.OidcUser
}
user := &common.User{
- BaseModel: database.BaseModel{ID: uuid.NewString()},
+ ID: uuid.New().String(),
Username: username,
DisplayName: displayName,
Email: new(userInfo.Email),
@@ -946,12 +946,10 @@ func (s *AuthService) buildTokenPairInternal(ctx context.Context, user *common.U
accessTokenExpiry := time.Now().Add(time.Duration(sessionTimeout) * time.Minute)
userClaims := userClaims{
- RegisteredClaims: jwt.RegisteredClaims{
- ID: user.ID,
- Subject: "access",
- IssuedAt: jwt.NewNumericDate(time.Now()),
- ExpiresAt: jwt.NewNumericDate(accessTokenExpiry),
- },
+ ID: user.ID,
+ Subject: "access",
+ IssuedAt: jwt.NewNumericDate(time.Now()),
+ ExpiresAt: jwt.NewNumericDate(accessTokenExpiry),
SessionID: session.ID,
UserID: user.ID,
Username: user.Username,
@@ -974,12 +972,10 @@ func (s *AuthService) buildTokenPairInternal(ctx context.Context, user *common.U
}
refreshToken := jwt.NewWithClaims(jwt.SigningMethodHS256, refreshClaims{
- RegisteredClaims: jwt.RegisteredClaims{
- ID: refreshJTI,
- Subject: "refresh",
- IssuedAt: jwt.NewNumericDate(time.Now()),
- ExpiresAt: jwt.NewNumericDate(session.ExpiresAt),
- },
+ ID: refreshJTI,
+ Subject: "refresh",
+ IssuedAt: jwt.NewNumericDate(time.Now()),
+ ExpiresAt: jwt.NewNumericDate(session.ExpiresAt),
UserID: user.ID,
SessionID: session.ID,
AppVersion: config.Version,
@@ -1015,12 +1011,10 @@ func (s *AuthService) IssueFederatedToken(ctx context.Context, user *common.User
}
claims := userClaims{
- RegisteredClaims: jwt.RegisteredClaims{
- ID: user.ID,
- Subject: "access",
- IssuedAt: jwt.NewNumericDate(now),
- ExpiresAt: jwt.NewNumericDate(accessTokenExpiry),
- },
+ ID: user.ID,
+ Subject: "access",
+ IssuedAt: jwt.NewNumericDate(now),
+ ExpiresAt: jwt.NewNumericDate(accessTokenExpiry),
SessionID: federatedSession.ID,
UserID: user.ID,
Username: user.Username,
diff --git a/backend/internal/auth/service_test.go b/backend/internal/auth/service_test.go
index fd1522f7f..839ed5731 100644
--- a/backend/internal/auth/service_test.go
+++ b/backend/internal/auth/service_test.go
@@ -106,12 +106,10 @@ func makeAccessToken(t *testing.T, secret []byte, subject string, id string, use
sessionID = sessionIDs[0]
}
claims := userClaims{
- RegisteredClaims: jwt.RegisteredClaims{
- ID: id,
- Subject: subject,
- IssuedAt: jwt.NewNumericDate(time.Now()),
- ExpiresAt: jwt.NewNumericDate(exp),
- },
+ ID: id,
+ Subject: subject,
+ IssuedAt: jwt.NewNumericDate(time.Now()),
+ ExpiresAt: jwt.NewNumericDate(exp),
SessionID: sessionID,
UserID: id,
Username: username,
@@ -139,12 +137,10 @@ func makeRefreshToken(t *testing.T, secret []byte, subject string, id string, ex
sessionID = userIDAndSessionID[1]
}
claims := refreshClaims{
- RegisteredClaims: jwt.RegisteredClaims{
- ID: id,
- Subject: subject,
- IssuedAt: jwt.NewNumericDate(time.Now()),
- ExpiresAt: jwt.NewNumericDate(exp),
- },
+ ID: id,
+ Subject: subject,
+ IssuedAt: jwt.NewNumericDate(time.Now()),
+ ExpiresAt: jwt.NewNumericDate(exp),
UserID: userID,
SessionID: sessionID,
AppVersion: config.Version,
@@ -189,7 +185,7 @@ func TestVerifyToken_ValidClaims(t *testing.T) {
// Create user in DB
user := &common.User{
- BaseModel: database.BaseModel{ID: "u123"},
+ ID: "u123",
Username: "alice",
Email: new("[email protected]"),
DisplayName: new("Alice"),
@@ -224,12 +220,10 @@ func TestVerifyToken_RejectsNonHMACAlg(t *testing.T) {
s := newTestAuthService("")
exp := time.Now().Add(5 * time.Minute)
token := makeUnsignedToken(t, userClaims{
- RegisteredClaims: jwt.RegisteredClaims{
- ID: "u1",
- Subject: "access",
- IssuedAt: jwt.NewNumericDate(time.Now()),
- ExpiresAt: jwt.NewNumericDate(exp),
- },
+ ID: "u1",
+ Subject: "access",
+ IssuedAt: jwt.NewNumericDate(time.Now()),
+ ExpiresAt: jwt.NewNumericDate(exp),
UserID: "u1",
Username: "bob",
AppVersion: config.Version,
@@ -251,8 +245,8 @@ func TestVerifyToken_Expired(t *testing.T) {
// Create user in DB
user := &common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "bob",
+ ID: "u1",
+ Username: "bob",
}
_, err := userSvc.CreateUser(context.Background(), user)
require.NoError(t, err)
@@ -380,8 +374,8 @@ func TestRefreshToken_Valid(t *testing.T) {
s.sessionService = session.NewSessionService(db)
user := &common.User{
- BaseModel: database.BaseModel{ID: "u-refresh"},
- Username: "refresh-user",
+ ID: "u-refresh",
+ Username: "refresh-user",
}
_, err = userSvc.CreateUser(context.Background(), user)
require.NoError(t, err)
@@ -411,8 +405,8 @@ func TestRefreshToken_VersionMismatchRotates(t *testing.T) {
s.sessionService = session.NewSessionService(db)
user := &common.User{
- BaseModel: database.BaseModel{ID: "u-versionmismatch"},
- Username: "versionmismatch-user",
+ ID: "u-versionmismatch",
+ Username: "versionmismatch-user",
}
_, err = userSvc.CreateUser(context.Background(), user)
require.NoError(t, err)
@@ -457,8 +451,8 @@ func TestVerifyToken_RejectsRevokedSession(t *testing.T) {
s.sessionService = session.NewSessionService(db)
user := &common.User{
- BaseModel: database.BaseModel{ID: "u-revoked"},
- Username: "revoked-user",
+ ID: "u-revoked",
+ Username: "revoked-user",
}
_, err := userSvc.CreateUser(context.Background(), user)
require.NoError(t, err)
@@ -480,8 +474,8 @@ func TestVerifyToken_RejectsMissingSessionID(t *testing.T) {
s.sessionService = session.NewSessionService(db)
user := &common.User{
- BaseModel: database.BaseModel{ID: "u-no-sid"},
- Username: "no-sid-user",
+ ID: "u-no-sid",
+ Username: "no-sid-user",
}
_, err := userSvc.CreateUser(context.Background(), user)
require.NoError(t, err)
@@ -500,8 +494,8 @@ func TestRevokeSessionThenVerifyTokenFails(t *testing.T) {
s.sessionService = session.NewSessionService(db)
user := &common.User{
- BaseModel: database.BaseModel{ID: "u-logout"},
- Username: "logout-user",
+ ID: "u-logout",
+ Username: "logout-user",
}
_, err := userSvc.CreateUser(context.Background(), user)
require.NoError(t, err)
@@ -523,8 +517,8 @@ func TestVerifyToken_RejectsRevokedCachedSession(t *testing.T) {
s.sessionService = session.NewSessionService(db)
user := &common.User{
- BaseModel: database.BaseModel{ID: "u-cached-revoked"},
- Username: "cached-revoked-user",
+ ID: "u-cached-revoked",
+ Username: "cached-revoked-user",
}
_, err := userSvc.CreateUser(context.Background(), user)
require.NoError(t, err)
@@ -552,8 +546,8 @@ func TestRefreshToken_RotatesJTI(t *testing.T) {
s.sessionService = session.NewSessionService(db)
user := &common.User{
- BaseModel: database.BaseModel{ID: "u-rotate"},
- Username: "rotate-user",
+ ID: "u-rotate",
+ Username: "rotate-user",
}
_, err = userSvc.CreateUser(context.Background(), user)
require.NoError(t, err)
@@ -581,8 +575,8 @@ func TestRefreshToken_RejectsRevokedSession(t *testing.T) {
s.sessionService = session.NewSessionService(db)
user := &common.User{
- BaseModel: database.BaseModel{ID: "u-refresh-revoked"},
- Username: "refresh-revoked-user",
+ ID: "u-refresh-revoked",
+ Username: "refresh-revoked-user",
}
_, err = userSvc.CreateUser(context.Background(), user)
require.NoError(t, err)
@@ -606,7 +600,7 @@ func TestChangePassword_RevokesAllSessions(t *testing.T) {
passwordHash, err := userSvc.HashPassword("old-password")
require.NoError(t, err)
user := &common.User{
- BaseModel: database.BaseModel{ID: "u-password"},
+ ID: "u-password",
Username: "password-user",
PasswordHash: passwordHash,
}
@@ -636,7 +630,7 @@ func TestChangePassword_KeepsCurrentSessionAlive(t *testing.T) {
passwordHash, err := userSvc.HashPassword("old-password")
require.NoError(t, err)
user := &common.User{
- BaseModel: database.BaseModel{ID: "u-keep"},
+ ID: "u-keep",
Username: "keep-user",
PasswordHash: passwordHash,
}
@@ -785,9 +779,9 @@ func TestFindOrCreateOidcUser_MergeEnabled_EmailNotVerified_WithExistingUser_Ret
// Seed an existing local user with matching email
email := "[email protected]"
existing := &common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "existing",
- Email: &email,
+ ID: "u1",
+ Username: "existing",
+ Email: &email,
}
_, err = userSvc.CreateUser(ctx, existing)
require.NoError(t, err)
@@ -827,9 +821,9 @@ func TestFindOrCreateOidcUser_MergeEnabled_EmailVerificationMissing_WithExisting
// Seed an existing local user with matching email
email := "[email protected]"
existing := &common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "existing",
- Email: &email,
+ ID: "u1",
+ Username: "existing",
+ Email: &email,
}
_, err = userSvc.CreateUser(ctx, existing)
require.NoError(t, err)
@@ -872,12 +866,12 @@ func TestAuthenticateLocalPrimary_EmailFallback(t *testing.T) {
dupHash, err := userSvc.HashPassword("dup-two-pass!")
require.NoError(t, err)
for _, u := range []*common.User{
- {BaseModel: database.BaseModel{ID: "u-email-login"}, Username: "bob", Email: new("[email protected]"), PasswordHash: hash},
- {BaseModel: database.BaseModel{ID: "u-dup-1"}, Username: "dup1", Email: new("[email protected]"), PasswordHash: hash},
- {BaseModel: database.BaseModel{ID: "u-dup-2"}, Username: "dup2", Email: new("[email protected]"), PasswordHash: dupHash},
- {BaseModel: database.BaseModel{ID: "u-carol"}, Username: "[email protected]", Email: new("[email protected]"), PasswordHash: hash},
- {BaseModel: database.BaseModel{ID: "u-col-a"}, Username: "[email protected]", PasswordHash: hash},
- {BaseModel: database.BaseModel{ID: "u-col-b"}, Username: "colb", Email: new("[email protected]"), PasswordHash: dupHash},
+ {ID: "u-email-login", Username: "bob", Email: new("[email protected]"), PasswordHash: hash},
+ {ID: "u-dup-1", Username: "dup1", Email: new("[email protected]"), PasswordHash: hash},
+ {ID: "u-dup-2", Username: "dup2", Email: new("[email protected]"), PasswordHash: dupHash},
+ {ID: "u-carol", Username: "[email protected]", Email: new("[email protected]"), PasswordHash: hash},
+ {ID: "u-col-a", Username: "[email protected]", PasswordHash: hash},
+ {ID: "u-col-b", Username: "colb", Email: new("[email protected]"), PasswordHash: dupHash},
} {
_, err = userSvc.CreateUser(context.Background(), u)
require.NoError(t, err)
diff --git a/backend/internal/bootstrap/jobs_bootstrap_test.go b/backend/internal/bootstrap/jobs_bootstrap_test.go
index 1539fef99..cd1bea98e 100644
--- a/backend/internal/bootstrap/jobs_bootstrap_test.go
+++ b/backend/internal/bootstrap/jobs_bootstrap_test.go
@@ -3,8 +3,6 @@ package bootstrap
import (
"github.com/getarcaneapp/arcane/backend/v2/internal/environment"
- "github.com/getarcaneapp/arcane/backend/v2/internal/database"
-
"context"
"slices"
"testing"
@@ -52,8 +50,8 @@ type timeoutSyncEnvironmentStubInternal struct {
func (s *timeoutSyncEnvironmentStubInternal) ListRemoteEnvironments(context.Context) ([]environment.Environment, error) {
return []environment.Environment{{
- BaseModel: database.BaseModel{ID: "remote"},
- Name: "remote",
+ ID: "remote",
+ Name: "remote",
}}, nil
}
diff --git a/backend/internal/bootstrap/router_bootstrap.go b/backend/internal/bootstrap/router_bootstrap.go
index 1bc82c94d..ffa2fbee0 100644
--- a/backend/internal/bootstrap/router_bootstrap.go
+++ b/backend/internal/bootstrap/router_bootstrap.go
@@ -307,6 +307,7 @@ func newRouter(p RouterParams) (*echo.Echo, *edge.TunnelServer) {
apiGroup.RouteNotFound("", apiNotFound)
apiGroup.RouteNotFound("/*", apiNotFound)
+ //nolint:staticcheck,nolintlint // SA4023 only under exclude_frontend: the stub always returns ErrFrontendNotIncluded
if err := frontend.RegisterFrontend(e); err != nil {
if errors.Is(err, frontend.ErrFrontendNotIncluded) {
slog.Debug("Frontend not included in this build; skipping frontend registration")
diff --git a/backend/internal/bootstrap/server_bootstrap.go b/backend/internal/bootstrap/server_bootstrap.go
index 9321886f1..ea364570c 100644
--- a/backend/internal/bootstrap/server_bootstrap.go
+++ b/backend/internal/bootstrap/server_bootstrap.go
@@ -248,9 +248,7 @@ func normalizeTunnelGRPCRequestPathInternal(r *http.Request) *http.Request {
const tunnelConnectPath = "/api/tunnel/connect"
if strings.HasSuffix(r.URL.Path, tunnelConnectPath) {
clone := r.Clone(r.Context())
- cloneURL := *clone.URL
- cloneURL.Path = connectMethodPath
- clone.URL = &cloneURL
+ clone.URL.Path = connectMethodPath
clone.RequestURI = connectMethodPath
return clone
}
@@ -266,9 +264,7 @@ func normalizeTunnelGRPCRequestPathInternal(r *http.Request) *http.Request {
}
clone := r.Clone(r.Context())
- cloneURL := *clone.URL
- cloneURL.Path = normalizedPath
- clone.URL = &cloneURL
+ clone.URL.Path = normalizedPath
clone.RequestURI = normalizedPath
return clone
}
diff --git a/backend/internal/build/service.go b/backend/internal/build/service.go
index e8a63dc49..7bfb243ed 100644
--- a/backend/internal/build/service.go
+++ b/backend/internal/build/service.go
@@ -489,9 +489,7 @@ func (s *BuildService) createBuildRecord(ctx context.Context, environmentID stri
ExtraHosts: database.StringSlice(req.ExtraHosts),
Push: req.Push,
Load: req.Load,
- BaseModel: database.BaseModel{
- CreatedAt: time.Now(),
- },
+ CreatedAt: time.Now(),
}
if err := s.db.WithContext(ctx).Create(record).Error; err != nil {
diff --git a/backend/internal/build/service_test.go b/backend/internal/build/service_test.go
index 19ab58614..dc7e4914e 100644
--- a/backend/internal/build/service_test.go
+++ b/backend/internal/build/service_test.go
@@ -309,8 +309,8 @@ func TestBuildService_BuildImage_FailureRecordsHistoryAndEvent(t *testing.T) {
},
}
user := &common.User{
- BaseModel: database.BaseModel{ID: "user-1"},
- Username: "tester",
+ ID: "user-1",
+ Username: "tester",
}
req := buildtypes.BuildRequest{
@@ -365,8 +365,8 @@ func TestBuildService_BuildImage_FailureExporterErrorsAppearInOutputHistoryAndEv
}
user := &common.User{
- BaseModel: database.BaseModel{ID: "user-2"},
- Username: "registry-test",
+ ID: "user-2",
+ Username: "registry-test",
}
req := buildtypes.BuildRequest{
@@ -447,7 +447,7 @@ func TestBuildService_ListImageBuilds_OmitsOutputColumn(t *testing.T) {
output := "large build output"
require.NoError(t, db.WithContext(context.Background()).Create(&ImageBuild{
- BaseModel: database.BaseModel{ID: "build-omit-output"},
+ ID: "build-omit-output",
EnvironmentID: "0",
Status: ImageBuildStatusSuccess,
ContextDir: "/ctx",
@@ -455,7 +455,7 @@ func TestBuildService_ListImageBuilds_OmitsOutputColumn(t *testing.T) {
}).Error)
records, _, err := svc.ListImageBuildsByEnvironmentPaginated(context.Background(), "0", pagination.QueryParams{
- Params: pagination.Params{Limit: 10},
+ Limit: 10,
})
require.NoError(t, err)
require.Len(t, records, 1)
diff --git a/backend/internal/container/service_test.go b/backend/internal/container/service_test.go
index 888dabcb3..ba15bd75e 100644
--- a/backend/internal/container/service_test.go
+++ b/backend/internal/container/service_test.go
@@ -60,7 +60,7 @@ func TestPaginateContainerProjectGroupsKeepsProjectWhole(t *testing.T) {
groupedItems, resp := paginateContainerProjectGroupsInternal(
pagination.FilterResult[containertypes.Summary]{Items: items, TotalCount: int64(len(items)), TotalAvailable: int64(len(items))},
- pagination.QueryParams{Params: pagination.Params{Start: 0, Limit: 20}},
+ pagination.QueryParams{Start: 0, Limit: 20},
)
require.Len(t, groupedItems, 19)
@@ -97,14 +97,14 @@ func TestPaginateContainerProjectGroupsSelectsRequestedPage(t *testing.T) {
}
result := pagination.FilterResult[containertypes.Summary]{Items: items, TotalCount: int64(len(items)), TotalAvailable: int64(len(items))}
- pageGroups, resp := paginateContainerProjectGroupsInternal(result, pagination.QueryParams{Params: pagination.Params{Start: 4, Limit: 4}})
+ pageGroups, resp := paginateContainerProjectGroupsInternal(result, pagination.QueryParams{Start: 4, Limit: 4})
require.Equal(t, []string{"proj-b", "solo-1"}, groupNamesOf(pageGroups))
require.Equal(t, 2, resp.CurrentPage)
require.Equal(t, int64(3), resp.TotalPages)
require.Equal(t, int64(11), resp.TotalItems)
- pageGroups, resp = paginateContainerProjectGroupsInternal(result, pagination.QueryParams{Params: pagination.Params{Start: 400, Limit: 4}})
+ pageGroups, resp = paginateContainerProjectGroupsInternal(result, pagination.QueryParams{Start: 400, Limit: 4})
require.Equal(t, []string{"proj-c", "solo-2"}, groupNamesOf(pageGroups))
require.Equal(t, 3, resp.CurrentPage)
@@ -130,7 +130,7 @@ func TestContainerSummaryIconsAppliedAfterGrouping(t *testing.T) {
groups, _ := paginateContainerProjectGroupsInternal(
pagination.FilterResult[containertypes.Summary]{Items: items, TotalCount: int64(len(items)), TotalAvailable: int64(len(items))},
- pagination.QueryParams{Params: pagination.Params{Start: 0, Limit: 20}},
+ pagination.QueryParams{Start: 0, Limit: 20},
)
for gi := range groups {
service.ApplySummaryIcons(t.Context(), groups[gi].Items, map[string]projects.ArcaneComposeMetadata{})
diff --git a/backend/internal/dashboard/service_test.go b/backend/internal/dashboard/service_test.go
index 276aec814..7e287a48b 100644
--- a/backend/internal/dashboard/service_test.go
+++ b/backend/internal/dashboard/service_test.go
@@ -184,11 +184,11 @@ func TestDashboardService_GetSnapshot_ReturnsDashboardSnapshot(t *testing.T) {
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "compose.yaml"), []byte("services:\n app:\n image: repo/worker:latest\n"), 0o644))
dirName := "project-with-update"
require.NoError(t, db.WithContext(context.Background()).Create(&project.Project{
- BaseModel: database.BaseModel{ID: "project-with-update"},
- Name: "project-with-update",
- DirName: &dirName,
- Path: projectPath,
- Status: project.ProjectStatusStopped,
+ ID: "project-with-update",
+ Name: "project-with-update",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: project.ProjectStatusStopped,
}).Error)
projectSvc := project.NewProjectService(db, settingsSvc, nil, image.NewImageService(db, nil, nil, nil, nil, nil), nil, nil, nil, nil, config.Load())
svc := NewDashboardService(db, dockerSvc, nil, projectSvc, nil, settingsSvc, nil, nil, nil, volume.NewVolumeService(db, nil, nil, nil, nil, nil))
@@ -277,11 +277,9 @@ func createTestRemoteEnvironmentInternal(t *testing.T, db *database.DB, environm
t.Helper()
now := time.Now()
require.NoError(t, db.Create(&environment.Environment{
- BaseModel: database.BaseModel{
- ID: environmentID,
- CreatedAt: now,
- UpdatedAt: &now,
- },
+ ID: environmentID,
+ CreatedAt: now,
+ UpdatedAt: &now,
Name: name,
ApiUrl: apiURL,
Status: string(environment.EnvironmentStatusOnline),
diff --git a/backend/internal/database/model.go b/backend/internal/database/model.go
index 3b7751a0f..da9ec53a3 100644
--- a/backend/internal/database/model.go
+++ b/backend/internal/database/model.go
@@ -4,8 +4,8 @@ import (
"database/sql/driver"
"encoding/json/v2"
"time"
+ "uuid"
- "github.com/google/uuid"
"gorm.io/gorm"
)
diff --git a/backend/internal/diagnostics/service.go b/backend/internal/diagnostics/service.go
index 496b6b461..3eb44e506 100644
--- a/backend/internal/diagnostics/service.go
+++ b/backend/internal/diagnostics/service.go
@@ -1,22 +1,33 @@
package diagnostics
import (
+ "bytes"
"runtime"
"runtime/debug"
+ "runtime/pprof"
+ "sync"
"time"
+ "emperror.dev/errors"
"github.com/getarcaneapp/arcane/types/v2/system"
)
// recentGCPauseSamples is the number of recent GC pause durations reported.
const recentGCPauseSamples = 16
+// goroutineLeakProfileName is the runtime/pprof profile that reports goroutines
+// blocked on concurrency primitives that cannot be unblocked.
+const goroutineLeakProfileName = "goroutineleak"
+
// DiagnosticsService gathers Go runtime, memory, and garbage-collector
// statistics for the diagnostics endpoints. It holds no external dependencies;
// WebSocket metrics and worker-goroutine counts are merged in at the handler
// layer to avoid an import cycle with the api/ws package.
type DiagnosticsService struct {
startedAt time.Time
+
+ leakMu sync.Mutex
+ leakScannedAt time.Time
}
// NewDiagnosticsService returns a DiagnosticsService. startedAt is captured at
@@ -26,6 +37,9 @@ func NewDiagnosticsService() *DiagnosticsService {
}
// Collect samples the current runtime, memory, and GC state.
+//
+// LeakedGoroutines is the last-known leak count from the runtime; it does not
+// trigger a leak-detection GC. Use ScanGoroutineLeaks for a fresh scan.
func (s *DiagnosticsService) Collect() (system.RuntimeInfo, system.MemoryInfo, system.GCInfo) {
var mem runtime.MemStats
runtime.ReadMemStats(&mem)
@@ -33,15 +47,21 @@ func (s *DiagnosticsService) Collect() (system.RuntimeInfo, system.MemoryInfo, s
var gc debug.GCStats
debug.ReadGCStats(&gc)
+ s.leakMu.Lock()
+ leakScannedAt := s.leakScannedAt
+ s.leakMu.Unlock()
+
rt := system.RuntimeInfo{
- Goroutines: runtime.NumGoroutine(),
- GOMAXPROCS: runtime.GOMAXPROCS(0),
- NumCPU: runtime.NumCPU(),
- GoVersion: runtime.Version(),
- OS: runtime.GOOS,
- Arch: runtime.GOARCH,
- NumCgoCall: runtime.NumCgoCall(),
- UptimeSeconds: int64(time.Since(s.startedAt).Seconds()),
+ Goroutines: runtime.NumGoroutine(),
+ LeakedGoroutines: leakedGoroutineCountInternal(),
+ LeakScannedAt: leakScannedAt,
+ GOMAXPROCS: runtime.GOMAXPROCS(0),
+ NumCPU: runtime.NumCPU(),
+ GoVersion: runtime.Version(),
+ OS: runtime.GOOS,
+ Arch: runtime.GOARCH,
+ NumCgoCall: runtime.NumCgoCall(),
+ UptimeSeconds: int64(time.Since(s.startedAt).Seconds()),
}
mi := system.MemoryInfo{
@@ -83,3 +103,38 @@ func (s *DiagnosticsService) Collect() (system.RuntimeInfo, system.MemoryInfo, s
return rt, mi, gi
}
+
+// ScanGoroutineLeaks runs a leak-detection GC and returns the leaked-goroutine
+// pprof text (debug=1). debug=2 would dump every goroutine, not only leaks.
+func (s *DiagnosticsService) ScanGoroutineLeaks() (system.GoroutineLeakReport, error) {
+ p := pprof.Lookup(goroutineLeakProfileName)
+ if p == nil {
+ return system.GoroutineLeakReport{}, errors.New("goroutineleak profile is not available")
+ }
+
+ var buf bytes.Buffer
+ if err := p.WriteTo(&buf, 1); err != nil {
+ return system.GoroutineLeakReport{}, errors.WrapIf(err, "write goroutineleak profile")
+ }
+
+ now := time.Now().UTC()
+ s.leakMu.Lock()
+ s.leakScannedAt = now
+ s.leakMu.Unlock()
+
+ return system.GoroutineLeakReport{
+ Count: p.Count(),
+ Profile: buf.String(),
+ ScannedAt: now,
+ }, nil
+}
+
+// leakedGoroutineCountInternal returns the last-known leak count without
+// triggering a leak-detection GC.
+func leakedGoroutineCountInternal() int {
+ p := pprof.Lookup(goroutineLeakProfileName)
+ if p == nil {
+ return 0
+ }
+ return p.Count()
+}
diff --git a/backend/internal/diagnostics/service_test.go b/backend/internal/diagnostics/service_test.go
index accd21a5c..4fceabdf6 100644
--- a/backend/internal/diagnostics/service_test.go
+++ b/backend/internal/diagnostics/service_test.go
@@ -1,9 +1,14 @@
package diagnostics
import (
+ "runtime"
+ "runtime/pprof"
+ "strings"
"testing"
+ "time"
"github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
)
func TestDiagnosticsServiceCollect(t *testing.T) {
@@ -27,4 +32,66 @@ func TestDiagnosticsServiceCollect(t *testing.T) {
assert.NotEqual(t, 0, mem.Sys,
"expected non-zero Sys memory")
+ assert.GreaterOrEqual(t, rt.LeakedGoroutines, 0)
+ assert.True(t, rt.LeakScannedAt.IsZero(),
+ "expected no leak scan before ScanGoroutineLeaks")
+}
+
+func TestGoroutineLeakProfileAvailable(t *testing.T) {
+ assert.NotNil(t, pprof.Lookup(goroutineLeakProfileName),
+ "goroutineleak pprof profile must be registered")
+}
+
+func TestDiagnosticsServiceScanGoroutineLeaks(t *testing.T) {
+ s := NewDiagnosticsService()
+
+ report, err := s.ScanGoroutineLeaks()
+ require.NoError(t, err)
+ assert.GreaterOrEqual(t, report.Count, 0)
+ assert.False(t, report.ScannedAt.IsZero())
+ assert.Contains(t, report.Profile, "goroutineleak profile")
+
+ rt, _, _ := s.Collect()
+ assert.Equal(t, report.Count, rt.LeakedGoroutines)
+ assert.False(t, rt.LeakScannedAt.IsZero())
+ assert.True(t, rt.LeakScannedAt.Equal(report.ScannedAt))
+}
+
+func TestDiagnosticsServiceScanGoroutineLeaksDetectsLeak(t *testing.T) {
+ s := NewDiagnosticsService()
+ leakUnbufferedChannelInternal()
+
+ deadline := time.Now().Add(5 * time.Second)
+ var reportCount int
+ var reportProfile string
+ for {
+ report, err := s.ScanGoroutineLeaks()
+ require.NoError(t, err)
+ reportCount = report.Count
+ reportProfile = report.Profile
+ if report.Count >= 1 && strings.Contains(report.Profile, "blockForeverOnDroppedChannelInternal") {
+ return
+ }
+ if time.Now().After(deadline) {
+ break
+ }
+ time.Sleep(20 * time.Millisecond)
+ }
+
+ t.Fatalf("expected a leaked goroutine in the goroutineleak profile, count=%d profile=%s",
+ reportCount, reportProfile)
+}
+
+// leakUnbufferedChannelInternal starts a goroutine blocked on a channel that
+// becomes unreachable, which the runtime classifies as a leak.
+func leakUnbufferedChannelInternal() {
+ go blockForeverOnDroppedChannelInternal()
+ for range 10 {
+ runtime.Gosched()
+ }
+}
+
+//go:noinline
+func blockForeverOnDroppedChannelInternal() {
+ <-make(chan struct{})
}
diff --git a/backend/internal/environment/environment.go b/backend/internal/environment/environment.go
index 0bbbb546c..1232189d2 100644
--- a/backend/internal/environment/environment.go
+++ b/backend/internal/environment/environment.go
@@ -9,6 +9,7 @@ import (
"net/http"
"strings"
"time"
+ "uuid"
"emperror.dev/errors"
@@ -22,7 +23,6 @@ import (
httputils "github.com/getarcaneapp/arcane/backend/v2/pkg/utils/httpx"
"github.com/getarcaneapp/arcane/backend/v2/pkg/utils/validation"
"github.com/getarcaneapp/arcane/types/v2/containerregistry"
- "github.com/google/uuid"
"go.getarcane.app/sys/crypto"
"gorm.io/gorm"
)
@@ -191,15 +191,13 @@ func (s *EnvironmentService) EnsureLocalEnvironment(ctx context.Context, appUrl
// Create the local environment
now := time.Now()
localEnv := &Environment{
- BaseModel: database.BaseModel{
- ID: LocalEnvironmentID,
- CreatedAt: now,
- UpdatedAt: new(now),
- },
- Name: "Local Docker",
- ApiUrl: appUrl,
- Status: string(EnvironmentStatusOnline),
- Enabled: true,
+ ID: LocalEnvironmentID,
+ CreatedAt: now,
+ UpdatedAt: new(now),
+ Name: "Local Docker",
+ ApiUrl: appUrl,
+ Status: string(EnvironmentStatusOnline),
+ Enabled: true,
}
if err := s.db.WithContext(ctx).Create(localEnv).Error; err != nil {
diff --git a/backend/internal/environment/service_test.go b/backend/internal/environment/service_test.go
index 31fdf95c5..6a522ec66 100644
--- a/backend/internal/environment/service_test.go
+++ b/backend/internal/environment/service_test.go
@@ -161,8 +161,8 @@ func createTestEnvironmentServiceUser(t *testing.T, ctx context.Context, userSer
t.Helper()
user := &common.User{
- BaseModel: database.BaseModel{ID: id},
- Username: fmt.Sprintf("user-%s", id),
+ ID: id,
+ Username: fmt.Sprintf("user-%s", id),
}
created, err := userService.CreateUser(ctx, user)
@@ -180,11 +180,9 @@ func createNamedTestEnvironmentInternal(t *testing.T, db *database.DB, id, name,
now := time.Now()
env := &Environment{
- BaseModel: database.BaseModel{
- ID: id,
- CreatedAt: now,
- UpdatedAt: &now,
- },
+ ID: id,
+ CreatedAt: now,
+ UpdatedAt: &now,
Name: name,
ApiUrl: apiURL,
Status: string(EnvironmentStatusOnline),
@@ -200,11 +198,9 @@ func createTestEnvironmentWithState(t *testing.T, db *database.DB, id, apiURL, s
now := time.Now()
env := &Environment{
- BaseModel: database.BaseModel{
- ID: id,
- CreatedAt: now,
- UpdatedAt: &now,
- },
+ ID: id,
+ CreatedAt: now,
+ UpdatedAt: &now,
Name: "env-" + id,
ApiUrl: apiURL,
Status: status,
@@ -224,7 +220,7 @@ func TestEnvironmentService_DeleteEnvironment_CascadesGitOpsSyncs(t *testing.T)
createTestEnvironment(t, db, "env-delete-gitops", "http://env.example", nil)
syncID := "sync-delete-env"
require.NoError(t, db.Create(&testGitOpsSyncRow{
- BaseModel: database.BaseModel{ID: syncID},
+ ID: syncID,
Name: "delete-env-sync",
EnvironmentID: "env-delete-gitops",
RepositoryID: "repo-1",
@@ -233,7 +229,7 @@ func TestEnvironmentService_DeleteEnvironment_CascadesGitOpsSyncs(t *testing.T)
SyncInterval: 15,
}).Error)
require.NoError(t, db.Create(&testProjectRow{
- BaseModel: database.BaseModel{ID: "project-managed-by-deleted-env"},
+ ID: "project-managed-by-deleted-env",
Name: "demo",
Path: "/tmp/demo",
Status: "stopped",
@@ -461,7 +457,7 @@ func TestEnvironmentService_SyncRepositoriesToEnvironment_UsesAgentHeaders(t *te
svc := NewEnvironmentService(db, nil, nil, nil, nil, nil)
createTestGitRepository(t, db, gitrepo.GitRepository{
- BaseModel: database.BaseModel{ID: "repo-1", CreatedAt: time.Now()},
+ ID: "repo-1", CreatedAt: time.Now(),
Name: "repo-1",
URL: "https://github.com/getarcaneapp/arcane.git",
AuthType: "http",
@@ -911,7 +907,7 @@ func TestEnvironmentService_EnsureSwarmNodeAgentEnvironment_ReusesLegacyHiddenRe
nodeID := "legacy-node"
token := "legacy-agent-token"
legacy := &Environment{
- BaseModel: database.BaseModel{ID: "legacy-agent"},
+ ID: "legacy-agent",
Name: "Legacy node agent",
ApiUrl: "edge://legacy-node",
Status: string(EnvironmentStatusOffline),
@@ -1084,7 +1080,7 @@ func TestEnvironmentService_ListMethods_ExcludeHiddenEnvironments(t *testing.T)
}).Error)
listedEnvironments, _, err := svc.ListEnvironmentsPaginated(ctx, pagination.QueryParams{
- Params: pagination.Params{Start: 0, Limit: 20},
+ Start: 0, Limit: 20,
Filters: map[string]string{},
}, nil)
require.NoError(t, err)
@@ -1114,7 +1110,7 @@ func TestEnvironmentService_ListEnvironmentsPaginated_FiltersByAccessibleEnvIDs(
filters["type"] = typeFilter
}
return pagination.QueryParams{
- Params: pagination.Params{Start: 0, Limit: 20},
+ Start: 0, Limit: 20,
Filters: filters,
}
}
@@ -1152,46 +1148,46 @@ func TestEnvironmentService_ListEnvironmentsPaginated_FiltersByRuntimeType(t *te
now := time.Now()
envs := []Environment{
{
- BaseModel: database.BaseModel{ID: "0", CreatedAt: now, UpdatedAt: &now},
- Name: "Local",
- ApiUrl: "http://localhost:3552",
- Status: string(EnvironmentStatusOnline),
- Enabled: true,
+ ID: "0", CreatedAt: now, UpdatedAt: &now,
+ Name: "Local",
+ ApiUrl: "http://localhost:3552",
+ Status: string(EnvironmentStatusOnline),
+ Enabled: true,
},
{
- BaseModel: database.BaseModel{ID: "env-edge", CreatedAt: now, UpdatedAt: &now},
- Name: "Edge",
- ApiUrl: "edge://agent",
- Status: string(EnvironmentStatusOffline),
- Enabled: true,
- IsEdge: true,
+ ID: "env-edge", CreatedAt: now, UpdatedAt: &now,
+ Name: "Edge",
+ ApiUrl: "edge://agent",
+ Status: string(EnvironmentStatusOffline),
+ Enabled: true,
+ IsEdge: true,
},
{
- BaseModel: database.BaseModel{ID: "env-grpc", CreatedAt: now, UpdatedAt: &now},
- Name: "gRPC",
- ApiUrl: "edge://grpc",
- Status: string(EnvironmentStatusOffline),
- Enabled: true,
- IsEdge: true,
+ ID: "env-grpc", CreatedAt: now, UpdatedAt: &now,
+ Name: "gRPC",
+ ApiUrl: "edge://grpc",
+ Status: string(EnvironmentStatusOffline),
+ Enabled: true,
+ IsEdge: true,
},
{
- BaseModel: database.BaseModel{ID: "env-websocket", CreatedAt: now, UpdatedAt: &now},
- Name: "WebSocket",
- ApiUrl: "edge://websocket",
- Status: string(EnvironmentStatusOffline),
- Enabled: true,
- IsEdge: true,
+ ID: "env-websocket", CreatedAt: now, UpdatedAt: &now,
+ Name: "WebSocket",
+ ApiUrl: "edge://websocket",
+ Status: string(EnvironmentStatusOffline),
+ Enabled: true,
+ IsEdge: true,
},
{
- BaseModel: database.BaseModel{ID: "env-polling", CreatedAt: now, UpdatedAt: &now},
- Name: "Polling",
- ApiUrl: "edge://polling",
- Status: string(EnvironmentStatusOffline),
- Enabled: true,
- IsEdge: true,
+ ID: "env-polling", CreatedAt: now, UpdatedAt: &now,
+ Name: "Polling",
+ ApiUrl: "edge://polling",
+ Status: string(EnvironmentStatusOffline),
+ Enabled: true,
+ IsEdge: true,
},
{
- BaseModel: database.BaseModel{ID: "env-last-ws", CreatedAt: now, UpdatedAt: &now},
+ ID: "env-last-ws", CreatedAt: now, UpdatedAt: &now,
Name: "LastWebsocket",
ApiUrl: "edge://last-ws",
Status: string(EnvironmentStatusOffline),
@@ -1237,7 +1233,7 @@ func TestEnvironmentService_ListEnvironmentsPaginated_FiltersByRuntimeType(t *te
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
listedEnvironments, _, err := svc.ListEnvironmentsPaginated(ctx, pagination.QueryParams{
- Params: pagination.Params{Start: 0, Limit: 20},
+ Start: 0, Limit: 20,
Filters: map[string]string{"type": tt.typeFilter},
}, nil)
require.NoError(t, err)
diff --git a/backend/internal/event/service.go b/backend/internal/event/service.go
index 49ccb20e6..a4157a2be 100644
--- a/backend/internal/event/service.go
+++ b/backend/internal/event/service.go
@@ -81,9 +81,7 @@ func (s *EventService) CreateEvent(ctx context.Context, req CreateEventRequest)
EnvironmentID: req.EnvironmentID,
Metadata: req.Metadata,
Timestamp: time.Now(),
- BaseModel: database.BaseModel{
- CreatedAt: time.Now(),
- },
+ CreatedAt: time.Now(),
}
err := s.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
diff --git a/backend/internal/event/service_test.go b/backend/internal/event/service_test.go
index 07683784a..83457f207 100644
--- a/backend/internal/event/service_test.go
+++ b/backend/internal/event/service_test.go
@@ -328,7 +328,7 @@ func TestEventService_ListEventsPaginated_TypeCategoryFilter(t *testing.T) {
listWithTypeFilter := func(value string) []string {
events, _, err := svc.ListEventsPaginated(ctx, pagination.QueryParams{
- Params: pagination.Params{Limit: 10},
+ Limit: 10,
Filters: map[string]string{"type": value},
})
require.NoError(t, err)
diff --git a/backend/internal/federated/playwright.go b/backend/internal/federated/playwright.go
index 76be40f25..b9c79440b 100644
--- a/backend/internal/federated/playwright.go
+++ b/backend/internal/federated/playwright.go
@@ -9,9 +9,9 @@ import (
"context"
"strings"
+ "uuid"
"emperror.dev/errors"
- "github.com/google/uuid"
"gorm.io/gorm"
)
@@ -31,7 +31,7 @@ func (s *FederatedCredentialService) CreatePlaywrightCredential(ctx context.Cont
var credentialID string
err := s.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
serviceUser := common.User{
- Username: "svc_federated_e2e_" + strings.ReplaceAll(uuid.NewString(), "-", ""),
+ Username: "svc_federated_e2e_" + strings.ReplaceAll(uuid.New().String(), "-", ""),
IsServiceAccount: true,
}
if err := tx.Create(&serviceUser).Error; err != nil {
diff --git a/backend/internal/federated/service.go b/backend/internal/federated/service.go
index e465fd6e9..6d408d97b 100644
--- a/backend/internal/federated/service.go
+++ b/backend/internal/federated/service.go
@@ -13,11 +13,11 @@ import (
"strings"
"sync"
"time"
+ "uuid"
"emperror.dev/errors"
"github.com/coreos/go-oidc/v3/oidc"
- "github.com/google/uuid"
"github.com/samber/mo"
"golang.org/x/sync/singleflight"
"gorm.io/gorm"
@@ -172,7 +172,7 @@ func (s *FederatedCredentialService) Create(ctx context.Context, callerUserID st
var created FederatedCredential
err = dbutil.WithTx(ctx, s.db.DB, func(tx *gorm.DB) error {
serviceUser := common.User{
- Username: "svc_federated_" + strings.ReplaceAll(uuid.NewString(), "-", ""),
+ Username: "svc_federated_" + strings.ReplaceAll(uuid.New().String(), "-", ""),
DisplayName: mo.EmptyableToOption(strings.TrimSpace("Federated: " + normalized.Name)).ToPointer(),
IsServiceAccount: true,
}
diff --git a/backend/internal/federated/service_test.go b/backend/internal/federated/service_test.go
index 1671f8d93..adddd524e 100644
--- a/backend/internal/federated/service_test.go
+++ b/backend/internal/federated/service_test.go
@@ -155,14 +155,14 @@ func setupFederatedCredentialServiceInternal(t *testing.T, issuer *federatedTest
service := NewFederatedCredentialService(db, authSvc, userSvc, settingsSvc, eventSvc, issuer.server.Client()).WithRoleService(roleSvc)
viewerRole := role.Role{
- BaseModel: database.BaseModel{ID: "role-federated-viewer"},
+ ID: "role-federated-viewer",
Name: "Federated Viewer",
Permissions: database.StringSlice{authz.PermProjectsList},
}
require.NoError(t, db.WithContext(ctx).Create(&viewerRole).Error)
serviceUser := common.User{
- BaseModel: database.BaseModel{ID: "user-federated-service"},
+ ID: "user-federated-service",
Username: "svc-federated-demo",
IsServiceAccount: true,
}
@@ -173,7 +173,7 @@ func setupFederatedCredentialServiceInternal(t *testing.T, issuer *federatedTest
}).Error)
credential := FederatedCredential{
- BaseModel: database.BaseModel{ID: "cred-github-actions"},
+ ID: "cred-github-actions",
Name: "GitHub Actions",
Enabled: true,
IssuerURL: issuer.IssuerURL,
diff --git a/backend/internal/gitops/service_test.go b/backend/internal/gitops/service_test.go
index b91e23976..7db8a923b 100644
--- a/backend/internal/gitops/service_test.go
+++ b/backend/internal/gitops/service_test.go
@@ -179,13 +179,13 @@ func TestGitOpsSyncService_CleanupOrphanedSyncsOnStartup_DeletesOnlyOrphans(t *t
require.NoError(t, db.AutoMigrate(&environment.Environment{}))
require.NoError(t, db.Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: "env-live"},
- Name: "Live",
+ ID: "env-live",
+ Name: "Live",
}).Error)
orphanSyncID := "sync-orphan"
liveSyncID := "sync-live"
require.NoError(t, db.Create(&projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: orphanSyncID},
+ ID: orphanSyncID,
Name: "orphan",
EnvironmentID: "env-missing",
RepositoryID: "repo-1",
@@ -194,7 +194,7 @@ func TestGitOpsSyncService_CleanupOrphanedSyncsOnStartup_DeletesOnlyOrphans(t *t
SyncInterval: 15,
}).Error)
require.NoError(t, db.Create(&projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: liveSyncID},
+ ID: liveSyncID,
Name: "live",
EnvironmentID: "env-live",
RepositoryID: "repo-1",
@@ -203,7 +203,7 @@ func TestGitOpsSyncService_CleanupOrphanedSyncsOnStartup_DeletesOnlyOrphans(t *t
SyncInterval: 15,
}).Error)
require.NoError(t, db.Create(&projectpkg.Project{
- BaseModel: database.BaseModel{ID: "project-orphan"},
+ ID: "project-orphan",
Name: "orphan",
Path: "/tmp/orphan",
Status: projectpkg.ProjectStatusStopped,
@@ -231,11 +231,11 @@ func TestGitOpsSyncService_RegisterAutoSyncJobsOnStartup_SkipsOrphans(t *testing
require.NoError(t, db.AutoMigrate(&environment.Environment{}))
require.NoError(t, db.Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: "env-live"},
- Name: "Live",
+ ID: "env-live",
+ Name: "Live",
}).Error)
require.NoError(t, db.Create(&projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-orphan"},
+ ID: "sync-orphan",
Name: "orphan",
EnvironmentID: "env-missing",
RepositoryID: "repo-1",
@@ -246,7 +246,7 @@ func TestGitOpsSyncService_RegisterAutoSyncJobsOnStartup_SkipsOrphans(t *testing
}).Error)
now := time.Now()
require.NoError(t, db.Create(&projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-live"},
+ ID: "sync-live",
Name: "live",
EnvironmentID: "env-live",
RepositoryID: "repo-1",
@@ -271,7 +271,7 @@ func TestGitOpsSyncService_DeleteSync_DeletesStaleProjectReference(t *testing.T)
missingProjectID := "missing-project"
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-delete-stale-project"},
+ ID: "sync-delete-stale-project",
Name: "demo-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -299,7 +299,7 @@ func TestGitOpsSyncService_DeleteSync_SucceedsWhenEnvironmentMismatched(t *testi
require.NoError(t, svc.SetScheduler(ctx, scheduler, newGitOpsAdmissionGateForTestInternal(t)))
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-env-mismatch"},
+ ID: "sync-env-mismatch",
Name: "corrupt-sync",
EnvironmentID: "5",
ProjectName: "demo-project",
@@ -323,7 +323,7 @@ func TestGitOpsSyncService_DeleteSync_ClearsOrphanedManagedFlag(t *testing.T) {
syncID := "sync-orphan-flag"
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: syncID},
+ ID: syncID,
Name: "demo-sync",
EnvironmentID: "0",
ProjectName: "demo-project",
@@ -332,7 +332,7 @@ func TestGitOpsSyncService_DeleteSync_ClearsOrphanedManagedFlag(t *testing.T) {
require.NoError(t, db.Create(sync).Error)
managed := &projectpkg.Project{
- BaseModel: database.BaseModel{ID: "proj-managed"},
+ ID: "proj-managed",
Name: "managed",
Path: filepath.Join(t.TempDir(), "managed"),
GitOpsManagedBy: &syncID,
@@ -403,7 +403,7 @@ func TestGitOpsSyncService_SyncProjectDirectory_RefusesDuplicateOnNameCollision(
require.NoError(t, os.WriteFile(filepath.Join(projectsDir, "Dozzle", "unrelated.txt"), []byte("x"), 0o644))
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-dup-refuse"},
+ ID: "sync-dup-refuse",
Name: "Dozzle",
EnvironmentID: "0",
ComposePath: "Dozzle/docker-compose.yaml",
@@ -440,7 +440,7 @@ func TestGitOpsSyncService_GetOrCreateProject_RefusesDuplicateOnNameCollision(t
require.NoError(t, os.MkdirAll(filepath.Join(projectsDir, "Dozzle"), 0o755))
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-single-dup"},
+ ID: "sync-single-dup",
Name: "Dozzle",
EnvironmentID: "0",
ComposePath: "docker-compose.yaml",
@@ -467,7 +467,7 @@ func TestGitOpsSyncService_SyncProjectDirectory_CreatesProjectPreservingRepoLayo
svc, db, _ := setupGitOpsSyncDirectoryTestService(t)
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-create"},
+ ID: "sync-directory-create",
Name: "demo-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -562,11 +562,11 @@ services:
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "compose.yaml"), []byte("services: {}\n"), 0o644))
project := &projectpkg.Project{
- BaseModel: database.BaseModel{ID: "proj-directory-update"},
- Name: "demo-project",
- DirName: new("demo-project"),
- Path: projectPath,
- Status: projectpkg.ProjectStatusStopped,
+ ID: "proj-directory-update",
+ Name: "demo-project",
+ DirName: new("demo-project"),
+ Path: projectPath,
+ Status: projectpkg.ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -574,7 +574,7 @@ services:
require.NoError(t, err)
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-update"},
+ ID: "sync-directory-update",
Name: "demo-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -652,11 +652,11 @@ func TestGitOpsSyncService_SyncProjectDirectory_PreservesEnvOverrideAndAddsNewGi
require.NoError(t, os.WriteFile(filepath.Join(projectPath, ".env"), []byte("FOO=useredit\n"), 0o644))
project := &projectpkg.Project{
- BaseModel: database.BaseModel{ID: "proj-directory-env-preserve"},
- Name: "demo-project",
- DirName: new("demo-project"),
- Path: projectPath,
- Status: projectpkg.ProjectStatusStopped,
+ ID: "proj-directory-env-preserve",
+ Name: "demo-project",
+ DirName: new("demo-project"),
+ Path: projectPath,
+ Status: projectpkg.ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -664,7 +664,7 @@ func TestGitOpsSyncService_SyncProjectDirectory_PreservesEnvOverrideAndAddsNewGi
require.NoError(t, err)
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-env-preserve"},
+ ID: "sync-directory-env-preserve",
Name: "demo-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -743,11 +743,11 @@ func TestGitOpsSyncService_SyncProjectDirectory_MigratesLegacyTrackedEnvOnFirstS
require.NoError(t, os.WriteFile(filepath.Join(projectPath, ".env"), []byte("LOCAL_ONLY=1\n"), 0o644))
project := &projectpkg.Project{
- BaseModel: database.BaseModel{ID: "proj-directory-legacy-env-migrate"},
- Name: "demo-project",
- DirName: new("demo-project"),
- Path: projectPath,
- Status: projectpkg.ProjectStatusStopped,
+ ID: "proj-directory-legacy-env-migrate",
+ Name: "demo-project",
+ DirName: new("demo-project"),
+ Path: projectPath,
+ Status: projectpkg.ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -756,7 +756,7 @@ func TestGitOpsSyncService_SyncProjectDirectory_MigratesLegacyTrackedEnvOnFirstS
require.NoError(t, err)
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-legacy-env-migrate"},
+ ID: "sync-directory-legacy-env-migrate",
Name: "demo-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -806,7 +806,7 @@ func TestGitOpsSyncService_SyncProjectDirectory_IgnoresCommittedReservedEnvFiles
svc, db, _ := setupGitOpsSyncDirectoryTestService(t)
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-reserved-env"},
+ ID: "sync-directory-reserved-env",
Name: "demo-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -880,7 +880,7 @@ func TestGitOpsSyncService_DirectorySync_RealWalkWithNestedConfig(t *testing.T)
`))
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-real-walk"},
+ ID: "sync-directory-real-walk",
Name: "traefik-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -952,16 +952,16 @@ func TestGitOpsSyncService_DirectorySync_OverwritesExistingDirectoryAtFilePath(t
dirName := "traefik-project"
project := &projectpkg.Project{
- BaseModel: database.BaseModel{ID: "proj-directory-docker-dir-conflict"},
- Name: "traefik-project",
- DirName: &dirName,
- Path: projectPath,
- Status: projectpkg.ProjectStatusStopped,
+ ID: "proj-directory-docker-dir-conflict",
+ Name: "traefik-project",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: projectpkg.ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-docker-dir-conflict"},
+ ID: "sync-directory-docker-dir-conflict",
Name: "traefik-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -1009,7 +1009,7 @@ func TestGitOpsSyncService_CreateDirectorySyncProjectInternal_RollsBackProjectOn
svc, db, projectsDir := setupGitOpsSyncDirectoryTestService(t)
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-tx-rollback"},
+ ID: "sync-directory-tx-rollback",
Name: "demo-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -1089,7 +1089,7 @@ func TestGitOpsSyncService_GetDirectorySyncProjectInternal_RelinksManagedProject
missingProjectID := "missing-project"
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-relink"},
+ ID: "sync-directory-relink",
Name: "radarr-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -1102,7 +1102,7 @@ func TestGitOpsSyncService_GetDirectorySyncProjectInternal_RelinksManagedProject
dirName := "Radarr-3"
project := &projectpkg.Project{
- BaseModel: database.BaseModel{ID: "proj-directory-relink"},
+ ID: "proj-directory-relink",
Name: "Radarr",
DirName: &dirName,
Path: projectPath,
@@ -1132,7 +1132,7 @@ func TestGitOpsSyncService_GetDirectorySyncProjectInternal_RecoversUniqueDirecto
missingProjectID := "missing-project"
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-disk-recovery"},
+ ID: "sync-directory-disk-recovery",
Name: "radarr-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -1173,7 +1173,7 @@ func TestGitOpsSyncService_ReconcileDirectorySyncProjectsOnStartup_SkipsAmbiguou
missingProjectID := "missing-project"
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-ambiguous"},
+ ID: "sync-directory-ambiguous",
Name: "radarr-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -1204,7 +1204,7 @@ func TestGitOpsSyncService_SyncProjectDirectory_FailsWhenBoundProjectMissing(t *
missingProjectID := "missing-project"
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-missing-bound-project"},
+ ID: "sync-directory-missing-bound-project",
Name: "demo-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -1265,7 +1265,7 @@ func TestGitOpsSyncService_SyncProjectDirectory_DisablesAutoSyncWhenBoundProject
missingProjectID := "missing-project"
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-directory-ambiguous-bound-project"},
+ ID: "sync-directory-ambiguous-bound-project",
Name: "radarr-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -1314,7 +1314,7 @@ func TestGitOpsSyncService_GetOrCreateProjectInternal_FailsWhenBoundProjectMissi
missingProjectID := "missing-project"
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-file-missing-bound-project"},
+ ID: "sync-file-missing-bound-project",
Name: "demo-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -1734,7 +1734,7 @@ func TestMarkSyncRedeployFailedInternal_PersistsErrorOnSyncRow(t *testing.T) {
svc.eventService = event.NewEventService(db, config.Load(), nil)
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-1"},
+ ID: "sync-1",
Name: "redeploy-fail",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -1748,7 +1748,7 @@ func TestMarkSyncRedeployFailedInternal_PersistsErrorOnSyncRow(t *testing.T) {
syncedFiles := []string{"compose.yml", "scripts/pre-deploy.sh"}
hookErr := common.Classify(common.ErrRedeployAfterSyncFailed, errors.WrapIf(errors.New("pre-deploy hook failed: exit 1"), "redeploy failed"))
- svc.markSyncRedeployFailedInternal(ctx, sync, sync.ID, "abc123", syncedFiles, hookErr, common.User{BaseModel: database.BaseModel{ID: "user"}, Username: "tester"}, result)
+ svc.markSyncRedeployFailedInternal(ctx, sync, sync.ID, "abc123", syncedFiles, hookErr, common.User{ID: "user", Username: "tester"}, result)
require.False(t, result.Success)
require.NotNil(t, result.Error)
diff --git a/backend/internal/gitops/service_unix_test.go b/backend/internal/gitops/service_unix_test.go
index 7ea8e869a..6f0552d71 100644
--- a/backend/internal/gitops/service_unix_test.go
+++ b/backend/internal/gitops/service_unix_test.go
@@ -6,8 +6,6 @@ import (
"github.com/getarcaneapp/arcane/backend/v2/internal/common"
projectpkg "github.com/getarcaneapp/arcane/backend/v2/internal/project"
- "github.com/getarcaneapp/arcane/backend/v2/internal/database"
-
"context"
"encoding/json"
"os"
@@ -48,11 +46,11 @@ func TestGitOpsSyncService_SyncProjectDirectory_PreservesUnreadableBindMountData
t.Cleanup(func() { _ = os.Chmod(secretPath, 0o644) })
project := &projectpkg.Project{
- BaseModel: database.BaseModel{ID: "proj-unreadable-bindmount"},
- Name: "demo-project",
- DirName: new("demo-project"),
- Path: projectPath,
- Status: projectpkg.ProjectStatusStopped,
+ ID: "proj-unreadable-bindmount",
+ Name: "demo-project",
+ DirName: new("demo-project"),
+ Path: projectPath,
+ Status: projectpkg.ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -60,7 +58,7 @@ func TestGitOpsSyncService_SyncProjectDirectory_PreservesUnreadableBindMountData
require.NoError(t, err)
sync := &projectpkg.GitOpsSync{
- BaseModel: database.BaseModel{ID: "sync-unreadable-bindmount"},
+ ID: "sync-unreadable-bindmount",
Name: "demo-sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
diff --git a/backend/internal/gitrepo/service.go b/backend/internal/gitrepo/service.go
index 9cd6482f4..238acf7da 100644
--- a/backend/internal/gitrepo/service.go
+++ b/backend/internal/gitrepo/service.go
@@ -569,8 +569,8 @@ func (s *GitRepositoryService) createNewRepository(ctx context.Context, item git
SSHHostKeyVerification: sshHostKeyVerification,
Description: item.Description,
Enabled: item.Enabled,
+ ID: item.ID,
}
- repo.ID = item.ID
if err := s.db.WithContext(ctx).Create(&repo).Error; err != nil {
return errors.WrapIff(err, "failed to create repository %s", item.ID)
diff --git a/backend/internal/gitrepo/service_test.go b/backend/internal/gitrepo/service_test.go
index d72196706..43b8c928a 100644
--- a/backend/internal/gitrepo/service_test.go
+++ b/backend/internal/gitrepo/service_test.go
@@ -80,8 +80,8 @@ func createGitRepositoryServiceTestRepoInternal(t *testing.T, svc *GitRepository
t.Helper()
repo, err := svc.CreateRepository(context.Background(), req, common.User{
- BaseModel: database.BaseModel{ID: "admin-1"},
- Username: "admin",
+ ID: "admin-1",
+ Username: "admin",
})
require.NoError(t, err)
return repo
diff --git a/backend/internal/image/image.go b/backend/internal/image/image.go
index 6b3810d2a..97d082c7b 100644
--- a/backend/internal/image/image.go
+++ b/backend/internal/image/image.go
@@ -993,8 +993,8 @@ func parseRepoAndTagFromRepoTag(repoTag string) (repo, tag string) {
return repo, tag
}
- if lastColonIdx := strings.LastIndex(repoTag, ":"); lastColonIdx != -1 {
- return repoTag[:lastColonIdx], repoTag[lastColonIdx+1:]
+ if before, after, found := strings.CutLast(repoTag, ":"); found {
+ return before, after
}
return repoTag, "latest"
}
@@ -1004,11 +1004,8 @@ func parseRepoFromDigests(repoDigests []string) mo.Option[string] {
if rd == "<none>@<none>" {
continue
}
- if at := strings.LastIndex(rd, "@"); at != -1 {
- candidateRepo := rd[:at]
- if candidateRepo != "" {
- return mo.Some(candidateRepo)
- }
+ if candidateRepo, _, found := strings.CutLast(rd, "@"); found && candidateRepo != "" {
+ return mo.Some(candidateRepo)
}
}
return mo.None[string]()
diff --git a/backend/internal/imageupdate/image_update.go b/backend/internal/imageupdate/image_update.go
index 7be2696d7..7bc8441d5 100644
--- a/backend/internal/imageupdate/image_update.go
+++ b/backend/internal/imageupdate/image_update.go
@@ -996,11 +996,8 @@ func extractRepoAndTagFromImage(dockerImage image.InspectResponse) (repo, tag st
if rd == "<none>@<none>" {
continue
}
- if at := strings.LastIndex(rd, "@"); at != -1 {
- repoCandidate := rd[:at]
- if repoCandidate != "" {
- return repoCandidate, "<none>"
- }
+ if repoCandidate, _, found := strings.CutLast(rd, "@"); found && repoCandidate != "" {
+ return repoCandidate, "<none>"
}
}
}
diff --git a/backend/internal/imageupdate/service_test.go b/backend/internal/imageupdate/service_test.go
index eaf47e359..e12aa8f79 100644
--- a/backend/internal/imageupdate/service_test.go
+++ b/backend/internal/imageupdate/service_test.go
@@ -433,7 +433,7 @@ func newComposeBuildImageUpdateServiceInternal(t *testing.T) (*ImageUpdateServic
db := setupImageUpdateTestDB(t)
buildRefsJSON := `["test2:latest"]`
require.NoError(t, db.Create(&testProjectRow{
- BaseModel: database.BaseModel{ID: "compose-build-project"},
+ ID: "compose-build-project",
Name: "compose-build-project",
BuildImageRefsJSON: &buildRefsJSON,
}).Error)
@@ -449,9 +449,7 @@ func newComposeBuildImageUpdateServiceInternal(t *testing.T) (*ImageUpdateServic
distributionInspectFn: func(context.Context, string, client.DistributionInspectOptions) (client.DistributionInspectResult, error) {
registryCalls.Add(1)
return client.DistributionInspectResult{
- DistributionInspect: dockerregistry.DistributionInspect{
- Descriptor: ocispec.Descriptor{Digest: digest.Digest(remoteDigest)},
- },
+ Descriptor: ocispec.Descriptor{Digest: digest.Digest(remoteDigest)},
}, nil
},
}, nil
@@ -502,7 +500,7 @@ func TestImageUpdateService_CheckMultipleImages_ComposeBuildMissingLocallySkipsR
db := setupImageUpdateTestDB(t)
buildRefsJSON := `["test2:latest"]`
require.NoError(t, db.Create(&testProjectRow{
- BaseModel: database.BaseModel{ID: "compose-build-missing-project"},
+ ID: "compose-build-missing-project",
Name: "compose-build-missing-project",
BuildImageRefsJSON: &buildRefsJSON,
}).Error)
@@ -1069,10 +1067,8 @@ func TestImageUpdateService_CheckMultipleImages_UsesDockerHubCredentialsOnFirstA
assert.Equal(t, "https://index.docker.io/v1/", authCfg.ServerAddress)
return client.DistributionInspectResult{
- DistributionInspect: dockerregistry.DistributionInspect{
- Descriptor: ocispec.Descriptor{
- Digest: digest.Digest(remoteDigest),
- },
+ Descriptor: ocispec.Descriptor{
+ Digest: digest.Digest(remoteDigest),
},
}, nil
},
diff --git a/backend/internal/notification/service_test.go b/backend/internal/notification/service_test.go
index c1cf1fa68..49890f60d 100644
--- a/backend/internal/notification/service_test.go
+++ b/backend/internal/notification/service_test.go
@@ -101,11 +101,11 @@ func TestNotificationService_ResolveNotificationTargetInternal_UsesEnvironmentRe
now := time.Now()
require.NoError(t, db.WithContext(ctx).Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: "env-remote", CreatedAt: now, UpdatedAt: &now},
- Name: "Remote Alpha",
- ApiUrl: "http://remote.example",
- Enabled: true,
- Status: string(environment.EnvironmentStatusOnline),
+ ID: "env-remote", CreatedAt: now, UpdatedAt: &now,
+ Name: "Remote Alpha",
+ ApiUrl: "http://remote.example",
+ Enabled: true,
+ Status: string(environment.EnvironmentStatusOnline),
}).Error)
target, err = svc.resolveNotificationTargetInternal(ctx, "env-remote")
@@ -121,7 +121,7 @@ func TestNotificationService_ResolveNotificationTargetForAccessTokenInternal_Use
token := "remote-token"
now := time.Now()
require.NoError(t, db.WithContext(ctx).Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: "env-remote", CreatedAt: now, UpdatedAt: &now},
+ ID: "env-remote", CreatedAt: now, UpdatedAt: &now,
Name: "Remote Edge",
ApiUrl: "http://remote.example",
Enabled: true,
@@ -158,7 +158,7 @@ func TestNotificationService_DispatchNotification_UnsupportedKindReturnsSentinel
token := "remote-token"
now := time.Now()
require.NoError(t, db.WithContext(ctx).Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: "env-remote", CreatedAt: now, UpdatedAt: &now},
+ ID: "env-remote", CreatedAt: now, UpdatedAt: &now,
Name: "Remote Edge",
ApiUrl: "http://remote.example",
Enabled: true,
@@ -185,7 +185,7 @@ func TestNotificationService_DispatchNotification_LogsManagerDispatchForAgent(t
token := "remote-token"
now := time.Now()
require.NoError(t, db.WithContext(ctx).Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: "env-remote", CreatedAt: now, UpdatedAt: &now},
+ ID: "env-remote", CreatedAt: now, UpdatedAt: &now,
Name: "Remote Edge",
ApiUrl: "http://remote.example",
Enabled: true,
@@ -799,10 +799,10 @@ func TestNotificationService_DispatchNotificationForEnvironment_ResolvesTunnelSe
now := time.Now()
require.NoError(t, db.WithContext(ctx).Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: "env-edge", CreatedAt: now, UpdatedAt: &now},
- Name: "edge-env",
- ApiUrl: "http://edge:3553",
- Enabled: true,
+ ID: "env-edge", CreatedAt: now, UpdatedAt: &now,
+ Name: "edge-env",
+ ApiUrl: "http://edge:3553",
+ Enabled: true,
}).Error)
// No access token involved: the environment comes from the tunnel session (#3002).
diff --git a/backend/internal/passkey/service.go b/backend/internal/passkey/service.go
index a03310290..f41de091a 100644
--- a/backend/internal/passkey/service.go
+++ b/backend/internal/passkey/service.go
@@ -19,6 +19,7 @@ import (
"sync"
"time"
"unicode/utf8"
+ "uuid"
"emperror.dev/errors"
"github.com/getarcaneapp/arcane/backend/v2/internal/config"
@@ -27,7 +28,6 @@ import (
"github.com/getarcaneapp/arcane/types/v2/auth"
"github.com/go-webauthn/webauthn/protocol"
"github.com/go-webauthn/webauthn/webauthn"
- "github.com/google/uuid"
"gorm.io/gorm"
"gorm.io/gorm/clause"
)
@@ -323,7 +323,7 @@ func (s *passkeyService) BeginMFAAuthentication(ctx context.Context, userID stri
return nil, ErrPasskeyNoCredential
}
- transaction := newAuthTransactionInternal(userID, authTransactionKindMFA, source, meta, nil, passkeyStepUpTTL)
+ transaction := newAuthTransactionInternal(userID, authTransactionKindMFA, source, meta, nil)
if err := s.db.WithContext(ctx).Create(transaction).Error; err != nil {
return nil, errors.WrapIf(err, "failed to create MFA transaction")
}
@@ -410,7 +410,7 @@ func (s *passkeyService) BeginStepUp(ctx context.Context, userID, sessionID stri
return nil, ErrPasskeyNoCredential
}
- transaction := newAuthTransactionInternal(userID, authTransactionKindStepUp, session.UserSessionSourceLocal, meta, &sessionID, passkeyStepUpTTL)
+ transaction := newAuthTransactionInternal(userID, authTransactionKindStepUp, session.UserSessionSourceLocal, meta, &sessionID)
if err := s.db.WithContext(ctx).Create(transaction).Error; err != nil {
return nil, errors.WrapIf(err, "failed to create step-up transaction")
}
@@ -575,7 +575,7 @@ func (s *passkeyService) FinishMobilePasskeyLogin(ctx context.Context, ceremonyI
return nil, err
}
- transaction := newAuthTransactionInternal(user.ID, authTransactionKindMobilePasskey, session.UserSessionSourcePasskey, auth.SessionMeta{}, nil, passkeyStepUpTTL)
+ transaction := newAuthTransactionInternal(user.ID, authTransactionKindMobilePasskey, session.UserSessionSourcePasskey, auth.SessionMeta{}, nil)
transaction.SecretHash = &codeChallenge
if err := s.db.WithContext(ctx).Create(transaction).Error; err != nil {
return nil, errors.WrapIf(err, "failed to create mobile passkey transaction")
@@ -734,7 +734,7 @@ func (s *passkeyService) CreatePasswordStepUpGrant(ctx context.Context, userID,
if err := s.ensureActiveSessionInternal(ctx, userID, sessionID); err != nil {
return nil, err
}
- transaction := newAuthTransactionInternal(userID, authTransactionKindStepUp, session.UserSessionSourceLocal, auth.SessionMeta{}, &sessionID, passkeyStepUpTTL)
+ transaction := newAuthTransactionInternal(userID, authTransactionKindStepUp, session.UserSessionSourceLocal, auth.SessionMeta{}, &sessionID)
if err := s.db.WithContext(ctx).Create(transaction).Error; err != nil {
return nil, errors.WrapIf(err, "failed to create password step-up transaction")
}
@@ -1047,7 +1047,7 @@ func (s *passkeyService) createCeremonyInternal(ctx context.Context, purpose str
expiresAt = time.Now().Add(passkeyCeremonyTTL)
}
ceremony := &PasskeyCeremony{
- BaseModel: database.BaseModel{ID: uuid.NewString()},
+ ID: uuid.New().String(),
Purpose: purpose,
UserID: userID,
SessionID: sessionID,
@@ -1259,7 +1259,7 @@ func (s *passkeyService) persistCredentialInternal(ctx context.Context, userID s
transports[i] = string(transport)
}
row := &Passkey{
- BaseModel: database.BaseModel{ID: uuid.NewString()},
+ ID: uuid.New().String(),
UserID: userID,
RPID: s.rpID,
CredentialID: append([]byte(nil), credential.ID...),
@@ -1317,12 +1317,12 @@ func (s *passkeyService) updateCredentialAfterAssertionInternal(ctx context.Cont
return nil
}
-func newAuthTransactionInternal(userID, kind, source string, meta auth.SessionMeta, sessionID *string, ttl time.Duration) *AuthTransaction {
+func newAuthTransactionInternal(userID, kind, source string, meta auth.SessionMeta, sessionID *string) *AuthTransaction {
if strings.TrimSpace(source) == "" {
source = session.UserSessionSourceLocal
}
return &AuthTransaction{
- BaseModel: database.BaseModel{ID: uuid.NewString()},
+ ID: uuid.New().String(),
Kind: kind,
UserID: userID,
SessionID: sessionID,
@@ -1330,7 +1330,7 @@ func newAuthTransactionInternal(userID, kind, source string, meta auth.SessionMe
UserAgent: optionalStringInternal(meta.UserAgent),
IPAddress: optionalStringInternal(meta.IPAddress),
Status: authTransactionPending,
- ExpiresAt: time.Now().Add(ttl),
+ ExpiresAt: time.Now().Add(passkeyStepUpTTL),
}
}
@@ -1390,10 +1390,7 @@ func formatAAGUIDInternal(aaguid []byte) string {
return ""
}
if len(aaguid) == 16 {
- value, err := uuid.FromBytes(aaguid)
- if err == nil {
- return value.String()
- }
+ return uuid.UUID(aaguid).String()
}
return hex.EncodeToString(aaguid)
}
@@ -1422,7 +1419,7 @@ func generateRecoveryCodeRowsInternal(userID string) ([]string, []PasskeyRecover
encoded := strings.TrimRight(base32.StdEncoding.WithPadding(base32.NoPadding).EncodeToString(raw), "=")
codes[i] = groupRecoveryCodeInternal(encoded)
hash := hashSecretInternal(strings.ToUpper(strings.ReplaceAll(codes[i], "-", "")))
- rows[i] = PasskeyRecoveryCode{BaseModel: database.BaseModel{ID: uuid.NewString()}, UserID: userID, CodeHash: hash}
+ rows[i] = PasskeyRecoveryCode{ID: uuid.New().String(), UserID: userID, CodeHash: hash}
}
return codes, rows, nil
}
diff --git a/backend/internal/passkey/service_test.go b/backend/internal/passkey/service_test.go
index 6a6a1fba7..e50490026 100644
--- a/backend/internal/passkey/service_test.go
+++ b/backend/internal/passkey/service_test.go
@@ -6,8 +6,8 @@ import (
"context"
"testing"
"time"
+ "uuid"
- "github.com/google/uuid"
"github.com/libtnb/sqlite"
"github.com/stretchr/testify/require"
"gorm.io/gorm"
@@ -46,7 +46,7 @@ func newPasskeyServiceForTest(t *testing.T, db *database.DB) *PasskeyService {
func createPasskeyTestUser(t *testing.T, db *database.DB, id string) *common.User {
t.Helper()
user := &common.User{
- BaseModel: database.BaseModel{ID: id},
+ ID: id,
Username: id,
PasswordHash: "stored-password-hash",
}
@@ -57,7 +57,7 @@ func createPasskeyTestUser(t *testing.T, db *database.DB, id string) *common.Use
func createPasskeyTestCredential(t *testing.T, db *database.DB, service *PasskeyService, userID, id string) *Passkey {
t.Helper()
credential := &Passkey{
- BaseModel: database.BaseModel{ID: id},
+ ID: id,
UserID: userID,
RPID: service.rpID,
CredentialID: []byte("credential-" + id),
@@ -179,7 +179,7 @@ func TestPasskeyService_RecoveryCodeConsumptionIsAtomicAndSingleUse(t *testing.T
transaction := newAuthTransactionInternal(user.ID, authTransactionKindMFA, session.UserSessionSourceLocal, auth.SessionMeta{
UserAgent: "test-agent",
IPAddress: "127.0.0.1",
- }, nil, passkeyStepUpTTL)
+ }, nil)
require.NoError(t, db.Create(transaction).Error)
_, err = service.FinishRecoveryCode(ctx, transaction.ID, "not-a-recovery-code")
@@ -271,10 +271,10 @@ func TestPasskeyService_ResetMFARevokesSessionsAndPreservesPasskeys(t *testing.T
_, rows, err := generateRecoveryCodeRowsInternal(user.ID)
require.NoError(t, err)
require.NoError(t, db.Create(&rows).Error)
- transaction := newAuthTransactionInternal(user.ID, authTransactionKindMFA, session.UserSessionSourceLocal, auth.SessionMeta{}, nil, passkeyStepUpTTL)
+ transaction := newAuthTransactionInternal(user.ID, authTransactionKindMFA, session.UserSessionSourceLocal, auth.SessionMeta{}, nil)
require.NoError(t, db.Create(transaction).Error)
ceremony := &PasskeyCeremony{
- BaseModel: database.BaseModel{ID: "reset-ceremony"},
+ ID: "reset-ceremony",
Purpose: passkeyCeremonyPurposeMFA,
UserID: new(user.ID),
AuthTransactionID: new(transaction.ID),
diff --git a/backend/internal/port/service_test.go b/backend/internal/port/service_test.go
index 59d7bb0c0..0a7dd2baa 100644
--- a/backend/internal/port/service_test.go
+++ b/backend/internal/port/service_test.go
@@ -57,7 +57,7 @@ func TestPortService_ListPortsPaginated_FlattensPublishedAndExposedPorts(t *test
}))
items, page, err := svc.ListPortsPaginated(context.Background(), pagination.QueryParams{
- Params: pagination.Params{Limit: 20},
+ Limit: 20,
})
require.NoError(t, err)
require.Len(t, items, 3)
@@ -109,11 +109,9 @@ func TestPortService_ListPortsPaginated_SortsByHostPortWithUnpublishedLast(t *te
}))
items, _, err := svc.ListPortsPaginated(context.Background(), pagination.QueryParams{
- SortParams: pagination.SortParams{
- Sort: "hostPort",
- Order: pagination.SortAsc,
- },
- Params: pagination.Params{Limit: 20},
+ Sort: "hostPort",
+ Order: pagination.SortAsc,
+ Limit: 20,
})
require.NoError(t, err)
require.Len(t, items, 3)
@@ -156,11 +154,9 @@ func TestPortService_ListPortsPaginated_SortsByHostPortDescWithUnpublishedLast(t
}))
items, _, err := svc.ListPortsPaginated(context.Background(), pagination.QueryParams{
- SortParams: pagination.SortParams{
- Sort: "hostPort",
- Order: pagination.SortDesc,
- },
- Params: pagination.Params{Limit: 20},
+ Sort: "hostPort",
+ Order: pagination.SortDesc,
+ Limit: 20,
})
require.NoError(t, err)
require.Len(t, items, 3)
@@ -203,11 +199,9 @@ func TestPortService_ListPortsPaginated_SortsByHostIPDescWithUnpublishedLast(t *
}))
items, _, err := svc.ListPortsPaginated(context.Background(), pagination.QueryParams{
- SortParams: pagination.SortParams{
- Sort: "hostIp",
- Order: pagination.SortDesc,
- },
- Params: pagination.Params{Limit: 20},
+ Sort: "hostIp",
+ Order: pagination.SortDesc,
+ Limit: 20,
})
require.NoError(t, err)
require.Len(t, items, 3)
diff --git a/backend/internal/project/project_tags_test.go b/backend/internal/project/project_tags_test.go
index 2140b7240..88d2b2e79 100644
--- a/backend/internal/project/project_tags_test.go
+++ b/backend/internal/project/project_tags_test.go
@@ -3,8 +3,6 @@ package project
import (
"github.com/getarcaneapp/arcane/backend/v2/internal/common"
- "github.com/getarcaneapp/arcane/backend/v2/internal/database"
-
"context"
"testing"
@@ -17,7 +15,7 @@ func TestProjectTags_ReconcilePreservesUIAndComposeOwnershipIsReadOnly(t *testin
service := &ProjectService{db: db}
ctx := context.Background()
projectModel := Project{
- BaseModel: database.BaseModel{ID: "project-tags"},
+ ID: "project-tags",
Name: "tagged",
Path: "/tmp/tagged",
Status: ProjectStatusStopped,
@@ -56,9 +54,9 @@ func TestProjectTags_FilterUsesExactORNames(t *testing.T) {
db := setupProjectTestDB(t)
ctx := context.Background()
projects := []Project{
- {BaseModel: database.BaseModel{ID: "one"}, Name: "one", Path: "/tmp/one", Status: ProjectStatusStopped},
- {BaseModel: database.BaseModel{ID: "two"}, Name: "two", Path: "/tmp/two", Status: ProjectStatusStopped},
- {BaseModel: database.BaseModel{ID: "three"}, Name: "three", Path: "/tmp/three", Status: ProjectStatusStopped},
+ {ID: "one", Name: "one", Path: "/tmp/one", Status: ProjectStatusStopped},
+ {ID: "two", Name: "two", Path: "/tmp/two", Status: ProjectStatusStopped},
+ {ID: "three", Name: "three", Path: "/tmp/three", Status: ProjectStatusStopped},
}
require.NoError(t, db.Create(&projects).Error)
require.NoError(t, db.Create(&[]ProjectTag{
diff --git a/backend/internal/project/service_test.go b/backend/internal/project/service_test.go
index b258beefc..4a4c6ff85 100644
--- a/backend/internal/project/service_test.go
+++ b/backend/internal/project/service_test.go
@@ -217,9 +217,9 @@ func TestProjectService_RefreshProjectImageRefs_PersistsBuildMetadata(t *testing
`), 0o644))
proj := &Project{
- BaseModel: database.BaseModel{ID: "project-build-image-refs"},
- Name: "demo",
- Path: projectPath,
+ ID: "project-build-image-refs",
+ Name: "demo",
+ Path: projectPath,
}
require.NoError(t, db.Create(proj).Error)
@@ -253,9 +253,9 @@ func TestProjectService_BackfillProjectImageRefs_RetriesOnlyMissingMetadata(t *t
image: nginx:latest
`), 0o644))
- valid := &Project{BaseModel: database.BaseModel{ID: "backfill-valid"}, Name: "valid", Path: validPath}
- invalid := &Project{BaseModel: database.BaseModel{ID: "backfill-invalid"}, Name: "invalid", Path: invalidPath}
- regular := &Project{BaseModel: database.BaseModel{ID: "backfill-regular"}, Name: "regular", Path: regularPath}
+ valid := &Project{ID: "backfill-valid", Name: "valid", Path: validPath}
+ invalid := &Project{ID: "backfill-invalid", Name: "invalid", Path: invalidPath}
+ regular := &Project{ID: "backfill-regular", Name: "regular", Path: regularPath}
require.NoError(t, db.Create(valid).Error)
require.NoError(t, db.Create(invalid).Error)
require.NoError(t, db.Create(regular).Error)
@@ -317,11 +317,11 @@ func TestProjectService_DestroyProject_RemovesFilesWhenRequested(t *testing.T) {
dirName := "demo-remove"
project := &Project{
- BaseModel: database.BaseModel{ID: "project-destroy-remove-files"},
- Name: "demo-remove",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "project-destroy-remove-files",
+ Name: "demo-remove",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -342,11 +342,11 @@ func TestProjectService_DestroyProject_PreservesFilesWhenRequested(t *testing.T)
dirName := "demo-preserve"
project := &Project{
- BaseModel: database.BaseModel{ID: "project-destroy-preserve-files"},
- Name: "demo-preserve",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "project-destroy-preserve-files",
+ Name: "demo-preserve",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -373,9 +373,7 @@ func TestProjectService_GetProjectFromDatabaseByID(t *testing.T) {
// Create test project
proj := &Project{
- BaseModel: database.BaseModel{
- ID: "p1",
- },
+ ID: "p1",
Name: "test-project",
Path: "/tmp/test-project",
}
@@ -485,9 +483,7 @@ func TestProjectService_UpdateProjectStatusInternal(t *testing.T) {
svc := NewProjectService(db, nil, nil, nil, nil, nil, nil, nil, config.Load())
proj := &Project{
- BaseModel: database.BaseModel{
- ID: "p1",
- },
+ ID: "p1",
Status: ProjectStatusUnknown,
}
require.NoError(t, db.Create(proj).Error)
@@ -530,9 +526,9 @@ func TestProjectService_GetProjectByComposeName(t *testing.T) {
svc := NewProjectService(db, nil, nil, nil, nil, nil, nil, nil, config.Load())
proj := &Project{
- BaseModel: database.BaseModel{ID: "p1"},
- Name: "myproject",
- Path: "/tmp/myproject",
+ ID: "p1",
+ Name: "myproject",
+ Path: "/tmp/myproject",
}
require.NoError(t, db.Create(proj).Error)
@@ -546,9 +542,9 @@ func TestProjectService_GetProjectByComposeName(t *testing.T) {
svc := NewProjectService(db, nil, nil, nil, nil, nil, nil, nil, config.Load())
proj := &Project{
- BaseModel: database.BaseModel{ID: "p1"},
- Name: "myproject",
- Path: "/tmp/myproject",
+ ID: "p1",
+ Name: "myproject",
+ Path: "/tmp/myproject",
}
require.NoError(t, db.Create(proj).Error)
@@ -562,9 +558,9 @@ func TestProjectService_GetProjectByComposeName(t *testing.T) {
svc := NewProjectService(db, nil, nil, nil, nil, nil, nil, nil, config.Load())
display := &Project{
- BaseModel: database.BaseModel{ID: "p2"},
- Name: "My Project!",
- Path: "/tmp/my-project",
+ ID: "p2",
+ Name: "My Project!",
+ Path: "/tmp/my-project",
}
require.NoError(t, db.Create(display).Error)
@@ -578,9 +574,9 @@ func TestProjectService_GetProjectByComposeName(t *testing.T) {
svc := NewProjectService(db, nil, nil, nil, nil, nil, nil, nil, config.Load())
original := &Project{
- BaseModel: database.BaseModel{ID: "p3"},
- Name: "My Project!",
- Path: "/tmp/my-project",
+ ID: "p3",
+ Name: "My Project!",
+ Path: "/tmp/my-project",
}
require.NoError(t, db.Create(original).Error)
@@ -595,9 +591,9 @@ func TestProjectService_GetProjectByComposeName(t *testing.T) {
require.NoError(t, db.Delete(&Project{}, "id = ?", original.ID).Error)
replacement := &Project{
- BaseModel: database.BaseModel{ID: "p4"},
- Name: "My Project!",
- Path: "/tmp/my-project-recreated",
+ ID: "p4",
+ Name: "My Project!",
+ Path: "/tmp/my-project-recreated",
}
require.NoError(t, db.Create(replacement).Error)
@@ -615,9 +611,9 @@ func TestProjectService_GetProjectByComposeName(t *testing.T) {
svc := NewProjectService(db, nil, nil, nil, nil, nil, nil, nil, config.Load())
original := &Project{
- BaseModel: database.BaseModel{ID: "p5"},
- Name: "My App!",
- Path: "/tmp/my-app",
+ ID: "p5",
+ Name: "My App!",
+ Path: "/tmp/my-app",
}
require.NoError(t, db.Create(original).Error)
@@ -680,11 +676,11 @@ func TestProjectService_PullProjectImages_UpdatesCurrentImageRecordAfterPull(t *
dirName := "compose-pull"
projectRecord := &Project{
- BaseModel: database.BaseModel{ID: "project-pull"},
- Name: "compose-pull",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "project-pull",
+ Name: "compose-pull",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(projectRecord).Error)
@@ -1050,11 +1046,11 @@ func TestProjectService_UpdateProjectServicesHardFailsWhenPullFailsInternal(t *t
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "compose.yaml"), []byte("services:\n app:\n image: "+imageRef+"\n"), 0o644))
projectRecord := &Project{
- BaseModel: database.BaseModel{ID: "project-update-pull-fail"},
- Name: "compose-update-pull-fail",
- DirName: ptr("compose-update-pull-fail"),
- Path: projectPath,
- Status: ProjectStatusRunning,
+ ID: "project-update-pull-fail",
+ Name: "compose-update-pull-fail",
+ DirName: new("compose-update-pull-fail"),
+ Path: projectPath,
+ Status: ProjectStatusRunning,
}
require.NoError(t, db.Create(projectRecord).Error)
require.NoError(t, db.Create(&imageupdate.ImageUpdateRecord{
@@ -1123,11 +1119,11 @@ func TestProjectService_UpdateProjectServicesForcesRecreateInternal(t *testing.T
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "compose.yaml"), []byte("services:\n app:\n image: "+imageRef+"\n"), 0o644))
projectRecord := &Project{
- BaseModel: database.BaseModel{ID: "project-update-force"},
- Name: "compose-update-force",
- DirName: ptr("compose-update-force"),
- Path: projectPath,
- Status: ProjectStatusRunning,
+ ID: "project-update-force",
+ Name: "compose-update-force",
+ DirName: new("compose-update-force"),
+ Path: projectPath,
+ Status: ProjectStatusRunning,
}
require.NoError(t, db.Create(projectRecord).Error)
@@ -1233,17 +1229,17 @@ func TestProjectService_UpdateProject_RenameFailsWhenVolumeMigrationPreparationF
require.NoError(t, os.WriteFile(filepath.Join(originalPath, "compose.yaml"), []byte("services:\n app:\n image: nginx:alpine\n volumes:\n - data:/data\nvolumes:\n data:\n driver: local\n"), 0o644))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-volume-conflict"},
- Name: "Foo",
- DirName: &originalDirName,
- Path: originalPath,
- Status: ProjectStatusStopped,
+ ID: "proj-volume-conflict",
+ Name: "Foo",
+ DirName: &originalDirName,
+ Path: originalPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
_, err = svc.UpdateProject(ctx, project.ID, new("bar"), nil, nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.Error(t, err)
@@ -1276,11 +1272,11 @@ func TestProjectService_ApplyProjectUpdateWithRenameJournal_AppliesVolumeMigrati
originalPath := createComposeProjectDir(t, projectsDir, originalDirName)
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-volume-success"},
- Name: "Foo",
- DirName: &originalDirName,
- Path: originalPath,
- Status: ProjectStatusStopped,
+ ID: "proj-volume-success",
+ Name: "Foo",
+ DirName: &originalDirName,
+ Path: originalPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -1351,11 +1347,11 @@ func TestProjectService_PrepareProjectRenameVolumeMigrationForUpdate_UsesCompose
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "compose.yaml"), []byte(oldCompose), 0o644))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-preview-volume-rename"},
- Name: "nginx",
- DirName: ptr("nginx"),
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-preview-volume-rename",
+ Name: "nginx",
+ DirName: new("nginx"),
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
t.Run("skips volume made explicit in pending compose", func(t *testing.T) {
@@ -1448,11 +1444,11 @@ func TestProjectService_ApplyProjectUpdateWithRenameJournal_RollsBackVolumeMigra
originalPath := createComposeProjectDir(t, projectsDir, originalDirName)
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-volume-save-fail"},
- Name: "Foo",
- DirName: &originalDirName,
- Path: originalPath,
- Status: ProjectStatusStopped,
+ ID: "proj-volume-save-fail",
+ Name: "Foo",
+ DirName: &originalDirName,
+ Path: originalPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -1493,11 +1489,11 @@ func TestProjectService_ApplyProjectUpdateWithRenameJournal_SucceedsCommittedRen
originalPath := createComposeProjectDir(t, projectsDir, originalDirName)
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-volume-cleanup-fail"},
- Name: "Foo",
- DirName: &originalDirName,
- Path: originalPath,
- Status: ProjectStatusStopped,
+ ID: "proj-volume-cleanup-fail",
+ Name: "Foo",
+ DirName: &originalDirName,
+ Path: originalPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -1540,11 +1536,11 @@ func TestProjectService_UpdateProject_ClearsJournalForNonRenameWhenRecoveryDocke
oldDir := "nginx"
projectPath := createComposeProjectDir(t, projectsDir, oldDir)
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-non-rename-recovery-docker-unavailable"},
- Name: "nginx",
- DirName: &oldDir,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-non-rename-recovery-docker-unavailable",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -1571,8 +1567,8 @@ func TestProjectService_UpdateProject_ClearsJournalForNonRenameWhenRecoveryDocke
envContent := "FOO=bar\n"
updated, err := svc.UpdateProject(ctx, project.ID, nil, nil, &envContent, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -1606,11 +1602,11 @@ func TestProjectService_UpdateProject_AllowsRenameAfterJournalRecoveryDockerUnav
oldDir := "nginx"
projectPath := createComposeProjectDir(t, projectsDir, oldDir)
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-recovery-docker-unavailable"},
- Name: "nginx",
- DirName: &oldDir,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-recovery-docker-unavailable",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -1635,9 +1631,9 @@ func TestProjectService_UpdateProject_AllowsRenameAfterJournalRecoveryDockerUnav
require.NoError(t, err)
require.NoError(t, kvService.Set(ctx, projectRenameJournalKeyPrefixInternal+project.ID, string(payload)))
- updated, err := svc.UpdateProject(ctx, project.ID, ptr("web"), nil, nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ updated, err := svc.UpdateProject(ctx, project.ID, new("web"), nil, nil, nil, common.User{
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -1669,17 +1665,17 @@ func TestProjectService_UpdateProject_RenamesDirectoryWhenNameChanges(t *testing
originalPath := createComposeProjectDir(t, projectsDir, originalDirName)
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-1"},
- Name: "Foo",
- DirName: &originalDirName,
- Path: originalPath,
- Status: ProjectStatusStopped,
+ ID: "proj-1",
+ Name: "Foo",
+ DirName: &originalDirName,
+ Path: originalPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
updated, err := svc.UpdateProject(ctx, project.ID, new("bar"), nil, nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -1721,17 +1717,17 @@ func TestProjectService_UpdateProject_RenameFailsWhenTargetDirectoryExists(t *te
require.NoError(t, os.MkdirAll(targetPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-2"},
- Name: "Foo",
- DirName: &originalDirName,
- Path: originalPath,
- Status: ProjectStatusStopped,
+ ID: "proj-2",
+ Name: "Foo",
+ DirName: &originalDirName,
+ Path: originalPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
_, err = svc.UpdateProject(ctx, project.ID, new("bar"), nil, nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.Error(t, err)
@@ -1765,17 +1761,17 @@ func TestProjectService_UpdateProject_RenameFailsWhenProjectRunning(t *testing.T
require.NoError(t, os.MkdirAll(originalPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-3"},
- Name: "Foo",
- DirName: &originalDirName,
- Path: originalPath,
- Status: ProjectStatusRunning,
+ ID: "proj-3",
+ Name: "Foo",
+ DirName: &originalDirName,
+ Path: originalPath,
+ Status: ProjectStatusRunning,
}
require.NoError(t, db.Create(project).Error)
_, err = svc.UpdateProject(ctx, project.ID, new("bar"), nil, nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.Error(t, err)
@@ -1824,17 +1820,17 @@ func TestProjectService_UpdateProject_RenameRejectsStaleStoppedWhenRuntimeIsRunn
originalPath := createComposeProjectDir(t, projectsDir, originalDirName)
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-stale-stopped-running-rename"},
- Name: "Foo",
- DirName: &originalDirName,
- Path: originalPath,
- Status: ProjectStatusStopped,
+ ID: "proj-stale-stopped-running-rename",
+ Name: "Foo",
+ DirName: &originalDirName,
+ Path: originalPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
_, err = svc.UpdateProject(ctx, project.ID, new("bar"), nil, nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.Error(t, err)
@@ -1871,7 +1867,7 @@ func TestProjectService_UpdateProject_RenameResolvesUnknownStoppedStatusBeforeVo
statusReason := "stale runtime status"
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-unknown-stopped-rename"},
+ ID: "proj-unknown-stopped-rename",
Name: "Foo",
DirName: &originalDirName,
Path: originalPath,
@@ -1881,8 +1877,8 @@ func TestProjectService_UpdateProject_RenameResolvesUnknownStoppedStatusBeforeVo
require.NoError(t, db.Create(project).Error)
updated, err := svc.UpdateProject(ctx, project.ID, new("bar"), nil, nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -1943,7 +1939,7 @@ func TestProjectService_UpdateProject_RenameRejectsUnknownWhenRuntimeIsRunning(t
statusReason := "stale runtime status"
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-unknown-running-rename"},
+ ID: "proj-unknown-running-rename",
Name: "Foo",
DirName: &originalDirName,
Path: originalPath,
@@ -1953,8 +1949,8 @@ func TestProjectService_UpdateProject_RenameRejectsUnknownWhenRuntimeIsRunning(t
require.NoError(t, db.Create(project).Error)
_, err = svc.UpdateProject(ctx, project.ID, new("bar"), nil, nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.Error(t, err)
@@ -1989,11 +1985,11 @@ func TestProjectService_UpdateProject_ValidatesComposeUsingExistingProjectName(t
require.NoError(t, os.MkdirAll(projectPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-compose-name"},
- Name: "demo",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-compose-name",
+ Name: "demo",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -2005,8 +2001,8 @@ services:
env := "COMPOSE_PROJECT_NAME=\n"
updated, err := svc.UpdateProject(ctx, project.ID, nil, new(compose), new(env), nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2032,11 +2028,11 @@ func TestProjectService_UpdateProject_AllowsMissingEnvFileDuringComposeValidatio
require.NoError(t, os.MkdirAll(projectPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-env-file"},
- Name: "env-required",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-env-file",
+ Name: "env-required",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -2048,8 +2044,8 @@ func TestProjectService_UpdateProject_AllowsMissingEnvFileDuringComposeValidatio
`
updated, err := svc.UpdateProject(ctx, project.ID, nil, new(compose), nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2077,11 +2073,11 @@ func TestProjectService_UpdateProject_AllowsMissingLocalIncludeDuringComposeVali
require.NoError(t, os.MkdirAll(projectPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-missing-include"},
- Name: "include-new",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-missing-include",
+ Name: "include-new",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -2092,9 +2088,9 @@ services:
image: nginx:alpine
`
- updated, err := svc.UpdateProject(ctx, project.ID, nil, ptr(compose), nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ updated, err := svc.UpdateProject(ctx, project.ID, nil, new(compose), nil, nil, common.User{
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2132,8 +2128,8 @@ services:
`
project, err := svc.CreateProject(ctx, "with-external-include", compose, nil, projecttypes.CreateProjectWorkspaceManifest{}, nil, nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, project)
@@ -2160,15 +2156,15 @@ func TestProjectService_UpdateProject_AllowsExternalInclude(t *testing.T) {
require.NoError(t, os.WriteFile(filepath.Join(projectsDir, "shared.yaml"), []byte("services: {}\n"), 0o644))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-external-include"},
- Name: "external-include",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-external-include",
+ Name: "external-include",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
- user := common.User{BaseModel: database.BaseModel{ID: "u1"}, Username: "tester"}
+ user := common.User{ID: "u1", Username: "tester"}
compose := `include:
- ../shared.yaml
@@ -2176,14 +2172,14 @@ services:
app:
image: nginx:alpine
`
- updated, err := svc.UpdateProject(ctx, project.ID, nil, ptr(compose), nil, nil, user)
+ updated, err := svc.UpdateProject(ctx, project.ID, nil, new(compose), nil, nil, user)
require.NoError(t, err)
require.NotNil(t, updated)
override := `include:
- ../shared.yaml
`
- _, err = svc.UpdateProject(ctx, project.ID, nil, nil, nil, ptr(override), user)
+ _, err = svc.UpdateProject(ctx, project.ID, nil, nil, nil, new(override), user)
require.NoError(t, err)
}
@@ -2210,7 +2206,7 @@ func TestProjectService_CreateProject_CommitsWorkspaceAndConfigurationTogether(t
map[int][]byte{0: []byte("workspace content\n")},
nil,
nil,
- common.User{BaseModel: database.BaseModel{ID: "u1"}, Username: "tester"},
+ common.User{ID: "u1", Username: "tester"},
)
require.NoError(t, err)
require.NotNil(t, created)
@@ -2244,7 +2240,7 @@ func TestProjectService_CreateProject_RollsBackInvalidWorkspaceManifest(t *testi
nil,
nil,
nil,
- common.User{BaseModel: database.BaseModel{ID: "u1"}, Username: "tester"},
+ common.User{ID: "u1", Username: "tester"},
)
require.Error(t, err)
require.Nil(t, created)
@@ -2274,11 +2270,11 @@ func TestProjectService_UpdateProject_UsesExistingEnvFileDuringComposeValidation
require.NoError(t, os.WriteFile(filepath.Join(projectPath, ".env"), []byte("FOO=bar\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-existing-env-file"},
- Name: "env-existing",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-existing-env-file",
+ Name: "env-existing",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -2290,8 +2286,8 @@ func TestProjectService_UpdateProject_UsesExistingEnvFileDuringComposeValidation
`
updated, err := svc.UpdateProject(ctx, project.ID, nil, new(compose), nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2323,11 +2319,11 @@ func newProjectServiceForOverrideTestInternal(t *testing.T, dirName, baseCompose
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "compose.yaml"), []byte(baseCompose), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-" + dirName},
- Name: dirName,
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-" + dirName,
+ Name: dirName,
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -2340,8 +2336,8 @@ func TestProjectService_UpdateProject_CreatesOverrideWithDefaultName(t *testing.
override := "services:\n app:\n image: busybox:latest\n"
_, err := svc.UpdateProject(ctx, project.ID, nil, nil, nil, new(override), common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2367,8 +2363,8 @@ func TestProjectService_UpdateProject_PreservesExistingOverrideName(t *testing.T
override := "services:\n app:\n image: busybox:latest\n"
_, err := svc.UpdateProject(ctx, project.ID, nil, nil, nil, new(override), common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2387,8 +2383,8 @@ func TestProjectService_UpdateProject_DeletesOverrideOnBlank(t *testing.T) {
// A non-nil blank override deletes the file so the deploy stops merging it.
_, err := svc.UpdateProject(ctx, project.ID, nil, nil, nil, new(""), common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2405,8 +2401,8 @@ func TestProjectService_UpdateProject_MergedValidationFailureLeavesDiskUnchanged
newCompose := "services:\n app:\n image: nginx:1.27\n"
badOverride := "services:\n app:\n image: \"unterminated\n"
_, err := svc.UpdateProject(ctx, project.ID, nil, new(newCompose), nil, new(badOverride), common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.Error(t, err)
@@ -2434,11 +2430,11 @@ func TestProjectService_UpdateProject_UsesProvidedEnvContentDuringComposeValidat
require.NoError(t, os.MkdirAll(projectPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-new-env-file"},
- Name: "env-updated",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-new-env-file",
+ Name: "env-updated",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -2451,8 +2447,8 @@ func TestProjectService_UpdateProject_UsesProvidedEnvContentDuringComposeValidat
env := "FOO=updated\n"
updated, err := svc.UpdateProject(ctx, project.ID, nil, new(compose), new(env), nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2481,11 +2477,11 @@ func TestProjectService_UpdateProject_ReturnsEnvParseErrorDuringComposeValidatio
require.NoError(t, os.MkdirAll(projectPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-invalid-env-file"},
- Name: "env-invalid",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-invalid-env-file",
+ Name: "env-invalid",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -2498,8 +2494,8 @@ func TestProjectService_UpdateProject_ReturnsEnvParseErrorDuringComposeValidatio
env := "BROKEN=${UNTERMINATED\n"
updated, err := svc.UpdateProject(ctx, project.ID, nil, new(compose), new(env), nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.Error(t, err)
@@ -2527,11 +2523,11 @@ func TestProjectService_UpdateProject_UsesGlobalEnvDuringComposeValidation(t *te
require.NoError(t, os.WriteFile(filepath.Join(projectsDir, projects.GlobalEnvFileName), []byte("DATA_NAS_FOLDER=/srv/media\nMYPATH=/containers/\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-global-env-update"},
- Name: dirName,
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-global-env-update",
+ Name: dirName,
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -2544,8 +2540,8 @@ func TestProjectService_UpdateProject_UsesGlobalEnvDuringComposeValidation(t *te
`
updated, err := svc.UpdateProject(ctx, project.ID, nil, new(compose), nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2576,11 +2572,11 @@ func TestProjectService_UpdateProject_DoesNotResolveHostEnvThroughGlobalEnvDurin
require.NoError(t, os.WriteFile(filepath.Join(projectsDir, projects.GlobalEnvFileName), []byte("DATA_NAS_FOLDER=${HOST_ONLY_PATH}\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-host-env-guard"},
- Name: dirName,
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-host-env-guard",
+ Name: dirName,
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -2592,8 +2588,8 @@ func TestProjectService_UpdateProject_DoesNotResolveHostEnvThroughGlobalEnvDurin
`
updated, err := svc.UpdateProject(ctx, project.ID, nil, new(compose), nil, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.Error(t, err)
@@ -2622,17 +2618,17 @@ func TestProjectService_UpdateProject_DerivesProjectOverrideEnvWhenGitSourceExis
require.NoError(t, os.WriteFile(filepath.Join(projectPath, ".env.git"), []byte("BASE=git\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-override-edit"},
- Name: "override-edit",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-override-edit",
+ Name: "override-edit",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
updated, err := svc.UpdateProject(ctx, project.ID, nil, nil, new("BASE=git\nLOCAL_ONLY=example\n"), nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2674,17 +2670,17 @@ func TestProjectService_UpdateProject_UnchangedGitEnvLeavesFilesUntouched(t *tes
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "project.env"), []byte(overrideContent), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-unchanged-git-env"},
- Name: dirName,
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-unchanged-git-env",
+ Name: dirName,
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
updated, err := svc.UpdateProject(ctx, project.ID, nil, nil, &effectiveContent, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
@@ -2767,17 +2763,17 @@ func TestProjectService_UpdateProject_DeletingGitBackedKeyFallsBackToGit(t *test
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "project.env"), []byte("TOKEN=local\nLOCAL_ONLY=1\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-override-delete"},
- Name: "override-delete",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-override-delete",
+ Name: "override-delete",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
updated, err := svc.UpdateProject(ctx, project.ID, nil, nil, new("BASE=git\nLOCAL_ONLY=1\n"), nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -2815,18 +2811,18 @@ func TestProjectService_ApplyGitSyncProjectFiles_MigratesDirectEnvIntoProjectOve
require.NoError(t, os.WriteFile(filepath.Join(projectPath, ".env"), []byte("TOKEN=stale-local\nLOCAL_ONLY=1\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-git-sync-migrate"},
- Name: "git-sync-migrate",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-git-sync-migrate",
+ Name: "git-sync-migrate",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
gitEnv := "TOKEN=git\nREMOTE_ONLY=1\n"
updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:alpine\n", &gitEnv, nil, "", common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
@@ -2865,11 +2861,11 @@ func TestProjectService_ApplyGitSyncProjectFiles_PreservesGitEnvSyntax(t *testin
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "compose.yaml"), []byte("services:\n app:\n image: nginx:alpine\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-git-sync-env-syntax"},
- Name: dirName,
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-git-sync-env-syntax",
+ Name: dirName,
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -2883,8 +2879,8 @@ func TestProjectService_ApplyGitSyncProjectFiles_PreservesGitEnvSyntax(t *testin
for range 2 {
updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, compose, &gitEnv, nil, "", common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
@@ -2929,17 +2925,17 @@ func TestProjectService_ApplyGitSyncProjectFiles_NormalizesStaleCopiedGitOverrid
require.NoError(t, os.WriteFile(filepath.Join(projectPath, ".env"), []byte("BASE=git\nSHARED=1\nTOKEN=local\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-git-sync-normalize"},
- Name: "git-sync-normalize",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-git-sync-normalize",
+ Name: "git-sync-normalize",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:alpine\n", new("BASE=git-updated\nSHARED=1\nREMOTE_ONLY=1\n"), nil, "", common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
@@ -2977,17 +2973,17 @@ func TestProjectService_ApplyGitSyncProjectFiles_RemovesLegacyDeletedGitMasks(t
require.NoError(t, os.WriteFile(filepath.Join(projectPath, ".env"), []byte("LOCAL_ONLY=1\nSHARED=1\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-git-sync-delete-mask"},
- Name: "git-sync-delete-mask",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-git-sync-delete-mask",
+ Name: "git-sync-delete-mask",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:alpine\n", new("TOKEN=git-updated\nSHARED=1\nREMOTE_ONLY=1\n"), nil, "", common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
@@ -3025,17 +3021,17 @@ func TestProjectService_ApplyGitSyncProjectFiles_RemovesGitEnvSource(t *testing.
require.NoError(t, os.WriteFile(filepath.Join(projectPath, ".env.git"), []byte("BASE=git\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-git-sync-remove"},
- Name: "git-sync-remove",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-git-sync-remove",
+ Name: "git-sync-remove",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:alpine\n", nil, nil, "", common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
@@ -3067,18 +3063,18 @@ func TestProjectService_ApplyGitSyncProjectFiles_WritesAndRemovesComposeOverride
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "compose.yaml"), []byte("services:\n app:\n image: nginx:alpine\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-git-sync-override"},
- Name: dirName,
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-git-sync-override",
+ Name: dirName,
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
overrideContent := "services:\n app:\n image: busybox:latest\n"
updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:alpine\n", nil, new(overrideContent), "compose.override.yaml", common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
@@ -3089,8 +3085,8 @@ func TestProjectService_ApplyGitSyncProjectFiles_WritesAndRemovesComposeOverride
// A subsequent sync without an override removes the previously synced file.
updated, err = svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:alpine\n", nil, nil, "", common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
@@ -3118,11 +3114,11 @@ func TestProjectService_ApplyGitSyncProjectFiles_UsesGlobalEnvDuringComposeValid
require.NoError(t, os.WriteFile(filepath.Join(projectsDir, projects.GlobalEnvFileName), []byte("DATA_NAS_FOLDER=/srv/media\nMYPATH=/containers/\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-git-sync-global-env"},
- Name: dirName,
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-git-sync-global-env",
+ Name: dirName,
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -3135,8 +3131,8 @@ func TestProjectService_ApplyGitSyncProjectFiles_UsesGlobalEnvDuringComposeValid
`
updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, compose, nil, nil, "", common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
@@ -3178,17 +3174,17 @@ func TestProjectService_ApplyGitSyncProjectFiles_TolerantOfUndefinedComposeVar(t
`
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-git-sync-undefined-var"},
- Name: dirName,
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-git-sync-undefined-var",
+ Name: dirName,
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, compose, nil, nil, "", common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
@@ -3258,11 +3254,11 @@ func TestProjectService_GetProjectDetails_ReturnsEffectiveEnvContent(t *testing.
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "project.env"), []byte("TOKEN=secret\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-details-override"},
- Name: "details-override",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-details-override",
+ Name: "details-override",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -3393,11 +3389,11 @@ func TestProjectService_GetProjectDetails_IncludesUpdateInfo(t *testing.T) {
require.NoError(t, os.WriteFile(filepath.Join(projectPath, "compose.yaml"), []byte("services:\n app:\n image: nginx:latest\n"), 0o644))
projectRecord := &Project{
- BaseModel: database.BaseModel{ID: "proj-update-info"},
- Name: "updates-demo",
- DirName: ptr("updates-demo"),
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-update-info",
+ Name: "updates-demo",
+ DirName: new("updates-demo"),
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(projectRecord).Error)
@@ -3476,9 +3472,9 @@ func TestProjectService_GetProjectDetails_RefreshesRuntimeStatusWithoutRuntimeSe
t.Setenv("DOCKER_HOST", dockerHostFromProjectRuntimeServerURLInternal(t, server.URL))
projectRecord := &Project{
- BaseModel: database.BaseModel{ID: "proj-runtime-refresh"},
+ ID: "proj-runtime-refresh",
Name: "projectA",
- DirName: ptr("projectA"),
+ DirName: new("projectA"),
Path: projectPath,
Status: ProjectStatusStopped,
ServiceCount: 2,
@@ -3528,9 +3524,9 @@ func TestProjectService_GetProjectDetails_PopulatesRuntimeServicesFromComposePs(
t.Setenv("DOCKER_HOST", dockerHostFromProjectRuntimeServerURLInternal(t, server.URL))
projectRecord := &Project{
- BaseModel: database.BaseModel{ID: "proj-runtime-services"},
+ ID: "proj-runtime-services",
Name: "projectA",
- DirName: ptr("projectA"),
+ DirName: new("projectA"),
Path: projectPath,
Status: ProjectStatusStopped,
ServiceCount: 1,
@@ -3574,32 +3570,32 @@ func TestProjectService_ListProjects_FiltersByUpdateStatus(t *testing.T) {
require.NoError(t, os.WriteFile(filepath.Join(unknownPath, "compose.yaml"), []byte("services:\n app:\n image: alpine:latest\n"), 0o644))
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "project-updated"},
- Name: "updated-demo",
- DirName: ptr("updated-demo"),
- Path: updatedPath,
- Status: ProjectStatusStopped,
+ ID: "project-updated",
+ Name: "updated-demo",
+ DirName: new("updated-demo"),
+ Path: updatedPath,
+ Status: ProjectStatusStopped,
}).Error)
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "project-current"},
- Name: "current-demo",
- DirName: ptr("current-demo"),
- Path: upToDatePath,
- Status: ProjectStatusStopped,
+ ID: "project-current",
+ Name: "current-demo",
+ DirName: new("current-demo"),
+ Path: upToDatePath,
+ Status: ProjectStatusStopped,
}).Error)
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "project-error"},
- Name: "error-demo",
- DirName: ptr("error-demo"),
- Path: errorPath,
- Status: ProjectStatusStopped,
+ ID: "project-error",
+ Name: "error-demo",
+ DirName: new("error-demo"),
+ Path: errorPath,
+ Status: ProjectStatusStopped,
}).Error)
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "project-unknown"},
- Name: "unknown-demo",
- DirName: ptr("unknown-demo"),
- Path: unknownPath,
- Status: ProjectStatusStopped,
+ ID: "project-unknown",
+ Name: "unknown-demo",
+ DirName: new("unknown-demo"),
+ Path: unknownPath,
+ Status: ProjectStatusStopped,
}).Error)
now := time.Now().UTC()
@@ -3629,7 +3625,7 @@ func TestProjectService_ListProjects_FiltersByUpdateStatus(t *testing.T) {
UpdateType: "error",
CurrentVersion: "latest",
CheckTime: now.Add(-2 * time.Minute),
- LastError: ptr("registry timeout"),
+ LastError: new("registry timeout"),
}).Error)
tests := []struct {
@@ -3649,8 +3645,8 @@ func TestProjectService_ListProjects_FiltersByUpdateStatus(t *testing.T) {
Filters: map[string]string{
"updates": tt.filter,
},
- Params: pagination.Params{Limit: -1},
- SortParams: pagination.SortParams{Sort: "name", Order: pagination.SortAsc},
+ Limit: -1,
+ Sort: "name", Order: pagination.SortAsc,
})
require.NoError(t, err)
require.EqualValues(t, len(tt.expected), page.TotalItems)
@@ -3777,16 +3773,16 @@ func TestProjectService_ListProjects_FiltersArchivedProjects(t *testing.T) {
activePath := createComposeProjectDir(t, projectsRoot, "active-demo")
archivedPath := createComposeProjectDir(t, projectsRoot, "archived-demo")
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "project-active"},
- Name: "active-demo",
- DirName: ptr("active-demo"),
- Path: activePath,
- Status: ProjectStatusStopped,
+ ID: "project-active",
+ Name: "active-demo",
+ DirName: new("active-demo"),
+ Path: activePath,
+ Status: ProjectStatusStopped,
}).Error)
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "project-archived"},
+ ID: "project-archived",
Name: "archived-demo",
- DirName: ptr("archived-demo"),
+ DirName: new("archived-demo"),
Path: archivedPath,
Status: ProjectStatusStopped,
IsArchived: true,
@@ -3796,8 +3792,8 @@ func TestProjectService_ListProjects_FiltersArchivedProjects(t *testing.T) {
svc := NewProjectService(db, settingsService, nil, nil, nil, nil, nil, nil, config.Load())
items, page, err := svc.ListProjects(ctx, pagination.QueryParams{
- Params: pagination.Params{Limit: -1},
- SortParams: pagination.SortParams{Sort: "name", Order: pagination.SortAsc},
+ Limit: -1,
+ Sort: "name", Order: pagination.SortAsc,
})
require.NoError(t, err)
require.EqualValues(t, 1, page.TotalItems)
@@ -3805,9 +3801,9 @@ func TestProjectService_ListProjects_FiltersArchivedProjects(t *testing.T) {
assert.Equal(t, "active-demo", items[0].Name)
items, page, err = svc.ListProjects(ctx, pagination.QueryParams{
- Filters: map[string]string{"archived": "true"},
- Params: pagination.Params{Limit: -1},
- SortParams: pagination.SortParams{Sort: "name", Order: pagination.SortAsc},
+ Filters: map[string]string{"archived": "true"},
+ Limit: -1,
+ Sort: "name", Order: pagination.SortAsc,
})
require.NoError(t, err)
require.EqualValues(t, 1, page.TotalItems)
@@ -3816,9 +3812,9 @@ func TestProjectService_ListProjects_FiltersArchivedProjects(t *testing.T) {
assert.True(t, items[0].IsArchived)
items, page, err = svc.ListProjects(ctx, pagination.QueryParams{
- Filters: map[string]string{"archived": "all"},
- Params: pagination.Params{Limit: -1},
- SortParams: pagination.SortParams{Sort: "name", Order: pagination.SortAsc},
+ Filters: map[string]string{"archived": "all"},
+ Limit: -1,
+ Sort: "name", Order: pagination.SortAsc,
})
require.NoError(t, err)
require.EqualValues(t, 2, page.TotalItems)
@@ -3838,11 +3834,11 @@ func TestProjectService_ArchiveProject_RequiresStoppedProject(t *testing.T) {
projectPath := createComposeProjectDir(t, projectsRoot, "running-demo")
// DB row says stopped; the live Docker state below is what must block the archive.
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "project-running"},
- Name: "running-demo",
- DirName: ptr("running-demo"),
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "project-running",
+ Name: "running-demo",
+ DirName: new("running-demo"),
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}).Error)
configureProjectRuntimeDockerInternal(t, []container.Summary{
@@ -3862,7 +3858,7 @@ func TestProjectService_ArchiveProject_RequiresStoppedProject(t *testing.T) {
})
svc := NewProjectService(db, settingsService, nil, nil, nil, nil, nil, nil, config.Load())
- err = svc.ArchiveProject(ctx, "project-running", common.User{BaseModel: database.BaseModel{ID: "user-1"}, Username: "tester"})
+ err = svc.ArchiveProject(ctx, "project-running", common.User{ID: "user-1", Username: "tester"})
require.Error(t, err)
require.ErrorIs(t, err, common.ErrProjectMustBeStopped)
@@ -3883,17 +3879,17 @@ func TestProjectService_ArchiveProject_TogglesArchiveFlag(t *testing.T) {
projectPath := createComposeProjectDir(t, projectsRoot, "stopped-demo")
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "project-stopped"},
- Name: "stopped-demo",
- DirName: ptr("stopped-demo"),
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "project-stopped",
+ Name: "stopped-demo",
+ DirName: new("stopped-demo"),
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}).Error)
configureProjectRuntimeDockerInternal(t, nil)
svc := NewProjectService(db, settingsService, nil, nil, nil, nil, nil, nil, config.Load())
- user := common.User{BaseModel: database.BaseModel{ID: "user-1"}, Username: "tester"}
+ user := common.User{ID: "user-1", Username: "tester"}
require.NoError(t, svc.ArchiveProject(ctx, "project-stopped", user))
var stored Project
@@ -3919,27 +3915,27 @@ func TestProjectService_ArchiveProject_LiveVerificationErrorPolicy(t *testing.T)
unreachablePath := createComposeProjectDir(t, projectsRoot, "unreachable-demo")
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "project-unreachable"},
- Name: "unreachable-demo",
- DirName: ptr("unreachable-demo"),
- Path: unreachablePath,
- Status: ProjectStatusStopped,
+ ID: "project-unreachable",
+ Name: "unreachable-demo",
+ DirName: new("unreachable-demo"),
+ Path: unreachablePath,
+ Status: ProjectStatusStopped,
}).Error)
noComposePath := filepath.Join(projectsRoot, "no-compose-demo")
require.NoError(t, os.MkdirAll(noComposePath, 0o755))
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "project-no-compose"},
- Name: "no-compose-demo",
- DirName: ptr("no-compose-demo"),
- Path: noComposePath,
- Status: ProjectStatusStopped,
+ ID: "project-no-compose",
+ Name: "no-compose-demo",
+ DirName: new("no-compose-demo"),
+ Path: noComposePath,
+ Status: ProjectStatusStopped,
}).Error)
t.Setenv("DOCKER_HOST", "tcp://127.0.0.1:1")
svc := NewProjectService(db, settingsService, nil, nil, nil, nil, nil, nil, config.Load())
- user := common.User{BaseModel: database.BaseModel{ID: "user-1"}, Username: "tester"}
+ user := common.User{ID: "user-1", Username: "tester"}
err = svc.ArchiveProject(ctx, "project-unreachable", user)
require.Error(t, err)
@@ -3960,11 +3956,9 @@ func TestProjectService_MapProjectToDto_SetsRedeployDisabledFromRuntimeServices(
Name: "arcane",
Path: projectPath,
ServiceCount: 1,
- BaseModel: database.BaseModel{
- ID: "project-arcane",
- CreatedAt: now,
- UpdatedAt: &now,
- },
+ ID: "project-arcane",
+ CreatedAt: now,
+ UpdatedAt: &now,
}
tests := []struct {
@@ -4070,11 +4064,11 @@ func TestProjectService_ListProjects_WithDerivedStatusFilter_AllowsAllPageSizeSe
for i := range 25 {
projectPath := createComposeProjectDir(t, projectsRoot, fmt.Sprintf("stopped-%02d", i))
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: fmt.Sprintf("project-%02d", i)},
- Name: fmt.Sprintf("stopped-%02d", i),
- DirName: ptr(fmt.Sprintf("stopped-%02d", i)),
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: fmt.Sprintf("project-%02d", i),
+ Name: fmt.Sprintf("stopped-%02d", i),
+ DirName: new(fmt.Sprintf("stopped-%02d", i)),
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}).Error)
}
@@ -4084,8 +4078,8 @@ func TestProjectService_ListProjects_WithDerivedStatusFilter_AllowsAllPageSizeSe
Filters: map[string]string{
"status": string(ProjectStatusStopped),
},
- Params: pagination.Params{Limit: -1},
- SortParams: pagination.SortParams{Sort: "name", Order: pagination.SortAsc},
+ Limit: -1,
+ Sort: "name", Order: pagination.SortAsc,
})
require.NoError(t, err)
assert.EqualValues(t, 25, page.TotalItems)
@@ -4308,17 +4302,17 @@ func TestProjectService_DeployProject_StopsOnBuildPreparationError(t *testing.T)
require.NoError(t, settingsService.SetStringSetting(ctx, "projectsDirectory", projectsRoot+":"+projectsRoot))
proj := &Project{
- BaseModel: database.BaseModel{ID: "p1"},
- Name: "demo",
- Path: projectDir,
- Status: ProjectStatusStopped,
+ ID: "p1",
+ Name: "demo",
+ Path: projectDir,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(proj).Error)
buildSvc := testBuildBuilder{err: errors.New("boom build")}
svc := NewProjectService(db, settingsService, nil, nil, nil, buildSvc, nil, nil, config.Load())
- err = svc.DeployProject(ctx, "p1", common.User{BaseModel: database.BaseModel{ID: "u1"}, Username: "tester"}, nil)
+ err = svc.DeployProject(ctx, "p1", common.User{ID: "u1", Username: "tester"}, nil)
require.Error(t, err)
assert.Contains(t, err.Error(), "failed to prepare project images for deploy")
assert.Contains(t, err.Error(), "boom build")
@@ -4350,17 +4344,17 @@ func TestProjectService_DeployProject_BuildsGeneratedImageWithoutPull(t *testing
require.NoError(t, settingsService.SetStringSetting(ctx, "projectsDirectory", projectsRoot+":"+projectsRoot))
proj := &Project{
- BaseModel: database.BaseModel{ID: "p-generated"},
- Name: "build-test",
- Path: projectDir,
- Status: ProjectStatusStopped,
+ ID: "p-generated",
+ Name: "build-test",
+ Path: projectDir,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(proj).Error)
buildSvc := testBuildBuilder{err: errors.New("boom build")}
svc := NewProjectService(db, settingsService, nil, nil, nil, buildSvc, nil, nil, config.Load())
- err = svc.DeployProject(ctx, proj.ID, common.User{BaseModel: database.BaseModel{ID: "u1"}, Username: "tester"}, nil)
+ err = svc.DeployProject(ctx, proj.ID, common.User{ID: "u1", Username: "tester"}, nil)
require.Error(t, err)
assert.Contains(t, err.Error(), "failed to prepare project images for deploy")
assert.Contains(t, err.Error(), "boom build")
@@ -4465,8 +4459,8 @@ func TestProjectService_SyncProjectsFromFileSystem_DiscoversNestedProjectsAndRel
require.NoError(t, svc.SyncProjectsFromFileSystem(ctx))
items, page, err := svc.ListProjects(ctx, pagination.QueryParams{
- SortParams: pagination.SortParams{Sort: "path", Order: pagination.SortAsc},
- Params: pagination.Params{Limit: -1},
+ Sort: "path", Order: pagination.SortAsc,
+ Limit: -1,
})
require.NoError(t, err)
require.EqualValues(t, 2, page.TotalItems)
@@ -4546,8 +4540,8 @@ services:
require.NoError(t, svc.SyncProjectsFromFileSystem(ctx))
items, page, err := svc.ListProjects(ctx, pagination.QueryParams{
- SortParams: pagination.SortParams{Sort: "path", Order: pagination.SortAsc},
- Params: pagination.Params{Limit: -1},
+ Sort: "path", Order: pagination.SortAsc,
+ Limit: -1,
})
require.NoError(t, err)
require.EqualValues(t, 1, page.TotalItems)
@@ -4644,10 +4638,10 @@ func TestProjectService_SyncProjectsFromFileSystem_PrunesLeakedScratchRow(t *tes
scratchName := ".gitops-backup-9"
scratchPath := createComposeProjectDir(t, projectsRoot, scratchName)
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "phantom-scratch"},
- Name: scratchName,
- DirName: &scratchName,
- Path: scratchPath,
+ ID: "phantom-scratch",
+ Name: scratchName,
+ DirName: &scratchName,
+ Path: scratchPath,
}).Error)
svc := NewProjectService(db, settingsService, nil, nil, nil, nil, nil, nil, config.Load())
@@ -4844,11 +4838,11 @@ func TestProjectService_SyncProjectsFromFileSystem_DiscoversReadableProjectsDesp
// now-unreadable subtree, simulating a project Arcane previously knew about.
strandedDirName := "stranded-project"
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: "stranded-under-unreadable"},
- Name: "stranded-project",
- DirName: &strandedDirName,
- Path: filepath.Join(unreadableDir, "stranded-project"),
- Status: ProjectStatusStopped,
+ ID: "stranded-under-unreadable",
+ Name: "stranded-project",
+ DirName: &strandedDirName,
+ Path: filepath.Join(unreadableDir, "stranded-project"),
+ Status: ProjectStatusStopped,
}).Error)
require.NoError(t, settingsService.SetStringSetting(ctx, "projectsDirectory", projectsRoot))
@@ -4924,8 +4918,8 @@ func TestProjectService_SyncProjectsFromFileSystem_DetectsNestedSymlinkedProject
require.NoError(t, svc.SyncProjectsFromFileSystem(ctx))
items, page, err := svc.ListProjects(ctx, pagination.QueryParams{
- SortParams: pagination.SortParams{Sort: "path", Order: pagination.SortAsc},
- Params: pagination.Params{Limit: -1},
+ Sort: "path", Order: pagination.SortAsc,
+ Limit: -1,
})
require.NoError(t, err)
require.EqualValues(t, 1, page.TotalItems)
@@ -5038,11 +5032,11 @@ func TestProjectService_SyncProjectsFromFileSystem_PreservesValidCustomNameWitho
projectPath := createComposeProjectDir(t, projectsRoot, "folder-name")
dirName := "folder-name"
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-custom-name"},
- Name: "custom-name",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-custom-name",
+ Name: "custom-name",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5073,7 +5067,7 @@ func TestProjectService_SyncProjectsFromFileSystem_PreservesGitOpsProjectWithCus
syncProjectID := "proj-custom-compose"
syncID := "sync-custom-compose"
sync := &GitOpsSync{
- BaseModel: database.BaseModel{ID: syncID},
+ ID: syncID,
Name: "Radarr Sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -5085,9 +5079,9 @@ func TestProjectService_SyncProjectsFromFileSystem_PreservesGitOpsProjectWithCus
require.NoError(t, db.Create(sync).Error)
project := &Project{
- BaseModel: database.BaseModel{ID: syncProjectID},
+ ID: syncProjectID,
Name: "Radarr",
- DirName: ptr("Radarr-3"),
+ DirName: new("Radarr-3"),
Path: projectDir,
Status: ProjectStatusStopped,
GitOpsManagedBy: &syncID,
@@ -5125,7 +5119,7 @@ func TestProjectService_GetProjectDetails_UsesGitOpsCustomComposeFilename(t *tes
syncProjectID := "proj-custom-compose-details"
syncID := "sync-custom-compose-details"
require.NoError(t, db.Create(&GitOpsSync{
- BaseModel: database.BaseModel{ID: syncID},
+ ID: syncID,
Name: "Radarr Sync",
EnvironmentID: "0",
RepositoryID: "repo-1",
@@ -5136,9 +5130,9 @@ func TestProjectService_GetProjectDetails_UsesGitOpsCustomComposeFilename(t *tes
}).Error)
require.NoError(t, db.Create(&Project{
- BaseModel: database.BaseModel{ID: syncProjectID},
+ ID: syncProjectID,
Name: "Radarr",
- DirName: ptr("Radarr-3"),
+ DirName: new("Radarr-3"),
Path: projectDir,
Status: ProjectStatusStopped,
GitOpsManagedBy: &syncID,
@@ -5181,11 +5175,11 @@ func TestProjectService_UpdateProject_WritesThroughSymlinkedProjectPath(t *testi
svc := NewProjectService(db, settingsService, eventService, nil, nil, nil, nil, nil, config.Load())
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-symlink-update"},
- Name: "demo",
- DirName: new("demo"),
- Path: linkPath,
- Status: ProjectStatusStopped,
+ ID: "proj-symlink-update",
+ Name: "demo",
+ DirName: new("demo"),
+ Path: linkPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5193,8 +5187,8 @@ func TestProjectService_UpdateProject_WritesThroughSymlinkedProjectPath(t *testi
updatedEnv := "FOO=updated\n"
updated, err := svc.UpdateProject(ctx, project.ID, nil, new(updatedCompose), new(updatedEnv), nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -5236,18 +5230,18 @@ func TestProjectService_UpdateProject_WritesThroughExternalEnvSymlink(t *testing
svc := NewProjectService(db, settingsService, eventService, nil, nil, nil, nil, nil, config.Load())
dirName := "demo"
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-external-env-symlink-update"},
- Name: dirName,
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-external-env-symlink-update",
+ Name: dirName,
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
updatedEnv := "FOO=updated\n"
updated, err := svc.UpdateProject(ctx, project.ID, nil, nil, &updatedEnv, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
@@ -5295,11 +5289,11 @@ func TestProjectService_UpdateProject_RestoresExternalEnvSymlinkTargetWhenProjec
svc := NewProjectService(db, settingsService, eventService, nil, nil, nil, nil, nil, config.Load())
dirName := "demo"
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-external-env-symlink-rollback"},
- Name: dirName,
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-external-env-symlink-rollback",
+ Name: dirName,
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5311,8 +5305,8 @@ func TestProjectService_UpdateProject_RestoresExternalEnvSymlinkTargetWhenProjec
updatedEnv := "FOO=updated\n"
_, err = svc.UpdateProject(ctx, project.ID, nil, nil, &updatedEnv, nil, common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.Error(t, err)
assert.Contains(t, err.Error(), "forced project save failure")
@@ -5408,10 +5402,6 @@ func dockerHostFromProjectRuntimeServerURLInternal(t *testing.T, serverURL strin
return "tcp://" + parsed.Host
}
-func ptr(v string) *string {
- return new(v)
-}
-
func TestResolveRemoveOrphans(t *testing.T) {
tests := []struct {
name string
@@ -5448,11 +5438,11 @@ func TestProjectService_RecoverProjectRenameJournals_RollsBackUncommittedDirecto
require.NoError(t, os.WriteFile(filepath.Join(newPath, "compose.yaml"), []byte("services: {}\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-recovery"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-recovery",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5502,11 +5492,11 @@ func TestProjectService_RecoverProjectRenameJournals_StartedPhaseSkipsVolumeRoll
require.NoError(t, os.WriteFile(filepath.Join(oldPath, "compose.yaml"), []byte("services: {}\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-started-volume-recovery"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-started-volume-recovery",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5565,11 +5555,11 @@ func TestProjectService_RecoverProjectRenameJournals_RelocatesTargetWhenBothPath
require.NoError(t, os.WriteFile(filepath.Join(newPath, "compose.yaml"), []byte("services: {}\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-both-paths"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-both-paths",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5628,11 +5618,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsStartedJournalWhenDir
newPath := filepath.Join(projectsDir, newDir)
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-missing-paths"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-missing-paths",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5674,11 +5664,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsPreservedTargetJourna
require.NoError(t, os.MkdirAll(oldPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-preserved-target"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-preserved-target",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5755,11 +5745,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsCommittedJournal(t *t
require.NoError(t, os.MkdirAll(newPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-committed"},
- Name: "web",
- DirName: &newDir,
- Path: newPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-committed",
+ Name: "web",
+ DirName: &newDir,
+ Path: newPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5795,11 +5785,11 @@ func TestProjectService_FinalizeProjectRenameAfterCommit_ClearsJournalAfterSourc
oldDir := "nginx"
newDir := "web"
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-old-volumes-removed"},
- Name: "web",
- DirName: &newDir,
- Path: filepath.Join(t.TempDir(), newDir),
- Status: ProjectStatusStopped,
+ ID: "proj-rename-old-volumes-removed",
+ Name: "web",
+ DirName: &newDir,
+ Path: filepath.Join(t.TempDir(), newDir),
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5836,11 +5826,11 @@ func TestProjectService_FinalizeProjectRenameAfterCommit_KeepsJournalWhenSourceC
oldDir := "nginx"
newDir := "web"
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-cleanup-failure"},
- Name: "web",
- DirName: &newDir,
- Path: filepath.Join(t.TempDir(), newDir),
- Status: ProjectStatusStopped,
+ ID: "proj-rename-cleanup-failure",
+ Name: "web",
+ DirName: &newDir,
+ Path: filepath.Join(t.TempDir(), newDir),
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -5920,11 +5910,11 @@ func TestProjectService_RecoverProjectRenameJournals_KeepsJournalWhenDirectoryRo
require.NoError(t, os.WriteFile(filepath.Join(newPath, "compose.yaml"), []byte("services: {}\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-directory-rollback-fails"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-directory-rollback-fails",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6014,11 +6004,11 @@ func TestProjectService_RecoverProjectRenameJournals_CompletesCommittedVolumeJou
require.NoError(t, os.MkdirAll(newPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-committed-with-volumes"},
- Name: "web",
- DirName: &newDir,
- Path: newPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-committed-with-volumes",
+ Name: "web",
+ DirName: &newDir,
+ Path: newPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6087,11 +6077,11 @@ func TestProjectService_RecoverProjectRenameJournals_RollsBackCommittedJournalWh
require.NoError(t, os.MkdirAll(newPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-missing-target-preserve-source"},
- Name: "web",
- DirName: &newDir,
- Path: newPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-missing-target-preserve-source",
+ Name: "web",
+ DirName: &newDir,
+ Path: newPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6197,11 +6187,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsJournalAfterDBRestore
require.NoError(t, os.WriteFile(filepath.Join(newPath, "compose.yaml"), []byte("services: {}\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-rollback-volume-fail"},
- Name: "web",
- DirName: &newDir,
- Path: newPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-rollback-volume-fail",
+ Name: "web",
+ DirName: &newDir,
+ Path: newPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6275,11 +6265,11 @@ func TestProjectService_RecoverProjectRenameJournals_KeepsRollbackCleanupWhenDoc
require.NoError(t, os.MkdirAll(oldPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-rollback-cleanup-docker-unavailable"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-rollback-cleanup-docker-unavailable",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6337,11 +6327,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsCommittedJournalWhenS
require.NoError(t, os.MkdirAll(newPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-missing-both-volumes"},
- Name: "web",
- DirName: &newDir,
- Path: newPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-missing-both-volumes",
+ Name: "web",
+ DirName: &newDir,
+ Path: newPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6423,11 +6413,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsCommittedJournalAndCl
require.NoError(t, os.MkdirAll(newPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-mixed-missing-volumes"},
- Name: "web",
- DirName: &newDir,
- Path: newPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-mixed-missing-volumes",
+ Name: "web",
+ DirName: &newDir,
+ Path: newPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6506,11 +6496,11 @@ func TestProjectService_RecoverProjectRenameJournals_MarksSourceCleanupPendingWh
require.NoError(t, os.MkdirAll(newPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-source-cleanup-fail"},
- Name: "web",
- DirName: &newDir,
- Path: newPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-source-cleanup-fail",
+ Name: "web",
+ DirName: &newDir,
+ Path: newPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6591,11 +6581,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsSourceCleanupPendingJ
require.NoError(t, os.MkdirAll(newPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-source-cleanup-pending-clear"},
- Name: "web",
- DirName: &newDir,
- Path: newPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-source-cleanup-pending-clear",
+ Name: "web",
+ DirName: &newDir,
+ Path: newPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6690,11 +6680,11 @@ func TestProjectService_RecoverProjectRenameJournals_RollsBackSourceCleanupPendi
require.NoError(t, os.WriteFile(filepath.Join(newPath, "compose.yaml"), []byte("services: {}\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-source-cleanup-target-missing"},
- Name: "web",
- DirName: &newDir,
- Path: newPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-source-cleanup-target-missing",
+ Name: "web",
+ DirName: &newDir,
+ Path: newPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6780,11 +6770,11 @@ func TestProjectService_RecoverProjectRenameJournals_KeepsSourceCleanupPendingJo
require.NoError(t, os.MkdirAll(newPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-source-cleanup-pending-fail"},
- Name: "web",
- DirName: &newDir,
- Path: newPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-source-cleanup-pending-fail",
+ Name: "web",
+ DirName: &newDir,
+ Path: newPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6847,11 +6837,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsStartedJournalWhenDir
newPath := filepath.Join(projectsDir, newDir)
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-missing-directories"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-missing-directories",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6916,11 +6906,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsMissingPathJournalWhe
newPath := filepath.Join(projectsDir, newDir)
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-missing-path-preserved-target"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-missing-path-preserved-target",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -6990,11 +6980,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsJournalWhenRollbackSo
require.NoError(t, os.MkdirAll(oldPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-source-inspect-preserve"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-source-inspect-preserve",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -7069,11 +7059,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsJournalWhenRollbackTa
require.NoError(t, os.MkdirAll(oldPath, 0o755))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-target-inspect-preserve"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-target-inspect-preserve",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
@@ -7154,11 +7144,11 @@ func TestProjectService_RecoverProjectRenameJournals_ClearsJournalWhenTargetPres
require.NoError(t, os.WriteFile(filepath.Join(newPath, "compose.yaml"), []byte("services: {}\n"), 0o600))
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-rename-preserved-target-retry"},
- Name: "nginx",
- DirName: &oldDir,
- Path: oldPath,
- Status: ProjectStatusStopped,
+ ID: "proj-rename-preserved-target-retry",
+ Name: "nginx",
+ DirName: &oldDir,
+ Path: oldPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
diff --git a/backend/internal/project/service_unix_test.go b/backend/internal/project/service_unix_test.go
index 47f9e476f..d237e82d8 100644
--- a/backend/internal/project/service_unix_test.go
+++ b/backend/internal/project/service_unix_test.go
@@ -5,8 +5,6 @@ package project
import (
"github.com/getarcaneapp/arcane/backend/v2/internal/common"
- "github.com/getarcaneapp/arcane/backend/v2/internal/database"
-
"context"
"os"
"path/filepath"
@@ -50,17 +48,17 @@ func TestProjectService_ApplyGitSyncProjectFiles_TolerantOfPermissionLockedEnv(t
t.Cleanup(func() { _ = os.Chmod(envPath, 0o644) })
project := &Project{
- BaseModel: database.BaseModel{ID: "proj-git-sync-locked-env"},
- Name: "git-sync-locked-env",
- DirName: &dirName,
- Path: projectPath,
- Status: ProjectStatusStopped,
+ ID: "proj-git-sync-locked-env",
+ Name: "git-sync-locked-env",
+ DirName: &dirName,
+ Path: projectPath,
+ Status: ProjectStatusStopped,
}
require.NoError(t, db.Create(project).Error)
updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:1.27-alpine\n", new("FOO=fromgit\n"), nil, "", common.User{
- BaseModel: database.BaseModel{ID: "u1"},
- Username: "tester",
+ ID: "u1",
+ Username: "tester",
})
require.NoError(t, err)
require.NotNil(t, updated)
diff --git a/backend/internal/registry/service.go b/backend/internal/registry/service.go
index 2f4636b8d..d3a2365dd 100644
--- a/backend/internal/registry/service.go
+++ b/backend/internal/registry/service.go
@@ -1294,9 +1294,7 @@ func (s *ContainerRegistryService) createNewRegistryInternal(ctx context.Context
}
newRegistry := &ContainerRegistry{
- BaseModel: database.BaseModel{
- ID: item.ID,
- },
+ ID: item.ID,
URL: item.URL,
Description: item.Description,
Insecure: item.Insecure,
diff --git a/backend/internal/registry/service_test.go b/backend/internal/registry/service_test.go
index e4ed1d212..878691f3c 100644
--- a/backend/internal/registry/service_test.go
+++ b/backend/internal/registry/service_test.go
@@ -714,10 +714,8 @@ func TestContainerRegistryService_InspectImageDigest_AnonymousSuccess(t *testing
assert.Equal(t, "registry.example.com:5443/team/app:1.2.3", imageRef)
assert.Empty(t, options.EncodedRegistryAuth)
return client.DistributionInspectResult{
- DistributionInspect: dockerregistry.DistributionInspect{
- Descriptor: ocispec.Descriptor{
- Digest: digest.Digest(wantDigest),
- },
+ Descriptor: ocispec.Descriptor{
+ Digest: digest.Digest(wantDigest),
},
}, nil
},
@@ -788,10 +786,8 @@ func TestContainerRegistryService_InspectImageDigest_UsesStoredDockerHubCredenti
assert.Equal(t, "https://index.docker.io/v1/", authCfg.ServerAddress)
return client.DistributionInspectResult{
- DistributionInspect: dockerregistry.DistributionInspect{
- Descriptor: ocispec.Descriptor{
- Digest: digest.Digest(wantDigest),
- },
+ Descriptor: ocispec.Descriptor{
+ Digest: digest.Digest(wantDigest),
},
}, nil
},
@@ -825,10 +821,8 @@ func TestContainerRegistryService_InspectImageDigest_UsesStoredDockerHubCredenti
assert.Equal(t, "https://index.docker.io/v1/", authCfg.ServerAddress)
return client.DistributionInspectResult{
- DistributionInspect: dockerregistry.DistributionInspect{
- Descriptor: ocispec.Descriptor{
- Digest: digest.Digest(wantDigest),
- },
+ Descriptor: ocispec.Descriptor{
+ Digest: digest.Digest(wantDigest),
},
}, nil
},
@@ -861,10 +855,8 @@ func TestContainerRegistryService_InspectImageDigest_UsesStoredCredentialsForNon
assert.Equal(t, "ghcr-token", authCfg.Password)
return client.DistributionInspectResult{
- DistributionInspect: dockerregistry.DistributionInspect{
- Descriptor: ocispec.Descriptor{
- Digest: digest.Digest(wantDigest),
- },
+ Descriptor: ocispec.Descriptor{
+ Digest: digest.Digest(wantDigest),
},
}, nil
},
@@ -898,10 +890,8 @@ func TestContainerRegistryService_InspectImageDigest_UsesStoredCredentialsInstea
}
return client.DistributionInspectResult{
- DistributionInspect: dockerregistry.DistributionInspect{
- Descriptor: ocispec.Descriptor{
- Digest: digest.Digest(wantDigest),
- },
+ Descriptor: ocispec.Descriptor{
+ Digest: digest.Digest(wantDigest),
},
}, nil
},
@@ -931,10 +921,8 @@ func TestContainerRegistryService_InspectImageDigest_FallsBackToAnonymousWhenSto
anonymousCalls++
return client.DistributionInspectResult{
- DistributionInspect: dockerregistry.DistributionInspect{
- Descriptor: ocispec.Descriptor{
- Digest: digest.Digest(wantDigest),
- },
+ Descriptor: ocispec.Descriptor{
+ Digest: digest.Digest(wantDigest),
},
}, nil
},
diff --git a/backend/internal/role/service.go b/backend/internal/role/service.go
index 7c4ea3f5a..6ad2eacdd 100644
--- a/backend/internal/role/service.go
+++ b/backend/internal/role/service.go
@@ -72,7 +72,7 @@ func (s *RoleService) EnsureBuiltInRoles(ctx context.Context) error {
return dbutil.WithTx(ctx, s.db.DB, func(tx *gorm.DB) error {
for id, spec := range builtIns {
role := Role{
- BaseModel: database.BaseModel{ID: id},
+ ID: id,
Name: spec.name,
Description: new(spec.desc),
Permissions: database.StringSlice(spec.perm),
diff --git a/backend/internal/role/service_test.go b/backend/internal/role/service_test.go
index c12d60220..baff62982 100644
--- a/backend/internal/role/service_test.go
+++ b/backend/internal/role/service_test.go
@@ -214,7 +214,7 @@ func TestEffectiveGlobalAdminCountIgnoresEnvScopedAndServiceAccounts(t *testing.
globalAdmin := createTestUser(t, userSvc, "global-admin", "global-admin")
envScopedAdmin := createTestUser(t, userSvc, "env-scoped-admin", "env-scoped-admin")
serviceAdmin := &common.User{
- BaseModel: database.BaseModel{ID: "service-admin"},
+ ID: "service-admin",
Username: "service-admin",
IsServiceAccount: true,
}
@@ -263,7 +263,7 @@ func setupUserAndRoleServices(t *testing.T) (*database.DB, *RoleService) {
func createTestUser(t *testing.T, db *database.DB, id, username string) *common.User {
t.Helper()
- created := &common.User{BaseModel: database.BaseModel{ID: id}, Username: username}
+ created := &common.User{ID: id, Username: username}
require.NoError(t, db.WithContext(context.Background()).Create(created).Error)
return created
}
@@ -279,7 +279,7 @@ func createTestEnvironment(t *testing.T, db *database.DB, id, apiURL string, acc
t.Helper()
now := time.Now()
require.NoError(t, db.WithContext(context.Background()).Create(&testEnvironmentRow{
- BaseModel: database.BaseModel{ID: id, CreatedAt: now, UpdatedAt: &now},
+ ID: id, CreatedAt: now, UpdatedAt: &now,
Name: "env-" + id,
ApiUrl: apiURL,
Status: "online",
diff --git a/backend/internal/session/service.go b/backend/internal/session/service.go
index 0d1debddb..1345dd93d 100644
--- a/backend/internal/session/service.go
+++ b/backend/internal/session/service.go
@@ -7,6 +7,7 @@ import (
"encoding/hex"
"strings"
"time"
+ "uuid"
"emperror.dev/errors"
@@ -14,7 +15,6 @@ import (
"github.com/getarcaneapp/arcane/backend/v2/internal/database"
"github.com/getarcaneapp/arcane/backend/v2/pkg/utils/dbutil"
"github.com/getarcaneapp/arcane/types/v2/auth"
- "github.com/google/uuid"
"github.com/samber/mo"
"gorm.io/gorm"
)
@@ -28,7 +28,7 @@ func NewSessionService(db *database.DB) *SessionService {
}
func (s *SessionService) CreateSession(ctx context.Context, userID string, expiresAt time.Time, meta auth.SessionMeta) (*UserSession, string, error) {
- refreshJTI := uuid.NewString()
+ refreshJTI := uuid.New().String()
refreshHash := hashRefreshJTIInternal(refreshJTI)
now := time.Now()
@@ -56,7 +56,7 @@ func (s *SessionService) CreateSession(ctx context.Context, userID string, expir
}
func (s *SessionService) CreateFederatedSession(ctx context.Context, userID string, expiresAt time.Time, credentialID string) (*UserSession, error) {
- refreshHash := hashRefreshJTIInternal(uuid.NewString())
+ refreshHash := hashRefreshJTIInternal(uuid.New().String())
now := time.Now()
session := &UserSession{
@@ -95,7 +95,7 @@ func (s *SessionService) RotateRefreshToken(ctx context.Context, sessionID strin
return nil, "", common.ErrInvalidToken
}
- newRefreshJTI := uuid.NewString()
+ newRefreshJTI := uuid.New().String()
newHash := hashRefreshJTIInternal(newRefreshJTI)
now := time.Now()
diff --git a/backend/internal/session/service_test.go b/backend/internal/session/service_test.go
index 103c31faa..8464c4728 100644
--- a/backend/internal/session/service_test.go
+++ b/backend/internal/session/service_test.go
@@ -21,8 +21,8 @@ func TestSessionService_RotateRefreshTokenRequiresCurrentHash(t *testing.T) {
ctx := context.Background()
db := setupAuthServiceTestDB(t)
require.NoError(t, db.Create(&common.User{
- BaseModel: database.BaseModel{ID: "u-session"},
- Username: "session-user",
+ ID: "u-session",
+ Username: "session-user",
}).Error)
sessionSvc := NewSessionService(db)
@@ -43,8 +43,8 @@ func TestSessionService_DeleteExpiredSessions(t *testing.T) {
ctx := context.Background()
db := setupAuthServiceTestDB(t)
require.NoError(t, db.Create(&common.User{
- BaseModel: database.BaseModel{ID: "u-cleanup"},
- Username: "cleanup-user",
+ ID: "u-cleanup",
+ Username: "cleanup-user",
}).Error)
sessionSvc := NewSessionService(db)
diff --git a/backend/internal/settings/handler.go b/backend/internal/settings/handler.go
index 54bc92092..542ae746c 100644
--- a/backend/internal/settings/handler.go
+++ b/backend/internal/settings/handler.go
@@ -426,11 +426,9 @@ func (h *SettingsHandler) updateSettingsForLocalEnvironment(ctx context.Context,
settingDtos := make([]settingstypes.SettingDto, 0, len(updatedSettings))
for _, setting := range updatedSettings {
settingDtos = append(settingDtos, settingstypes.SettingDto{
- PublicSetting: settingstypes.PublicSetting{
- Key: setting.Key,
- Type: "string",
- Value: setting.Value,
- },
+ Key: setting.Key,
+ Type: "string",
+ Value: setting.Value,
})
}
diff --git a/backend/internal/settings/service.go b/backend/internal/settings/service.go
index d8ea03c07..f34979971 100644
--- a/backend/internal/settings/service.go
+++ b/backend/internal/settings/service.go
@@ -14,10 +14,10 @@ import (
"strings"
"sync/atomic"
"time"
+ "uuid"
"emperror.dev/errors"
- "github.com/google/uuid"
"github.com/samber/mo"
"gorm.io/gorm"
@@ -886,12 +886,7 @@ func (s *SettingsService) setupInstanceID(ctx context.Context) error {
return nil
}
- createdInstanceID, err := uuid.NewRandom()
- if err != nil {
- return errors.WrapIf(err, "failed to created a new instance ID")
- }
-
- err = s.UpdateSetting(ctx, "instanceId", createdInstanceID.String())
+ err := s.UpdateSetting(ctx, "instanceId", uuid.New().String())
if err != nil {
return errors.WrapIf(err, "failed to set instance ID in database")
}
@@ -997,11 +992,7 @@ func (s *SettingsService) EnsureEncryptionKey(ctx context.Context) (string, erro
}
notFound := errors.Is(err, gorm.ErrRecordNotFound)
- u, genErr := uuid.NewRandom()
- if genErr != nil {
- return errors.WrapIf(genErr, "failed to generate encryption key")
- }
- sum := sha256.Sum256([]byte(u.String()))
+ sum := sha256.Sum256([]byte(uuid.New().String()))
generatedKey := base64.StdEncoding.EncodeToString(sum[:])
key = generatedKey
diff --git a/backend/internal/swarm/handler.go b/backend/internal/swarm/handler.go
index 9315dd315..27e108311 100644
--- a/backend/internal/swarm/handler.go
+++ b/backend/internal/swarm/handler.go
@@ -1423,7 +1423,7 @@ func (h *SwarmHandler) GetJoinCandidates(ctx context.Context, input *GetSwarmJoi
if err := requireEasyJoinManagerPermissionsInternal(ctx, input.EnvironmentID); err != nil {
return nil, err
}
- nodes, _, err := h.swarmService.ListNodesPaginated(ctx, input.EnvironmentID, pagination.QueryParams{Params: pagination.Params{Limit: -1}})
+ nodes, _, err := h.swarmService.ListNodesPaginated(ctx, input.EnvironmentID, pagination.QueryParams{Limit: -1})
if err != nil {
return nil, mapSwarmServiceError(err, "Failed to list Easy Join candidates")
}
@@ -1482,7 +1482,7 @@ func (h *SwarmHandler) JoinEnvironments(ctx context.Context, input *JoinSwarmEnv
}
if len(input.Body.RemoteAddrs) == 0 {
- nodes, _, err := h.swarmService.ListNodesPaginated(ctx, input.EnvironmentID, pagination.QueryParams{Params: pagination.Params{Limit: -1}})
+ nodes, _, err := h.swarmService.ListNodesPaginated(ctx, input.EnvironmentID, pagination.QueryParams{Limit: -1})
if err != nil {
return nil, mapSwarmServiceError(err, "Failed to derive swarm manager addresses")
}
diff --git a/backend/internal/swarm/service_test.go b/backend/internal/swarm/service_test.go
index 5215fcb9c..1c731bb6b 100644
--- a/backend/internal/swarm/service_test.go
+++ b/backend/internal/swarm/service_test.go
@@ -58,7 +58,7 @@ func createSwarmTestEnvironmentInternal(t *testing.T, db *database.DB, id, apiUR
t.Helper()
now := time.Now()
require.NoError(t, db.Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: id, CreatedAt: now, UpdatedAt: &now},
+ ID: id, CreatedAt: now, UpdatedAt: &now,
Name: "env-" + id,
ApiUrl: apiURL,
Status: status,
@@ -371,10 +371,8 @@ func TestSwarmService_ScaleService_HandlesServiceModesInternal(t *testing.T) {
}
case r.Method == http.MethodGet && r.URL.Path == "/v1.41/services/service-1":
if !assert.NoError(t, json.NewEncoder(w).Encode(swarm.Service{
- ID: "service-1",
- Meta: swarm.Meta{
- Version: swarm.Version{Index: 7},
- },
+ ID: "service-1",
+ Version: swarm.Version{Index: 7},
Spec: swarm.ServiceSpec{
Annotations: swarm.Annotations{Name: "service-1"},
Mode: tt.mode,
diff --git a/backend/internal/swarm/swarm.go b/backend/internal/swarm/swarm.go
index 88d2085f9..2f8ac0efb 100644
--- a/backend/internal/swarm/swarm.go
+++ b/backend/internal/swarm/swarm.go
@@ -574,7 +574,7 @@ func (s *SwarmService) GetNode(ctx context.Context, environmentID, nodeID string
// ReconcileNodeAgents verifies visible environment identities and persists only
// unique node matches. Ambiguous and mismatched identities remain unchanged.
func (s *SwarmService) ReconcileNodeAgents(ctx context.Context, environmentID string) (*swarmtypes.NodeAgentReconcileResponse, error) {
- items, _, err := s.ListNodesPaginated(ctx, environmentID, pagination.QueryParams{Params: pagination.Params{Limit: -1}})
+ items, _, err := s.ListNodesPaginated(ctx, environmentID, pagination.QueryParams{Limit: -1})
if err != nil {
return nil, err
}
@@ -896,7 +896,7 @@ func (s *SwarmService) JoinEnvironments(ctx context.Context, managerEnvironmentI
if err != nil {
return nil, err
}
- nodes, _, err := s.ListNodesPaginated(ctx, managerEnvironmentID, pagination.QueryParams{Params: pagination.Params{Limit: -1}})
+ nodes, _, err := s.ListNodesPaginated(ctx, managerEnvironmentID, pagination.QueryParams{Limit: -1})
if err != nil {
return nil, err
}
@@ -1087,8 +1087,8 @@ func (s *SwarmService) buildNodeAgentStatusInternal(nodeID string, env *environm
Connected: &live,
LastHeartbeat: runtime.lastHeartbeat,
LastPollAt: runtime.lastPollAt,
- }
- status.EnvironmentName = &env.Name
+
+ EnvironmentName: &env.Name}
environmentType := "direct"
if env.IsEdge {
environmentType = "edge"
diff --git a/backend/internal/template/service.go b/backend/internal/template/service.go
index 74accea4d..2781871fc 100644
--- a/backend/internal/template/service.go
+++ b/backend/internal/template/service.go
@@ -13,6 +13,7 @@ import (
"strings"
"sync"
"time"
+ "uuid"
"emperror.dev/errors"
@@ -28,7 +29,6 @@ import (
"github.com/getarcaneapp/arcane/backend/v2/pkg/utils/mapper"
"github.com/getarcaneapp/arcane/types/v2/env"
tmpl "github.com/getarcaneapp/arcane/types/v2/template"
- "github.com/google/uuid"
"github.com/samber/hot"
"github.com/samber/mo"
"go.getarcane.app/acfs"
@@ -302,7 +302,7 @@ func (s *TemplateService) remoteCacheSizeInternal() int {
func (s *TemplateService) CreateTemplate(ctx context.Context, template *ComposeTemplate) error {
if template.ID == "" {
- template.ID = uuid.NewString()
+ template.ID = uuid.New().String()
}
template.IsCustom = true
template.IsRemote = false
@@ -484,7 +484,7 @@ func (s *TemplateService) CreateRegistry(ctx context.Context, registry *Template
}
if registry.ID == "" {
- registry.ID = uuid.NewString()
+ registry.ID = uuid.New().String()
}
err := s.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
@@ -729,7 +729,7 @@ func (s *TemplateService) convertRemoteToLocal(remote tmpl.RemoteTemplate, regis
publicID := fmt.Sprintf("%s:%s:%s", remoteIDPrefix, registry.ID, remote.ID)
return ComposeTemplate{
- BaseModel: database.BaseModel{ID: publicID},
+ ID: publicID,
Name: remote.Name,
Description: remote.Description,
Content: "",
@@ -925,7 +925,7 @@ func (s *TemplateService) downloadTemplateTransaction(ctx context.Context, remot
}
localTemplate := &ComposeTemplate{
- BaseModel: database.BaseModel{ID: uuid.NewString()},
+ ID: uuid.New().String(),
Name: base,
Description: srcDesc,
Content: composeContent,
@@ -959,7 +959,7 @@ func (s *TemplateService) templateBaseFromRemote(remoteTemplate *ComposeTemplate
base = projects.Slugify(parts[len(parts)-1])
}
if base == "" {
- base = "template-" + uuid.NewString()
+ base = "template-" + uuid.New().String()
}
return base
}
@@ -1047,7 +1047,7 @@ func (s *TemplateService) upsertFilesystemTemplate(ctx context.Context, name, de
}
tpl := &ComposeTemplate{
- BaseModel: database.BaseModel{ID: uuid.NewString()},
+ ID: uuid.New().String(),
Name: name,
Description: desc,
Content: compose,
diff --git a/backend/internal/template/service_test.go b/backend/internal/template/service_test.go
index 8ee15aeeb..0676ab248 100644
--- a/backend/internal/template/service_test.go
+++ b/backend/internal/template/service_test.go
@@ -213,10 +213,10 @@ services:
registryFetchMeta: make(map[string]*registryFetchMeta),
}
registry := &TemplateRegistry{
- BaseModel: database.BaseModel{ID: "reg-1"},
- Name: "Demo Registry",
- URL: registryURL,
- Enabled: true,
+ ID: "reg-1",
+ Name: "Demo Registry",
+ URL: registryURL,
+ Enabled: true,
}
templates, err := service.fetchRegistryTemplates(context.Background(), registry)
@@ -272,7 +272,7 @@ services:
}
remoteTemplate := &ComposeTemplate{
- BaseModel: database.BaseModel{ID: "remote:reg-1:demo"},
+ ID: "remote:reg-1:demo",
Name: "Demo Template",
Description: "Remote template",
IsRemote: true,
@@ -308,7 +308,7 @@ func TestGetAllTemplatesPaginated_FiltersByType(t *testing.T) {
db := setupTemplateServiceTestDB(t)
localTemplates := []ComposeTemplate{
{
- BaseModel: database.BaseModel{ID: "local-one", CreatedAt: now, UpdatedAt: &now},
+ ID: "local-one", CreatedAt: now, UpdatedAt: &now,
Name: "Local One",
Description: "Local template",
Content: "services: {}",
@@ -316,7 +316,7 @@ func TestGetAllTemplatesPaginated_FiltersByType(t *testing.T) {
IsRemote: false,
},
{
- BaseModel: database.BaseModel{ID: "local-two", CreatedAt: now, UpdatedAt: &now},
+ ID: "local-two", CreatedAt: now, UpdatedAt: &now,
Name: "Local Two",
Description: "Local template",
Content: "services: {}",
@@ -329,7 +329,7 @@ func TestGetAllTemplatesPaginated_FiltersByType(t *testing.T) {
service := NewTemplateService(context.Background(), db, http.DefaultClient, nil)
service.remoteCache.Set(struct{}{}, []ComposeTemplate{
{
- BaseModel: database.BaseModel{ID: "remote-one", CreatedAt: now, UpdatedAt: &now},
+ ID: "remote-one", CreatedAt: now, UpdatedAt: &now,
Name: "Remote One",
Description: "Remote template",
Content: "services: {}",
@@ -351,7 +351,7 @@ func TestGetAllTemplatesPaginated_FiltersByType(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
templates, _, err := service.GetAllTemplatesPaginated(context.Background(), pagination.QueryParams{
- Params: pagination.Params{Start: 0, Limit: 20},
+ Start: 0, Limit: 20,
Filters: map[string]string{"type": tt.typeFilter},
})
require.NoError(t, err)
@@ -449,10 +449,10 @@ func TestGetTemplate_ForceRefreshesRemoteCacheOnMiss(t *testing.T) {
db := setupTemplateServiceTestDB(t)
registry := &TemplateRegistry{
- BaseModel: database.BaseModel{ID: "reg-1"},
- Name: "Demo",
- URL: baseURL + "/registry.json",
- Enabled: true,
+ ID: "reg-1",
+ Name: "Demo",
+ URL: baseURL + "/registry.json",
+ Enabled: true,
}
require.NoError(t, db.WithContext(context.Background()).Create(registry).Error)
diff --git a/backend/internal/upload/handler.go b/backend/internal/upload/handler.go
index 5de15dc0e..5801f09d3 100644
--- a/backend/internal/upload/handler.go
+++ b/backend/internal/upload/handler.go
@@ -208,8 +208,7 @@ func LegacyMultipartMiddleware(api huma.API, service *UploadService, kind string
session, err := service.IngestSession(ctx.Context(), kind, header.Filename, header.Size, file)
if err != nil {
if httpErr := SessionHTTPError(err); httpErr != nil {
- var statusErr huma.StatusError
- if errors.As(httpErr, &statusErr) {
+ if statusErr, ok := errors.AsType[huma.StatusError](httpErr); ok {
writeErr(statusErr.GetStatus(), statusErr.Error())
return
}
diff --git a/backend/internal/user/handler.go b/backend/internal/user/handler.go
index 71f52024d..311054c67 100644
--- a/backend/internal/user/handler.go
+++ b/backend/internal/user/handler.go
@@ -1,8 +1,6 @@
package user
import (
- "github.com/getarcaneapp/arcane/backend/v2/internal/database"
-
"context"
"strings"
"time"
@@ -209,9 +207,7 @@ func (h *UserHandler) CreateUser(ctx context.Context, input *CreateUserInput) (*
Email: input.Body.Email,
Locale: input.Body.Locale,
TimeFormat: usertypes.TimeFormatAuto,
- BaseModel: database.BaseModel{
- CreatedAt: time.Now(),
- },
+ CreatedAt: time.Now(),
}
if input.Body.TimeFormat != nil {
userModel.TimeFormat = *input.Body.TimeFormat
diff --git a/backend/internal/user/service.go b/backend/internal/user/service.go
index fbbcce189..d4d93b9ca 100644
--- a/backend/internal/user/service.go
+++ b/backend/internal/user/service.go
@@ -186,7 +186,7 @@ func (s *UserService) ResolveUserPermissions(ctx context.Context, userID string)
if s.roleService == nil {
return nil, nil
}
- return s.roleService.ResolvePermissions(ctx, &common.User{BaseModel: database.BaseModel{ID: userID}})
+ return s.roleService.ResolvePermissions(ctx, &common.User{ID: userID})
}
// checkTargetPrivilegeInternal enforces actor-vs-target privilege ordering: a
@@ -510,7 +510,7 @@ func (s *UserService) DeleteUser(ctx context.Context, id string, actorPerms *aut
// global admin, refuse the delete. Checked outside the transaction because
// role.RoleService uses its own session and the guard spans rows.
if s.roleService != nil {
- ps, err := s.roleService.ResolvePermissions(ctx, &common.User{BaseModel: database.BaseModel{ID: id}})
+ ps, err := s.roleService.ResolvePermissions(ctx, &common.User{ID: id})
if err != nil {
return err
}
diff --git a/backend/internal/user/service_test.go b/backend/internal/user/service_test.go
index 92799581f..12a44002d 100644
--- a/backend/internal/user/service_test.go
+++ b/backend/internal/user/service_test.go
@@ -54,8 +54,8 @@ func setupUserAndRoleServices(t *testing.T) (*UserService, *role.RoleService) {
func createTestUser(t *testing.T, svc *UserService, id, username string) *common.User {
t.Helper()
created, err := svc.CreateUser(context.Background(), &common.User{
- BaseModel: database.BaseModel{ID: id},
- Username: username,
+ ID: id,
+ Username: username,
})
require.NoError(t, err)
return created
@@ -91,7 +91,7 @@ func TestSetPasswordUpdatesHashAndClearsPasswordChangeRequirement(t *testing.T)
oldHash, err := userSvc.HashPassword("old-password")
require.NoError(t, err)
user, err := userSvc.CreateUser(ctx, &common.User{
- BaseModel: database.BaseModel{ID: "password-user"},
+ ID: "password-user",
Username: "password-user",
PasswordHash: oldHash,
RequiresPasswordChange: true,
@@ -148,9 +148,9 @@ func TestListUsersPaginatedSetsCanDeleteFromGlobalAdminCount(t *testing.T) {
nonAdmin := createTestUser(t, userSvc, "user-1", "user")
users, _, err := userSvc.ListUsersPaginated(ctx, pagination.QueryParams{
- Params: pagination.Params{Start: 0, Limit: 20},
- SortParams: pagination.SortParams{Sort: "Username", Order: "asc"},
- Filters: map[string]string{},
+ Start: 0, Limit: 20,
+ Sort: "Username", Order: "asc",
+ Filters: map[string]string{},
})
require.NoError(t, err)
require.Len(t, users, 2)
@@ -179,9 +179,9 @@ func TestDeleteUserRejectsDeletingOnlyCustomAllPermissionsAdmin(t *testing.T) {
require.ErrorIs(t, err, ErrCannotRemoveLastAdmin)
users, _, err := userSvc.ListUsersPaginated(ctx, pagination.QueryParams{
- Params: pagination.Params{Start: 0, Limit: 20},
- SortParams: pagination.SortParams{Sort: "Username", Order: "asc"},
- Filters: map[string]string{},
+ Start: 0, Limit: 20,
+ Sort: "Username", Order: "asc",
+ Filters: map[string]string{},
})
require.NoError(t, err)
require.Len(t, users, 1)
diff --git a/backend/internal/variable/service_test.go b/backend/internal/variable/service_test.go
index 7af9848ca..a679b0fbc 100644
--- a/backend/internal/variable/service_test.go
+++ b/backend/internal/variable/service_test.go
@@ -86,11 +86,11 @@ func setupVariableServiceTest(t *testing.T) (*VariableService, *database.DB, str
func createVariableTestEnvironment(t *testing.T, db *database.DB, id string) {
t.Helper()
require.NoError(t, db.Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: id},
- Name: "env-" + id,
- ApiUrl: "http://env-" + id,
- Status: "online",
- Enabled: true,
+ ID: id,
+ Name: "env-" + id,
+ ApiUrl: "http://env-" + id,
+ Status: "online",
+ Enabled: true,
}).Error)
}
@@ -280,7 +280,7 @@ func TestSyncEnvironment_DirectMaterializesSecretsThroughAgentRoute(t *testing.T
defer server.Close()
require.NoError(t, db.Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: "env-direct"},
+ ID: "env-direct",
Name: "Direct",
ApiUrl: server.URL,
Status: string(environment.EnvironmentStatusOnline),
@@ -303,7 +303,7 @@ func TestSyncEnvironment_EdgeMaterializesSecretsThroughAgentRoute(t *testing.T)
service, db, _ := setupVariableServiceTest(t)
token := "edge-agent-token"
require.NoError(t, db.Create(&environment.Environment{
- BaseModel: database.BaseModel{ID: "env-edge"},
+ ID: "env-edge",
Name: "Edge",
ApiUrl: "http://edge.invalid",
Status: string(environment.EnvironmentStatusOnline),
diff --git a/backend/internal/variable/variable.go b/backend/internal/variable/variable.go
index f40296061..2139d8524 100644
--- a/backend/internal/variable/variable.go
+++ b/backend/internal/variable/variable.go
@@ -784,7 +784,7 @@ func scopedEnvironmentIDsInternal(environments []environment.Environment) []stri
func environmentsFromIDsInternal(envIDs []string) []environment.Environment {
environments := make([]environment.Environment, 0, len(envIDs))
for _, id := range envIDs {
- environments = append(environments, environment.Environment{BaseModel: database.BaseModel{ID: id}})
+ environments = append(environments, environment.Environment{ID: id})
}
return environments
}
diff --git a/backend/internal/volume/backup.go b/backend/internal/volume/backup.go
index 6042a7c78..161e1b1c4 100644
--- a/backend/internal/volume/backup.go
+++ b/backend/internal/volume/backup.go
@@ -17,6 +17,7 @@ import (
"strconv"
"strings"
"time"
+ "uuid"
"emperror.dev/errors"
@@ -24,7 +25,6 @@ import (
"github.com/getarcaneapp/arcane/backend/v2/pkg/libarcane"
"github.com/getarcaneapp/arcane/backend/v2/pkg/libarcane/volumehelper"
"github.com/getarcaneapp/arcane/backend/v2/pkg/pagination"
- "github.com/google/uuid"
"github.com/moby/moby/api/types/container"
"github.com/moby/moby/api/types/mount"
"github.com/moby/moby/client"
@@ -234,7 +234,7 @@ func (s *VolumeService) CreateBackup(ctx context.Context, volumeName string, use
return nil, err
}
- backupID := fmt.Sprintf("%s-%d-%s", volumeName, time.Now().UnixNano(), uuid.NewString()[:8])
+ backupID := fmt.Sprintf("%s-%d-%s", volumeName, time.Now().UnixNano(), uuid.New().String()[:8])
filename, err := s.backupArchiveFilenameInternal(backupID)
if err != nil {
return nil, err
diff --git a/backend/internal/volume/handler.go b/backend/internal/volume/handler.go
index 514b48981..5099f5306 100644
--- a/backend/internal/volume/handler.go
+++ b/backend/internal/volume/handler.go
@@ -667,17 +667,11 @@ func (h *VolumeHandler) GetVolumeSizes(ctx context.Context, input *GetVolumeSize
func (h *VolumeHandler) ListBackups(ctx context.Context, input *ListBackupsInput) (*ListBackupsOutput, error) {
params := pagination.QueryParams{
- SearchQuery: pagination.SearchQuery{
- Search: input.Search,
- },
- SortParams: pagination.SortParams{
- Sort: input.Sort,
- Order: pagination.SortOrder(input.Order),
- },
- Params: pagination.Params{
- Start: input.Start,
- Limit: input.Limit,
- },
+ Search: input.Search,
+ Sort: input.Sort,
+ Order: pagination.SortOrder(input.Order),
+ Start: input.Start,
+ Limit: input.Limit,
}
if params.Limit == 0 {
diff --git a/backend/internal/volume/workspace_handler_test.go b/backend/internal/volume/workspace_handler_test.go
index d4f4c705b..92cdf6450 100644
--- a/backend/internal/volume/workspace_handler_test.go
+++ b/backend/internal/volume/workspace_handler_test.go
@@ -3,8 +3,6 @@ package volume
import (
"github.com/getarcaneapp/arcane/backend/v2/internal/common"
- "github.com/getarcaneapp/arcane/backend/v2/internal/database"
-
"context"
"mime/multipart"
"net/http"
@@ -30,7 +28,7 @@ func volumeWorkspacePermissionContextInternal(environmentID string, permissions
func TestUploadAndRestoreReturnsNotFoundForUnknownSession(t *testing.T) {
h := &VolumeHandler{volumeService: &VolumeService{}, uploadService: upload.NewUploadService(nil)}
- ctx := context.WithValue(context.Background(), common.CurrentUserContextKey{}, &common.User{BaseModel: database.BaseModel{ID: "u-1"}})
+ ctx := context.WithValue(context.Background(), common.CurrentUserContextKey{}, &common.User{ID: "u-1"})
_, err := h.UploadAndRestore(ctx, &UploadAndRestoreInput{
EnvironmentID: "0",
diff --git a/backend/internal/vulnerability/model.go b/backend/internal/vulnerability/model.go
index 12cf5d375..bfd6e3758 100644
--- a/backend/internal/vulnerability/model.go
+++ b/backend/internal/vulnerability/model.go
@@ -2,9 +2,9 @@ package vulnerability
import (
"time"
+ "uuid"
"github.com/getarcaneapp/arcane/backend/v2/internal/database"
- "github.com/google/uuid"
"gorm.io/gorm"
)
diff --git a/backend/internal/vulnerability/service_test.go b/backend/internal/vulnerability/service_test.go
index 8d03fdade..7969ca80b 100644
--- a/backend/internal/vulnerability/service_test.go
+++ b/backend/internal/vulnerability/service_test.go
@@ -262,7 +262,7 @@ func TestVulnerabilityService_ListAllVulnerabilities_FiltersIgnoredInline(t *tes
require.NoError(t, db.Create(&ignore).Error)
items, page, err := svc.ListAllVulnerabilities(ctx, "env-1", pagination.QueryParams{
- Params: pagination.Params{Start: 0, Limit: 20},
+ Start: 0, Limit: 20,
})
require.NoError(t, err)
require.Empty(t, items)
@@ -421,9 +421,9 @@ func TestVulnerabilityService_ListAllVulnerabilities_PagesAndCountsWithInlineFil
// matches are CVE-A1 (critical) and CVE-B1 (high); the first page holds
// the critical one.
items, page, err := svc.ListAllVulnerabilities(ctx, "env-1", pagination.QueryParams{
- Params: pagination.Params{Start: 0, Limit: 1},
- SortParams: pagination.SortParams{Sort: "severity", Order: pagination.SortDesc},
- Filters: map[string]string{"severity": "critical,high"},
+ Start: 0, Limit: 1,
+ Sort: "severity", Order: pagination.SortDesc,
+ Filters: map[string]string{"severity": "critical,high"},
})
require.NoError(t, err)
require.Len(t, items, 1)
@@ -433,8 +433,8 @@ func TestVulnerabilityService_ListAllVulnerabilities_PagesAndCountsWithInlineFil
// Search matches per-CVE fields decoded from the blobs.
items, page, err = svc.ListAllVulnerabilities(ctx, "env-1", pagination.QueryParams{
- Params: pagination.Params{Start: 0, Limit: 20},
- SearchQuery: pagination.SearchQuery{Search: "glibc"},
+ Start: 0, Limit: 20,
+ Search: "glibc",
})
require.NoError(t, err)
require.Len(t, items, 1)
diff --git a/backend/pkg/fswatch/watcher.go b/backend/pkg/fswatch/watcher.go
index 29f91c30b..980d22697 100644
--- a/backend/pkg/fswatch/watcher.go
+++ b/backend/pkg/fswatch/watcher.go
@@ -142,9 +142,7 @@ func (fw *Watcher) watchLoop(ctx context.Context) {
defer close(fw.stoppedCh)
debounceTimer := time.NewTimer(fw.debounce)
- if !debounceTimer.Stop() {
- <-debounceTimer.C
- }
+ debounceTimer.Stop()
debouncePending := false
lastGoroutineLog := time.Time{}
@@ -187,12 +185,6 @@ func (fw *Watcher) processEventInternal(ctx context.Context, event fsnotify.Even
return false
}
fw.recordPendingPathInternal(event.Name)
- if !debounceTimer.Stop() {
- select {
- case <-debounceTimer.C:
- default:
- }
- }
debounceTimer.Reset(fw.debounce)
*debouncePending = true
return false
diff --git a/backend/pkg/libarcane/edge/client.go b/backend/pkg/libarcane/edge/client.go
index 04cbd8431..f17226525 100644
--- a/backend/pkg/libarcane/edge/client.go
+++ b/backend/pkg/libarcane/edge/client.go
@@ -11,6 +11,7 @@ import (
"strings"
"sync"
"time"
+ "uuid"
"emperror.dev/errors"
@@ -19,7 +20,6 @@ import (
"github.com/getarcaneapp/arcane/backend/v2/internal/actors"
wshub "github.com/getarcaneapp/arcane/backend/v2/pkg/libarcane/ws"
"github.com/getarcaneapp/arcane/backend/v2/pkg/utils"
- "github.com/google/uuid"
"github.com/samber/mo"
)
@@ -101,7 +101,7 @@ func NewTunnelClient(cfg *Config, handler http.Handler) *TunnelClient {
managerGRPCAddr: managerGRPCAddr,
localPort: localPort,
requestTimeout: DefaultRequestTimeout,
- agentInstanceID: uuid.NewString(),
+ agentInstanceID: uuid.New().String(),
}
}
diff --git a/backend/pkg/libarcane/edge/client_test.go b/backend/pkg/libarcane/edge/client_test.go
index 819c72b87..d11beb1ae 100644
--- a/backend/pkg/libarcane/edge/client_test.go
+++ b/backend/pkg/libarcane/edge/client_test.go
@@ -1668,14 +1668,12 @@ func startTestTunnelServiceOnAPIPathInternal(t *testing.T, ctx context.Context,
}
clone := r.Clone(r.Context())
- cloneURL := *clone.URL
if r.URL.Path == "/api/tunnel/connect" {
- cloneURL.Path = tunnelpb.TunnelService_Connect_FullMethodName
+ clone.URL.Path = tunnelpb.TunnelService_Connect_FullMethodName
} else {
- cloneURL.Path = strings.TrimPrefix(r.URL.Path, "/api")
+ clone.URL.Path = strings.TrimPrefix(r.URL.Path, "/api")
}
- clone.URL = &cloneURL
- clone.RequestURI = cloneURL.Path
+ clone.RequestURI = clone.URL.Path
grpcServer.ServeHTTP(w, clone)
})
@@ -2068,14 +2066,12 @@ func startTestPollAndGRPCManagerInternal(t *testing.T, ctx context.Context, serv
}
clone := r.Clone(r.Context())
- cloneURL := *clone.URL
if r.URL.Path == "/api/tunnel/connect" {
- cloneURL.Path = tunnelpb.TunnelService_Connect_FullMethodName
+ clone.URL.Path = tunnelpb.TunnelService_Connect_FullMethodName
} else {
- cloneURL.Path = strings.TrimPrefix(r.URL.Path, "/api")
+ clone.URL.Path = strings.TrimPrefix(r.URL.Path, "/api")
}
- clone.URL = &cloneURL
- clone.RequestURI = cloneURL.Path
+ clone.RequestURI = clone.URL.Path
grpcServer.ServeHTTP(w, clone)
})
diff --git a/backend/pkg/libarcane/edge/command_client.go b/backend/pkg/libarcane/edge/command_client.go
index 4276c14dd..3ef73fdca 100644
--- a/backend/pkg/libarcane/edge/command_client.go
+++ b/backend/pkg/libarcane/edge/command_client.go
@@ -5,10 +5,9 @@ import (
"net/http"
"slices"
"time"
+ "uuid"
"emperror.dev/errors"
-
- "github.com/google/uuid"
)
const (
@@ -77,7 +76,7 @@ func (c *CommandClient) Execute(ctx context.Context, tunnel *AgentTunnel, req *C
chunkRequestBody := len(req.Body) > defaultCommandChunkSize && slices.Contains(tunnel.Capabilities, tunnelCapabilityChunkedRequest)
if chunkRequestBody {
- transferID := uuid.NewString()
+ transferID := uuid.New().String()
msg.Body = nil
msg.Metadata = map[string]string{bodyTransferMetadataKey: transferID}
}
diff --git a/backend/pkg/libarcane/edge/event_sync.go b/backend/pkg/libarcane/edge/event_sync.go
index cd47c3328..020ade99e 100644
--- a/backend/pkg/libarcane/edge/event_sync.go
+++ b/backend/pkg/libarcane/edge/event_sync.go
@@ -3,10 +3,9 @@ package edge
import (
"strings"
"sync"
+ "uuid"
"emperror.dev/errors"
-
- "github.com/google/uuid"
)
const (
@@ -63,7 +62,7 @@ func PublishEventToManager(event *TunnelEvent) error {
}
msg := &TunnelMessage{
- ID: uuid.NewString(),
+ ID: uuid.New().String(),
Type: MessageTypeEvent,
Event: cloneTunnelEvent(event),
}
diff --git a/backend/pkg/libarcane/edge/server.go b/backend/pkg/libarcane/edge/server.go
index a473b690a..f648a31e8 100644
--- a/backend/pkg/libarcane/edge/server.go
+++ b/backend/pkg/libarcane/edge/server.go
@@ -9,6 +9,7 @@ import (
"slices"
"strings"
"time"
+ "uuid"
"emperror.dev/emperror"
"emperror.dev/errors"
@@ -17,7 +18,6 @@ import (
"github.com/getarcaneapp/arcane/backend/v2/pkg/remenv"
tunnelpb "github.com/getarcaneapp/arcane/backend/v2/proto/tunnel/v1"
certgen "github.com/getarcaneapp/arcane/cli/v2/pkg/generate"
- "github.com/google/uuid"
"github.com/labstack/echo/v5"
"github.com/samber/mo"
"google.golang.org/grpc"
@@ -301,7 +301,7 @@ func (s *TunnelServer) populateSessionMetadata(tunnel *AgentTunnel, registerMsg
return
}
- tunnel.SessionID = uuid.NewString()
+ tunnel.SessionID = uuid.New().String()
tunnel.SecurityMode = securityMode
if tunnel.SecurityMode == "" {
tunnel.SecurityMode = "token"
diff --git a/backend/pkg/libarcane/edge/ws_proxy.go b/backend/pkg/libarcane/edge/ws_proxy.go
index f15b5dc16..217308397 100644
--- a/backend/pkg/libarcane/edge/ws_proxy.go
+++ b/backend/pkg/libarcane/edge/ws_proxy.go
@@ -5,10 +5,10 @@ import (
"log/slog"
"net/http"
"time"
+ "uuid"
"github.com/coder/websocket"
wshub "github.com/getarcaneapp/arcane/backend/v2/pkg/libarcane/ws"
- "github.com/google/uuid"
"github.com/labstack/echo/v5"
)
diff --git a/backend/pkg/libarcane/engine_compat_test.go b/backend/pkg/libarcane/engine_compat_test.go
index 531a1eede..bc034ef46 100644
--- a/backend/pkg/libarcane/engine_compat_test.go
+++ b/backend/pkg/libarcane/engine_compat_test.go
@@ -59,18 +59,16 @@ func TestSanitizeRecreateHostConfigInternal(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
input := &containertypes.HostConfig{
- Resources: containertypes.Resources{
- MemorySwappiness: &swappiness,
- CPUShares: 1024,
- },
- PublishAllPorts: true,
- ReadonlyRootfs: true,
- NetworkMode: "bridge",
- ContainerIDFile: "/tmp/id",
- VolumeDriver: "local",
- Annotations: map[string]string{"test": "value"},
- MaskedPaths: []string{"/proc/kcore"},
- ReadonlyPaths: []string{"/proc/asound"},
+ MemorySwappiness: &swappiness,
+ CPUShares: 1024,
+ PublishAllPorts: true,
+ ReadonlyRootfs: true,
+ NetworkMode: "bridge",
+ ContainerIDFile: "/tmp/id",
+ VolumeDriver: "local",
+ Annotations: map[string]string{"test": "value"},
+ MaskedPaths: []string{"/proc/kcore"},
+ ReadonlyPaths: []string{"/proc/asound"},
}
cloned := cloneContainerHostConfigInternal(input)
diff --git a/backend/pkg/libarcane/swarm/convert_service.go b/backend/pkg/libarcane/swarm/convert_service.go
index 36357ecf7..e439d7f46 100644
--- a/backend/pkg/libarcane/swarm/convert_service.go
+++ b/backend/pkg/libarcane/swarm/convert_service.go
@@ -71,10 +71,8 @@ func buildServiceSpecInternal(
capabilityAdd, capabilityDrop := dockeropts.EffectiveCapAddCapDrop(service.CapAdd, service.CapDrop)
spec := swarm.ServiceSpec{
- Annotations: swarm.Annotations{
- Name: serviceName,
- Labels: serviceLabels,
- },
+ Name: serviceName,
+ Labels: serviceLabels,
TaskTemplate: swarm.TaskSpec{
ContainerSpec: &swarm.ContainerSpec{
Image: service.Image,
diff --git a/backend/pkg/libarcane/swarm/resources.go b/backend/pkg/libarcane/swarm/resources.go
index 640881dfd..72639aae8 100644
--- a/backend/pkg/libarcane/swarm/resources.go
+++ b/backend/pkg/libarcane/swarm/resources.go
@@ -231,8 +231,8 @@ func configFileResourceAdapterInternal(dockerClient *dockerclient.Client) fileRe
},
Create: func(ctx context.Context, resource managedFileResourceSpecInternal) (resourceMeta, error) {
spec := swarm.ConfigSpec{
- Annotations: swarm.Annotations{Name: resource.Name, Labels: resource.Labels},
- Data: resource.Data,
+ Name: resource.Name, Labels: resource.Labels,
+ Data: resource.Data,
}
if resource.TemplateDriver != "" {
spec.Templating = &swarm.Driver{Name: resource.TemplateDriver}
@@ -272,8 +272,8 @@ func secretFileResourceAdapterInternal(dockerClient *dockerclient.Client) fileRe
},
Create: func(ctx context.Context, resource managedFileResourceSpecInternal) (resourceMeta, error) {
spec := swarm.SecretSpec{
- Annotations: swarm.Annotations{Name: resource.Name, Labels: resource.Labels},
- Data: resource.Data,
+ Name: resource.Name, Labels: resource.Labels,
+ Data: resource.Data,
}
if resource.Driver != "" {
spec.Driver = &swarm.Driver{Name: resource.Driver, Options: resource.DriverOpts}
diff --git a/backend/pkg/pagination/reflect_test.go b/backend/pkg/pagination/reflect_test.go
index 22273f4bf..78ea4e7f1 100644
--- a/backend/pkg/pagination/reflect_test.go
+++ b/backend/pkg/pagination/reflect_test.go
@@ -34,8 +34,8 @@ func walkWidgetPages(t *testing.T, db *gorm.DB, sort string) []string {
for start := 0; start < 5; start += 2 {
var got []widget
_, err := PaginateAndSortDB(QueryParams{
- Params: Params{Start: start, Limit: 2},
- SortParams: SortParams{Sort: sort, Order: "asc"},
+ Start: start, Limit: 2,
+ Sort: sort, Order: "asc",
}, db.Model(&widget{}), &got)
require.NoError(t, err)
for _, w := range got {
diff --git a/backend/pkg/pagination/skipcount_test.go b/backend/pkg/pagination/skipcount_test.go
index a76538e20..83576f569 100644
--- a/backend/pkg/pagination/skipcount_test.go
+++ b/backend/pkg/pagination/skipcount_test.go
@@ -30,8 +30,8 @@ func TestPaginateAndSortDB_SkipCountReturnsUnknownTotals(t *testing.T) {
var got []widget
resp, err := PaginateAndSortDB(QueryParams{
- Params: Params{Start: 0, Limit: 2, SkipCount: true},
- SortParams: SortParams{Sort: "Name", Order: "asc"},
+ Start: 0, Limit: 2, SkipCount: true,
+ Sort: "Name", Order: "asc",
}, db.Model(&widget{}), &got)
require.NoError(t, err)
require.Len(t, got, 2)
@@ -46,8 +46,8 @@ func TestPaginateAndSortDB_DefaultStillCounts(t *testing.T) {
var got []widget
resp, err := PaginateAndSortDB(QueryParams{
- Params: Params{Start: 0, Limit: 2},
- SortParams: SortParams{Sort: "Name", Order: "asc"},
+ Start: 0, Limit: 2,
+ Sort: "Name", Order: "asc",
}, db.Model(&widget{}), &got)
require.NoError(t, err)
require.Len(t, got, 2)
@@ -60,8 +60,8 @@ func TestPaginateAndSortDB_SkipCountShowAll(t *testing.T) {
var got []widget
resp, err := PaginateAndSortDB(QueryParams{
- Params: Params{Start: 0, Limit: -1, SkipCount: true},
- SortParams: SortParams{Sort: "Name", Order: "asc"},
+ Start: 0, Limit: -1, SkipCount: true,
+ Sort: "Name", Order: "asc",
}, db.Model(&widget{}), &got)
require.NoError(t, err)
require.Len(t, got, 5)
@@ -76,8 +76,8 @@ func TestPaginateAndSortDB_HonoursUnalignedStart(t *testing.T) {
var got []widget
resp, err := PaginateAndSortDB(QueryParams{
- Params: Params{Start: 3, Limit: 2},
- SortParams: SortParams{Sort: "Name", Order: "asc"},
+ Start: 3, Limit: 2,
+ Sort: "Name", Order: "asc",
}, db.Model(&widget{}), &got)
require.NoError(t, err)
require.Len(t, got, 2)
diff --git a/backend/pkg/pagination/sort_test.go b/backend/pkg/pagination/sort_test.go
index 3d79829e3..d919512ff 100644
--- a/backend/pkg/pagination/sort_test.go
+++ b/backend/pkg/pagination/sort_test.go
@@ -144,8 +144,8 @@ func TestSearchOrderAndPaginateStablePageWalkAcrossReorderedInput(t *testing.T)
r.Shuffle(len(shuffled), func(i, j int) { shuffled[i], shuffled[j] = shuffled[j], shuffled[i] })
result := SearchOrderAndPaginate(shuffled, QueryParams{
- SortParams: SortParams{Sort: sort},
- Params: Params{Start: start, Limit: limit},
+ Sort: sort,
+ Start: start, Limit: limit,
}, config)
for _, item := range result.Items {
seen[item.ID]++
diff --git a/backend/pkg/scheduler/auto_heal_job_test.go b/backend/pkg/scheduler/auto_heal_job_test.go
index 03695f576..3141ea4cb 100644
--- a/backend/pkg/scheduler/auto_heal_job_test.go
+++ b/backend/pkg/scheduler/auto_heal_job_test.go
@@ -191,19 +191,19 @@ func TestAutoHeal_Run_UsesBoundedConcurrency(t *testing.T) {
}, nil
}
- var current int32
- var maxConcurrent int32
- var restarts int32
+ var current atomic.Int32
+ var maxConcurrent atomic.Int32
+ var restarts atomic.Int32
job.inspectContainer = func(ctx context.Context, dockerClient *client.Client, containerID string) (container.InspectResponse, error) {
- active := atomic.AddInt32(&current, 1)
+ active := current.Add(1)
for {
- maxSeen := atomic.LoadInt32(&maxConcurrent)
- if active <= maxSeen || atomic.CompareAndSwapInt32(&maxConcurrent, maxSeen, active) {
+ maxSeen := maxConcurrent.Load()
+ if active <= maxSeen || maxConcurrent.CompareAndSwap(maxSeen, active) {
break
}
}
- defer atomic.AddInt32(&current, -1)
+ defer current.Add(-1)
time.Sleep(40 * time.Millisecond)
@@ -217,15 +217,15 @@ func TestAutoHeal_Run_UsesBoundedConcurrency(t *testing.T) {
}
}
job.restartContainer = func(ctx context.Context, dockerClient *client.Client, containerID string) error {
- atomic.AddInt32(&restarts, 1)
+ restarts.Add(1)
return nil
}
job.Run(ctx)
- require.Greater(t, atomic.LoadInt32(&maxConcurrent), int32(1))
- require.LessOrEqual(t, atomic.LoadInt32(&maxConcurrent), int32(autoHealInspectConcurrency))
- require.Equal(t, int32(4), atomic.LoadInt32(&restarts))
+ require.Greater(t, maxConcurrent.Load(), int32(1))
+ require.LessOrEqual(t, maxConcurrent.Load(), int32(autoHealInspectConcurrency))
+ require.Equal(t, int32(4), restarts.Load())
}
func TestAutoHealJob_OverlappingRunIsSkippedInternal(t *testing.T) {
diff --git a/backend/pkg/utils/handlerutil/handlerutil.go b/backend/pkg/utils/handlerutil/handlerutil.go
index 9daed705d..f5563ce6b 100644
--- a/backend/pkg/utils/handlerutil/handlerutil.go
+++ b/backend/pkg/utils/handlerutil/handlerutil.go
@@ -43,17 +43,11 @@ func PaginationParams(start, limit int, sortCol, sortDir, search string) paginat
}
return pagination.QueryParams{
- SearchQuery: pagination.SearchQuery{
- Search: strings.TrimSpace(search),
- },
- SortParams: pagination.SortParams{
- Sort: strings.TrimSpace(sortCol),
- Order: pagination.SortOrder(sortDir),
- },
- Params: pagination.Params{
- Start: start,
- Limit: limit,
- },
+ Search: strings.TrimSpace(search),
+ Sort: strings.TrimSpace(sortCol),
+ Order: pagination.SortOrder(sortDir),
+ Start: start,
+ Limit: limit,
Filters: make(map[string]string),
}
}
diff --git a/backend/pkg/utils/httpx/request.go b/backend/pkg/utils/httpx/request.go
index 45b6c2b83..024578316 100644
--- a/backend/pkg/utils/httpx/request.go
+++ b/backend/pkg/utils/httpx/request.go
@@ -81,8 +81,8 @@ func IsWebSocketUpgradeRequest(r *http.Request) bool {
func isLocalhost(host string) bool {
hostOnly := host
- if idx := strings.LastIndex(host, ":"); idx != -1 {
- hostOnly = host[:idx]
+ if before, _, found := strings.CutLast(host, ":"); found {
+ hostOnly = before
}
return hostOnly == "localhost" ||
diff --git a/backend/pkg/utils/mapper/mapper_test.go b/backend/pkg/utils/mapper/mapper_test.go
index ff9d99e83..b3260d6e4 100644
--- a/backend/pkg/utils/mapper/mapper_test.go
+++ b/backend/pkg/utils/mapper/mapper_test.go
@@ -11,17 +11,15 @@ import (
func TestMapOneConvertsNetworkIPAMConfigInternal(t *testing.T) {
source := dockernetwork.Inspect{
- Network: dockernetwork.Network{
- IPAM: dockernetwork.IPAM{
- Driver: "default",
- Config: []dockernetwork.IPAMConfig{
- {
- Subnet: netip.MustParsePrefix("172.16.5.0/24"),
- Gateway: netip.MustParseAddr("172.16.5.1"),
- AuxAddress: map[string]netip.Addr{
- "dns": netip.MustParseAddr("172.16.5.53"),
- "unset": {},
- },
+ IPAM: dockernetwork.IPAM{
+ Driver: "default",
+ Config: []dockernetwork.IPAMConfig{
+ {
+ Subnet: netip.MustParsePrefix("172.16.5.0/24"),
+ Gateway: netip.MustParseAddr("172.16.5.1"),
+ AuxAddress: map[string]netip.Addr{
+ "dns": netip.MustParseAddr("172.16.5.53"),
+ "unset": {},
},
},
},
diff --git a/backend/pkg/workspace/workspace_test.go b/backend/pkg/workspace/workspace_test.go
index c9a1e44c8..162f78fa2 100644
--- a/backend/pkg/workspace/workspace_test.go
+++ b/backend/pkg/workspace/workspace_test.go
@@ -7,8 +7,6 @@ import (
"github.com/stretchr/testify/require"
)
-func intPointer(value int) *int { return &value }
-
func TestEffectiveMaxFileSizeMB(t *testing.T) {
require.Equal(t, DefaultMaxFileSizeMB, EffectiveMaxFileSizeMB(0))
require.Equal(t, DefaultMaxFileSizeMB, EffectiveMaxFileSizeMB(-1))
@@ -38,9 +36,9 @@ func TestValidateTextContentUsesDynamicMiBLimit(t *testing.T) {
func TestValidateUploadIndices(t *testing.T) {
valid := []UploadReference{
- {Operation: "create_file", UploadIndex: intPointer(1)},
+ {Operation: "create_file", UploadIndex: new(1)},
{Operation: "create_folder"},
- {Operation: "update_file", UploadIndex: intPointer(0)},
+ {Operation: "update_file", UploadIndex: new(0)},
}
require.NoError(t, ValidateUploadIndices(valid, 2, "create_file", "update_file"))
@@ -51,11 +49,11 @@ func TestValidateUploadIndices(t *testing.T) {
message string
}{
{name: "missing", changes: []UploadReference{{Operation: "create_file"}}, uploadCount: 0, message: "required"},
- {name: "unexpected", changes: []UploadReference{{Operation: "delete", UploadIndex: intPointer(0)}}, uploadCount: 1, message: "not allowed"},
- {name: "negative", changes: []UploadReference{{Operation: "create_file", UploadIndex: intPointer(-1)}}, uploadCount: 1, message: "out of range"},
- {name: "out of range", changes: []UploadReference{{Operation: "create_file", UploadIndex: intPointer(1)}}, uploadCount: 1, message: "out of range"},
- {name: "duplicate", changes: []UploadReference{{Operation: "create_file", UploadIndex: intPointer(0)}, {Operation: "update_file", UploadIndex: intPointer(0)}}, uploadCount: 1, message: "duplicated"},
- {name: "unused", changes: []UploadReference{{Operation: "create_file", UploadIndex: intPointer(0)}}, uploadCount: 2, message: "unused"},
+ {name: "unexpected", changes: []UploadReference{{Operation: "delete", UploadIndex: new(0)}}, uploadCount: 1, message: "not allowed"},
+ {name: "negative", changes: []UploadReference{{Operation: "create_file", UploadIndex: new(-1)}}, uploadCount: 1, message: "out of range"},
+ {name: "out of range", changes: []UploadReference{{Operation: "create_file", UploadIndex: new(1)}}, uploadCount: 1, message: "out of range"},
+ {name: "duplicate", changes: []UploadReference{{Operation: "create_file", UploadIndex: new(0)}, {Operation: "update_file", UploadIndex: new(0)}}, uploadCount: 1, message: "duplicated"},
+ {name: "unused", changes: []UploadReference{{Operation: "create_file", UploadIndex: new(0)}}, uploadCount: 2, message: "unused"},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
diff --git a/cli/go.mod b/cli/go.mod
index efc6c54b2..2260e53c7 100644
--- a/cli/go.mod
+++ b/cli/go.mod
@@ -1,6 +1,6 @@
module github.com/getarcaneapp/arcane/cli/v2
-go 1.26.6
+go 1.27
replace github.com/getarcaneapp/arcane/types/v2 => ../types
@@ -19,7 +19,7 @@ require (
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
github.com/spf13/viper v1.21.0
- github.com/stretchr/testify v1.11.1
+ github.com/stretchr/testify v1.12.1
go.getarcane.app/acfs v0.4.1
go.getarcane.app/sys/bytes v0.1.0
)
@@ -42,9 +42,8 @@ require (
github.com/compose-spec/compose-go/v2 v2.14.0 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
- github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
- github.com/docker/go-connections v0.7.0 // indirect
+ github.com/docker/go-connections v0.8.1 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
@@ -68,7 +67,6 @@ require (
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/pelletier/go-toml/v2 v2.4.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.24.1 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.70.1 // indirect
@@ -77,24 +75,23 @@ require (
github.com/sagikazarmark/locafero v0.12.0 // indirect
github.com/sahilm/fuzzy v0.1.3 // indirect
github.com/samber/go-singleflightx v0.3.2 // indirect
- github.com/sirupsen/logrus v1.9.4 // indirect
+ github.com/sirupsen/logrus v1.10.0 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect
- go.opentelemetry.io/otel v1.44.0 // indirect
- go.opentelemetry.io/otel/metric v1.44.0 // indirect
- go.opentelemetry.io/otel/trace v1.44.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 // indirect
+ go.opentelemetry.io/otel v1.45.0 // indirect
+ go.opentelemetry.io/otel/metric v1.45.0 // indirect
+ go.opentelemetry.io/otel/trace v1.45.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
go.yaml.in/yaml/v4 v4.0.0-rc.6 // indirect
golang.org/x/exp v0.0.0-20260718201538-764159d718ef // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
- golang.org/x/text v0.40.0 // indirect
+ golang.org/x/text v0.41.0 // indirect
google.golang.org/protobuf v1.36.12 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/cli/go.sum b/cli/go.sum
index 9d69a8dc4..e8cb35e53 100644
--- a/cli/go.sum
+++ b/cli/go.sum
@@ -53,12 +53,10 @@ github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmC
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
-github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
-github.com/docker/go-connections v0.7.0 h1:6SsRfJddP22WMrCkj19x9WKjEDTB+ahsdiGYf0mN39c=
-github.com/docker/go-connections v0.7.0/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
+github.com/docker/go-connections v0.8.1 h1:JibmG5hULs5qXSr/cp/w3Pw5fZuStt4MOHMUExb29/M=
+github.com/docker/go-connections v0.8.1/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc=
@@ -124,8 +122,6 @@ github.com/pelletier/go-toml/v2 v2.4.3/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
-github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.24.1 h1:JnJkREXzWxUdCuPFpIWZiPispT9xVV59uiuyR2bPlnU=
github.com/prometheus/client_golang v1.24.1/go.mod h1:F+oSRECHg4sse5ucfYpYDeIv/hu68Zo0uoHKetWnzcE=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
@@ -147,8 +143,8 @@ github.com/samber/go-singleflightx v0.3.2 h1:jXbUU0fvis8Fdv4HGONboX5WdEZcYLoBEcK
github.com/samber/go-singleflightx v0.3.2/go.mod h1:X2BR+oheHIYc73PvxRMlcASg6KYYTQyUYpdVU7t/ux4=
github.com/samber/hot v0.13.0 h1:4/OyD5xNfhmdHqyKWHHSisiytp93gA3knkWZLAvld2w=
github.com/samber/hot v0.13.0/go.mod h1:NB9v5U4NfDx7jmlrP+zHuqCuLUsywgAtCH7XOAkOxAg=
-github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
-github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
+github.com/sirupsen/logrus v1.10.0 h1:T8MxJJXVZkfcC5zSRMRAg2F8+lxjmUCGGWPzFxO+Msc=
+github.com/sirupsen/logrus v1.10.0/go.mod h1:FXZFonkDAnFozmO+5hGAFvB0Yg9/j2SIhA/QuIkP180=
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
@@ -162,8 +158,8 @@ github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
-github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
+github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
+github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
@@ -176,18 +172,18 @@ go.getarcane.app/sys/bytes v0.1.0 h1:snAEkCKzzd7PQ4bAI4gYx92YjZL4ZZK43Z/8y/P5uro
go.getarcane.app/sys/bytes v0.1.0/go.mod h1:R2mujqg+MmC2tr+97IPqaxzvBC8+ykng+5r+XNxwY+8=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI=
-go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU=
-go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc=
-go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc=
-go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo=
-go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58=
-go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0=
-go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI=
-go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA=
-go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk=
-go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 h1:LMuyCAyfalSjDyjdC65nK6N0zoTT63+E/u95X0JovZI=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0/go.mod h1:085m8qbm4hgc8rZWGDEa4vmyyo2c3nPxUslYUKUIU04=
+go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU=
+go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ=
+go.opentelemetry.io/otel/metric v1.45.0 h1:7Eg1uH7CJ5cXv9is6tnBe1FI6rj1nwUdbFypRm3br/M=
+go.opentelemetry.io/otel/metric v1.45.0/go.mod h1:HAPbm1nd3p1PmFH7v2dR+6BjXxw+Lq4a2+pndMAm08s=
+go.opentelemetry.io/otel/sdk v1.45.0 h1:4VVSMgQ83dUgW2aoX5f6JgLvHwIvzcuLnF9lUdCSpCw=
+go.opentelemetry.io/otel/sdk v1.45.0/go.mod h1:Sr40LgXV7DsKMMJMKOhUWOgMWTfAaqvm2kF0g7ilwuA=
+go.opentelemetry.io/otel/sdk/metric v1.45.0 h1:oVFszMfyj1Am6s24Vtc7wBb8BKLcwepJjNEYILuiE3o=
+go.opentelemetry.io/otel/sdk/metric v1.45.0/go.mod h1:vUWUxDZvu1WVRj8JA8S0AdhsPrZoDpA2DdZauIh4mDA=
+go.opentelemetry.io/otel/trace v1.45.0 h1:l/mP6Uv7oNO7/TblbhpbgMidxhq1uO/rPsikOyVhxag=
+go.opentelemetry.io/otel/trace v1.45.0/go.mod h1:qoJJA2xNMnxRrdISU/kLtfUH2wNeQbiv+jhs/CxI8bc=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
@@ -207,15 +203,11 @@ golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
-golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
-golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
+golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
+golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
diff --git a/cli/internal/client/retry_test.go b/cli/internal/client/retry_test.go
index cc24b9a2e..83b4d5ff0 100644
--- a/cli/internal/client/retry_test.go
+++ b/cli/internal/client/retry_test.go
@@ -16,9 +16,9 @@ import (
func TestClient_RetriesIdempotentRequests(t *testing.T) {
t.Parallel()
- var attempts int32
+ var attempts atomic.Int32
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- current := atomic.AddInt32(&attempts, 1)
+ current := attempts.Add(1)
if current == 1 {
w.WriteHeader(http.StatusServiceUnavailable)
_, _ = w.Write([]byte(`{"error":"temporary"}`))
@@ -44,7 +44,7 @@ func TestClient_RetriesIdempotentRequests(t *testing.T) {
_ = resp.Body.Close()
{
- got := atomic.LoadInt32(&attempts)
+ got := attempts.Load()
require.Equal(t, int32(2), got,
"expected 2 attempts, got %d", got)
}
@@ -54,9 +54,9 @@ func TestClient_RetriesIdempotentRequests(t *testing.T) {
func TestClient_DoesNotRetryNonIdempotentRequests(t *testing.T) {
t.Parallel()
- var attempts int32
+ var attempts atomic.Int32
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- atomic.AddInt32(&attempts, 1)
+ attempts.Add(1)
w.WriteHeader(http.StatusServiceUnavailable)
_, _ = w.Write([]byte(`{"error":"temporary"}`))
}))
@@ -77,7 +77,7 @@ func TestClient_DoesNotRetryNonIdempotentRequests(t *testing.T) {
_ = resp.Body.Close()
{
- got := atomic.LoadInt32(&attempts)
+ got := attempts.Load()
require.Equal(t, int32(1), got,
"expected 1 attempt, got %d", got)
}
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 49c911c23..21a3a6566 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -29,8 +29,7 @@ ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN pnpm -C frontend build
# Stage 2: Build Backend
-FROM --platform=$BUILDPLATFORM golang:1.26.6-trixie AS backend-builder
-ENV GOEXPERIMENT=jsonv2
+FROM --platform=$BUILDPLATFORM golang:1.27-trixie AS backend-builder
ARG TARGETARCH
ARG TARGETVARIANT
ARG BUILD_TAGS
@@ -61,9 +60,9 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
if [ "${BUILD_TIME}" = "unknown" ]; then BUILD_TIME=$(jq -r '.buildTime // "unknown"' ../arcane.json); fi && \
export GOARCH="${TARGETARCH}" && \
if [ "${TARGETARCH}" = "arm" ]; then \
- GOARM="${TARGETVARIANT#v}"; \
- if [ -z "${GOARM}" ]; then GOARM="7"; fi; \
- export GOARM; \
+ GOARM="${TARGETVARIANT#v}"; \
+ if [ -z "${GOARM}" ]; then GOARM="7"; fi; \
+ export GOARM; \
fi && \
CGO_ENABLED=0 GOOS=linux \
go build \
diff --git a/docker/Dockerfile-agent b/docker/Dockerfile-agent
index aed090d94..5cda9067b 100644
--- a/docker/Dockerfile-agent
+++ b/docker/Dockerfile-agent
@@ -3,8 +3,7 @@ ARG VERSION="dev"
ARG REVISION="unknown"
ARG ARCANE_RUNTIME_BASE_IMAGE=ghcr.io/getarcaneapp/base:distroless
-FROM --platform=$BUILDPLATFORM golang:1.26.6-trixie AS agent-builder
-ENV GOEXPERIMENT=jsonv2
+FROM --platform=$BUILDPLATFORM golang:1.27-trixie AS agent-builder
ARG TARGETARCH
ARG TARGETVARIANT
ARG BUILD_TAGS="exclude_frontend"
@@ -33,9 +32,9 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
if [ "${BUILD_TIME}" = "unknown" ]; then BUILD_TIME=$(jq -r '.buildTime // "unknown"' ../arcane.json); fi && \
export GOARCH="${TARGETARCH}" && \
if [ "${TARGETARCH}" = "arm" ]; then \
- GOARM="${TARGETVARIANT#v}"; \
- if [ -z "${GOARM}" ]; then GOARM="7"; fi; \
- export GOARM; \
+ GOARM="${TARGETVARIANT#v}"; \
+ if [ -z "${GOARM}" ]; then GOARM="7"; fi; \
+ export GOARM; \
fi && \
CGO_ENABLED=0 GOOS=linux \
go build \
diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev
index b473e6deb..692695dc6 100644
--- a/docker/Dockerfile.dev
+++ b/docker/Dockerfile.dev
@@ -31,8 +31,7 @@ EXPOSE 3000
CMD ["pnpm", "-C", "frontend", "dev", "--host", "0.0.0.0"]
# Stage 2: Backend Development with optimized caching
-FROM --platform=$BUILDPLATFORM golang:1.26.6-trixie AS backend-dev
-ENV GOEXPERIMENT=jsonv2
+FROM --platform=$BUILDPLATFORM golang:1.27-trixie AS backend-dev
# Install development tools in a single layer
RUN apt-get update && apt-get install -y --no-install-recommends \
diff --git a/docker/compose.dev.yaml b/docker/compose.dev.yaml
index 54a653396..4775eed5e 100644
--- a/docker/compose.dev.yaml
+++ b/docker/compose.dev.yaml
@@ -36,8 +36,6 @@ services:
context: ..
dockerfile: docker/Dockerfile.dev
target: backend-dev
- args:
- GO_VERSION: "1.26.0"
container_name: arcane-backend-dev
ports:
- "3552:3552"
@@ -85,8 +83,6 @@ services:
context: ..
dockerfile: docker/Dockerfile.dev
target: backend-dev
- args:
- GO_VERSION: "1.26.0"
container_name: arcane-agent
ports:
- "3553:3553"
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index a87db5246..1bb45a6c6 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -2956,6 +2956,11 @@
"diagnostics_error_load": "Failed to load diagnostics",
"diagnostics_error_download": "Download failed",
"diagnostics_error_dump": "Failed to load dump",
+ "diagnostics_tab_connections": "Connections",
+ "diagnostics_tab_profiling": "Profiling",
+ "diagnostics_connections_empty": "No active WebSocket connections.",
+ "diagnostics_section_system": "System status",
+ "diagnostics_download": "Download",
"diagnostics_stat_heap_alloc": "Heap Alloc",
"diagnostics_stat_ws_conns": "WS Conns",
"diagnostics_stat_gc_cycles": "GC Cycles",
@@ -2967,6 +2972,19 @@
"diagnostics_runtime_num_cpu": "Logical CPUs",
"diagnostics_runtime_ws_workers": "WS worker goroutines",
"diagnostics_runtime_cgo_calls": "Cgo calls",
+ "diagnostics_runtime_leaked_goroutines": "Leaked goroutines",
+ "diagnostics_leaks_found": "{count} leaked",
+ "diagnostics_leaks_none": "No leaks detected",
+ "diagnostics_leaks_not_scanned": "Not scanned",
+ "diagnostics_section_leaks": "Goroutine Leak Monitor",
+ "diagnostics_leaks_hint": "A leaked goroutine is blocked on a channel, mutex, cond, or similar primitive that can never be unblocked. The runtime finds these with a special garbage-collection cycle, so scans run on demand instead of on the live stream.",
+ "diagnostics_leaks_limitations": "Leaks caused by blocking on primitives still reachable from globals or from runnable goroutines may not be reported.",
+ "diagnostics_leaks_scan": "Scan for leaks",
+ "diagnostics_leaks_last_scan": "Last scan {when}",
+ "diagnostics_leaks_empty": "No leaked goroutines in the last scan.",
+ "diagnostics_leaks_count": "{count} leaked goroutines",
+ "diagnostics_error_scan_leaks": "Failed to scan for goroutine leaks",
+ "diagnostics_profile_goroutineleak": "Goroutine leaks",
"diagnostics_section_memory": "Memory / Heap",
"diagnostics_mem_in_use": "In use",
"diagnostics_mem_released": "Released",
diff --git a/frontend/src/lib/services/diagnostics-service.ts b/frontend/src/lib/services/diagnostics-service.ts
index 217d1bd1d..4cb2e1757 100644
--- a/frontend/src/lib/services/diagnostics-service.ts
+++ b/frontend/src/lib/services/diagnostics-service.ts
@@ -1,5 +1,5 @@
import BaseAPIService from './api-service';
-import type { Diagnostics, LogEntry, PprofProfile } from '#lib/types/diagnostics';
+import type { Diagnostics, GoroutineLeakReport, LogEntry, PprofProfile } from '#lib/types/diagnostics';
class DiagnosticsAPIService extends BaseAPIService {
/** One-shot runtime/memory/GC + WebSocket snapshot (used for initial paint). */
@@ -23,6 +23,14 @@ class DiagnosticsAPIService extends BaseAPIService {
return (res.data ?? '') as string;
}
+ /** Run a leak-detection GC and return leaked-goroutine stacks (debug=1 text). */
+ async scanGoroutineLeaks(): Promise<GoroutineLeakReport> {
+ const res = await this.api.post('/diagnostics/goroutineleak', undefined, {
+ timeout: 60000
+ });
+ return res.data as GoroutineLeakReport;
+ }
+
/**
* Download a raw pprof profile via the authed client (so bearer/API-key auth
* is attached) and trigger a browser save. `profile` and `trace` are
@@ -37,8 +45,13 @@ class DiagnosticsAPIService extends BaseAPIService {
const res = await this.api.get(`/debug/pprof/${profile}`, {
params,
responseType: 'blob',
- // Sampled profiles block for their full duration.
- timeout: profile === 'profile' || profile === 'trace' ? (seconds ?? defaultSeconds) * 1000 + 15000 : undefined
+ // Sampled profiles block for their full duration; goroutineleak runs a GC.
+ timeout:
+ profile === 'profile' || profile === 'trace'
+ ? (seconds ?? defaultSeconds) * 1000 + 15000
+ : profile === 'goroutineleak'
+ ? 60000
+ : undefined
});
const blob = res.data as Blob;
diff --git a/frontend/src/lib/types/diagnostics.ts b/frontend/src/lib/types/diagnostics.ts
index e7ba07f7e..bb008565f 100644
--- a/frontend/src/lib/types/diagnostics.ts
+++ b/frontend/src/lib/types/diagnostics.ts
@@ -3,6 +3,8 @@
export interface RuntimeInfo {
goroutines: number;
wsWorkerGoroutines: number;
+ leakedGoroutines: number;
+ leakScannedAt?: string;
gomaxprocs: number;
numCpu: number;
goVersion: string;
@@ -79,4 +81,19 @@ export interface LogEntry {
attrs?: Record<string, unknown>;
}
-export type PprofProfile = 'heap' | 'goroutine' | 'allocs' | 'block' | 'mutex' | 'threadcreate' | 'profile' | 'trace';
+export interface GoroutineLeakReport {
+ count: number;
+ profile: string;
+ scannedAt: string;
+}
+
+export type PprofProfile =
+ | 'heap'
+ | 'goroutine'
+ | 'goroutineleak'
+ | 'allocs'
+ | 'block'
+ | 'mutex'
+ | 'threadcreate'
+ | 'profile'
+ | 'trace';
diff --git a/frontend/src/routes/(app)/settings/+layout.svelte b/frontend/src/routes/(app)/settings/+layout.svelte
index 77e387f36..9e10c2739 100644
--- a/frontend/src/routes/(app)/settings/+layout.svelte
+++ b/frontend/src/routes/(app)/settings/+layout.svelte
@@ -37,6 +37,8 @@
return m.webhook_page_title();
case 'build':
return 'Build';
+ case 'diagnostics':
+ return m.diagnostics();
default:
return m.settings();
}
diff --git a/frontend/src/routes/(app)/settings/diagnostics/+page.svelte b/frontend/src/routes/(app)/settings/diagnostics/+page.svelte
index 71aeb359c..cf5a7556a 100644
--- a/frontend/src/routes/(app)/settings/diagnostics/+page.svelte
+++ b/frontend/src/routes/(app)/settings/diagnostics/+page.svelte
@@ -4,25 +4,34 @@
import { m } from '#lib/paraglide/messages';
import { ArcaneButton } from '#lib/components/arcane-button/index.js';
import * as Collapsible from '#lib/components/ui/collapsible';
+ import * as Alert from '#lib/components/ui/alert';
+ import * as Table from '#lib/components/ui/table';
+ import * as Tabs from '#lib/components/ui/tabs';
+ import { TabBar, type TabItem } from '#lib/components/tab-bar/index.js';
+ import { SettingsPageLayout } from '#lib/layouts';
+ import type { SettingsActionButton, SettingsStatCard } from '#lib/layouts/types.js';
+ import { useUrlTab } from '#lib/hooks/use-url-tab.svelte';
import { createDiagnosticsWebSocket, ReconnectingWebSocket } from '#lib/utils/ws';
import { diagnosticsService } from '#lib/services/diagnostics-service';
- import type { Diagnostics, PprofProfile } from '#lib/types/diagnostics';
+ import type { Diagnostics, GoroutineLeakReport, PprofProfile } from '#lib/types/diagnostics';
import {
ActivityIcon,
+ AlertTriangleIcon,
CpuIcon,
MemoryStickIcon,
ClockIcon,
ConnectionIcon,
- RefreshIcon,
DownloadIcon,
ArrowDownIcon
} from '#lib/icons';
- import DiagnosticStat from './diagnostic-stat.svelte';
import DiagnosticLogPanel from './diagnostic-log-panel.svelte';
+ import DiagnosticLeakPanel from './diagnostic-leak-panel.svelte';
import { formatTime } from '#lib/utils/formatting';
let {}: PageProps = $props();
+ type DiagnosticsTab = 'overview' | 'connections' | 'logs' | 'profiling';
+
let diag = $state<Diagnostics | null>(null);
let connected = $state(false);
let paused = $state(false);
@@ -74,6 +83,13 @@
return ms < 1 ? `${(ns / 1e3).toFixed(0)}µs` : `${ms.toFixed(2)}ms`;
}
+ function leakedGoroutineValue(d: Diagnostics): string {
+ if (d.runtime.leakScannedAt || d.runtime.leakedGoroutines > 0) {
+ return fmtNum(d.runtime.leakedGoroutines);
+ }
+ return m.diagnostics_leaks_not_scanned();
+ }
+
const agoText = $derived.by(() => {
if (!lastUpdated) return '—';
const s = Math.max(0, Math.round((now - lastUpdated) / 1000));
@@ -86,6 +102,45 @@
return s.projectLogsActive + s.containerLogsActive + s.containerStats + s.containerExec + s.systemStats + s.serviceLogsActive;
});
+ const wsCounts = $derived.by(() => {
+ const s = diag?.websocket?.snapshot;
+ if (!s) return [];
+ return [
+ { label: m.diagnostics_ws_project_logs(), value: s.projectLogsActive },
+ { label: m.diagnostics_ws_container_logs(), value: s.containerLogsActive },
+ { label: m.diagnostics_ws_container_stats(), value: s.containerStats },
+ { label: m.diagnostics_ws_terminals(), value: s.containerExec },
+ { label: m.diagnostics_ws_system_stats(), value: s.systemStats },
+ { label: m.diagnostics_ws_service_logs(), value: s.serviceLogsActive }
+ ];
+ });
+
+ const diagnosticsTabItems = $derived.by(
+ () =>
+ [
+ { value: 'overview', label: m.common_overview(), icon: CpuIcon },
+ {
+ value: 'connections',
+ label: m.diagnostics_tab_connections(),
+ icon: ConnectionIcon,
+ badge: totalConnections || undefined
+ },
+ { value: 'logs', label: m.common_logs(), icon: ActivityIcon },
+ {
+ value: 'profiling',
+ label: m.diagnostics_tab_profiling(),
+ icon: DownloadIcon,
+ badge: diag?.runtime.leakedGoroutines || undefined
+ }
+ ] satisfies TabItem[]
+ );
+
+ const urlTab = useUrlTab<DiagnosticsTab>({
+ validTabs: () => diagnosticsTabItems.map((tab) => tab.value as DiagnosticsTab),
+ defaultTab: () => 'overview'
+ });
+ const activeTab = $derived(urlTab.value);
+
const heapBar = $derived.by(() => {
const mem = diag?.memory;
if (!mem || !mem.heapSys) return null;
@@ -105,6 +160,53 @@
return p.length ? Math.max(...p) : 0;
});
+ const headerStats = $derived.by((): SettingsStatCard[] => {
+ if (!diag) return [];
+ return [
+ {
+ title: m.diagnostics_updated_ago({ ago: agoText }),
+ value: paused ? m.paused() : connected ? m.common_live() : m.diagnostics_status_connecting(),
+ icon: ActivityIcon,
+ iconColor: paused ? 'text-amber-500' : connected ? 'text-emerald-500' : 'text-muted-foreground'
+ },
+ {
+ title: m.goroutines(),
+ value: fmtNum(diag.runtime.goroutines),
+ icon: ActivityIcon,
+ iconColor: diag.runtime.leakedGoroutines > 0 ? 'text-rose-500' : 'text-sky-500'
+ },
+ {
+ title: m.diagnostics_stat_heap_alloc(),
+ value: fmtBytes(diag.memory.heapAlloc),
+ icon: MemoryStickIcon,
+ iconColor: 'text-violet-500'
+ },
+ {
+ title: m.common_uptime(),
+ value: fmtUptime(diag.runtime.uptimeSeconds),
+ icon: ClockIcon,
+ iconColor: 'text-teal-500'
+ }
+ ];
+ });
+
+ const actionButtons = $derived.by((): SettingsActionButton[] => [
+ {
+ id: 'pause',
+ action: paused ? 'unpause' : 'pause',
+ label: paused ? m.diagnostics_resume() : m.common_pause(),
+ onclick: togglePause,
+ showOnMobile: true
+ },
+ {
+ id: 'refresh',
+ action: 'refresh',
+ label: m.common_refresh(),
+ onclick: refresh,
+ showOnMobile: true
+ }
+ ]);
+
function applySnapshot(d: Diagnostics) {
diag = d;
lastUpdated = Date.now();
@@ -140,7 +242,6 @@
}
}
- // --- pprof dumps (inline) ---
let dumpOpen = $state<{ goroutine: boolean; heap: boolean }>({ goroutine: false, heap: false });
let dumpText = $state<{ goroutine: string; heap: string }>({ goroutine: '', heap: '' });
let dumpLoading = $state<{ goroutine: boolean; heap: boolean }>({ goroutine: false, heap: false });
@@ -161,10 +262,15 @@
if (open && !dumpText[name] && !dumpLoading[name]) loadDump(name);
}
- // --- profile downloads ---
+ const dumps = [
+ { id: 'goroutine' as const, label: m.diagnostics_dump_goroutine() },
+ { id: 'heap' as const, label: m.diagnostics_dump_heap() }
+ ];
+
const profiles: { id: PprofProfile; label: string }[] = [
{ id: 'heap', label: m.diagnostics_profile_heap() },
{ id: 'goroutine', label: m.diagnostics_profile_goroutine() },
+ { id: 'goroutineleak', label: m.diagnostics_profile_goroutineleak() },
{ id: 'allocs', label: m.diagnostics_profile_allocs() },
{ id: 'block', label: m.diagnostics_profile_block() },
{ id: 'mutex', label: m.diagnostics_profile_mutex() },
@@ -172,6 +278,13 @@
{ id: 'profile', label: m.diagnostics_profile_cpu() },
{ id: 'trace', label: m.diagnostics_profile_trace() }
];
+
+ function onLeakScanned(report: GoroutineLeakReport) {
+ if (!diag) return;
+ diag.runtime.leakedGoroutines = report.count;
+ diag.runtime.leakScannedAt = report.scannedAt;
+ }
+
let downloading = $state<string | null>(null);
async function download(p: PprofProfile) {
@@ -196,281 +309,256 @@
});
</script>
-{#snippet row(label: string, value: string | number)}
- <div class="flex items-center justify-between gap-4 py-1.5">
- <span class="text-sm text-muted-foreground">{label}</span>
- <span class="text-sm font-medium tabular-nums">{value}</span>
- </div>
+{#snippet statusList(rows: { label: string; value: string | number }[])}
+ <dl class="grid grid-cols-[minmax(0,1fr)_auto] gap-x-6 gap-y-2.5 text-sm">
+ {#each rows as r (r.label)}
+ <dt class="text-muted-foreground">{r.label}</dt>
+ <dd class="text-right font-medium tabular-nums">{r.value}</dd>
+ {/each}
+ </dl>
{/snippet}
-{#snippet sectionHeader(title: string, Icon: typeof ActivityIcon)}
- <div class="mb-3 flex items-center gap-2">
- <Icon class="size-4 text-muted-foreground" />
- <h2 class="text-sm font-semibold tracking-tight">{title}</h2>
+{#snippet sectionHeading(title: string, description?: string)}
+ <div class="space-y-1">
+ <h3 class="text-base font-semibold">{title}</h3>
+ {#if description}
+ <p class="text-sm text-muted-foreground">{description}</p>
+ {/if}
</div>
{/snippet}
-<div class="px-2 py-4 sm:px-6 sm:py-6 lg:px-8">
- <!-- Header -->
- <div class="flex flex-wrap items-center justify-between gap-4 border-b border-border/50 pb-4 sm:pb-6">
- <div class="flex items-start gap-3 sm:gap-4">
- <div
- class="flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary ring-1 ring-primary/20 sm:size-10"
- >
- <ActivityIcon class="size-4 sm:size-5" />
+<SettingsPageLayout
+ title={m.diagnostics()}
+ description={m.diagnostics_description()}
+ icon={ActivityIcon}
+ pageType="management"
+ statCards={headerStats}
+ {actionButtons}
+>
+ {#snippet mainContent()}
+ {#if error}
+ <div class="mb-6 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive">
+ {error}
</div>
- <div>
- <h1 class="text-xl font-semibold tracking-tight sm:text-2xl">{m.diagnostics()}</h1>
- <p class="mt-1 text-sm text-muted-foreground">{m.diagnostics_description()}</p>
- </div>
- </div>
-
- <div class="flex items-center gap-3">
- <span class="flex items-center gap-1.5 text-xs font-medium">
- <span
- class={cn('size-2 rounded-full', paused ? 'bg-amber-500' : connected ? 'animate-pulse bg-emerald-500' : 'bg-zinc-500')}
- ></span>
- {paused ? m.paused() : connected ? m.common_live() : m.diagnostics_status_connecting()}
- </span>
- <span class="hidden text-xs text-muted-foreground tabular-nums sm:inline"
- >{m.diagnostics_updated_ago({ ago: agoText })}</span
- >
- <ArcaneButton
- action="base"
- tone="outline"
- size="sm"
- customLabel={paused ? m.diagnostics_resume() : m.common_pause()}
- onclick={togglePause}
- />
- <ArcaneButton
- action="base"
- tone="outline"
- size="sm"
- icon={RefreshIcon}
- customLabel={m.common_refresh()}
- onclick={refresh}
- />
- </div>
- </div>
+ {/if}
- {#if error}
- <div class="mt-4 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive">
- {error}
- </div>
- {/if}
-
- {#if diag}
- <!-- Metric tiles -->
- <div class="mt-6 grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-6">
- <DiagnosticStat label={m.goroutines()} value={fmtNum(diag.runtime.goroutines)} icon={ActivityIcon} accent="text-sky-500" />
- <DiagnosticStat
- label={m.diagnostics_stat_heap_alloc()}
- value={fmtBytes(diag.memory.heapAlloc)}
- icon={MemoryStickIcon}
- accent="text-violet-500"
- />
- <DiagnosticStat
- label={m.diagnostics_stat_ws_conns()}
- value={fmtNum(totalConnections)}
- icon={ConnectionIcon}
- accent="text-emerald-500"
- />
- <DiagnosticStat
- label={m.diagnostics_stat_gc_cycles()}
- value={fmtNum(diag.memory.numGc)}
- icon={RefreshIcon}
- accent="text-amber-500"
- />
- <DiagnosticStat
- label={m.diagnostics_stat_cpu_procs()}
- value={`${diag.runtime.gomaxprocs}/${diag.runtime.numCpu}`}
- icon={CpuIcon}
- accent="text-rose-500"
- />
- <DiagnosticStat
- label={m.common_uptime()}
- value={fmtUptime(diag.runtime.uptimeSeconds)}
- icon={ClockIcon}
- accent="text-teal-500"
- />
- </div>
-
- <div class="mt-8 grid gap-8 lg:grid-cols-2">
- <!-- Runtime -->
- <section>
- {@render sectionHeader(m.diagnostics_section_runtime(), CpuIcon)}
- <div class="divide-y divide-border/40">
- {@render row(m.diagnostics_runtime_go_version(), diag.runtime.goVersion)}
- {@render row(m.platform(), `${diag.runtime.os}/${diag.runtime.arch}`)}
- {@render row(m.diagnostics_runtime_gomaxprocs(), diag.runtime.gomaxprocs)}
- {@render row(m.diagnostics_runtime_num_cpu(), diag.runtime.numCpu)}
- {@render row(m.goroutines(), fmtNum(diag.runtime.goroutines))}
- {@render row(m.diagnostics_runtime_ws_workers(), fmtNum(diag.runtime.wsWorkerGoroutines))}
- {@render row(m.diagnostics_runtime_cgo_calls(), fmtNum(diag.runtime.numCgoCall))}
- {@render row(m.common_uptime(), fmtUptime(diag.runtime.uptimeSeconds))}
- </div>
- </section>
-
- <!-- Memory -->
- <section>
- {@render sectionHeader(m.diagnostics_section_memory(), MemoryStickIcon)}
- {#if heapBar}
- <div class="mb-3 flex h-2.5 overflow-hidden rounded-full bg-muted/40">
- <div class="bg-violet-500" style="width: {heapBar.inuse}%" title={m.diagnostics_mem_in_use()}></div>
- <div class="bg-violet-500/40" style="width: {heapBar.idle}%" title={m.idle()}></div>
- <div class="bg-zinc-500/40" style="width: {heapBar.released}%" title={m.diagnostics_mem_released()}></div>
- </div>
- <div class="mb-2 flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-muted-foreground">
- <span
- ><span class="mr-1 inline-block size-2 rounded-full bg-violet-500"></span>{m.diagnostics_mem_in_use()}
- {fmtBytes(diag.memory.heapInuse)}</span
- >
- <span
- ><span class="mr-1 inline-block size-2 rounded-full bg-violet-500/40"></span>{m.idle()}
- {fmtBytes(diag.memory.heapIdle - diag.memory.heapReleased)}</span
- >
- <span
- ><span class="mr-1 inline-block size-2 rounded-full bg-zinc-500/40"></span>{m.diagnostics_mem_released()}
- {fmtBytes(diag.memory.heapReleased)}</span
- >
+ {#if diag}
+ <Tabs.Root value={activeTab} class="w-full">
+ <TabBar items={diagnosticsTabItems} value={activeTab} onValueChange={urlTab.select} />
+
+ <Tabs.Content value="overview" class="mt-6 space-y-8">
+ {#if diag.runtime.leakedGoroutines > 0}
+ <Alert.Root variant="destructive">
+ <AlertTriangleIcon class="size-4" />
+ <Alert.Title>{m.diagnostics_leaks_count({ count: diag.runtime.leakedGoroutines })}</Alert.Title>
+ <Alert.Description class="flex flex-wrap items-center gap-3">
+ {m.diagnostics_leaks_hint()}
+ <ArcaneButton
+ action="base"
+ tone="outline"
+ size="sm"
+ customLabel={m.diagnostics_tab_profiling()}
+ onclick={() => urlTab.select('profiling')}
+ />
+ </Alert.Description>
+ </Alert.Root>
+ {/if}
+
+ <section class="space-y-6">
+ {@render sectionHeading(m.diagnostics_section_system())}
+ <div class="grid gap-10 lg:grid-cols-2">
+ <div class="space-y-3">
+ <h4 class="text-xs font-semibold tracking-wider text-muted-foreground uppercase">
+ {m.diagnostics_section_runtime()}
+ </h4>
+ {@render statusList([
+ { label: m.diagnostics_runtime_go_version(), value: diag.runtime.goVersion },
+ { label: m.platform(), value: `${diag.runtime.os}/${diag.runtime.arch}` },
+ { label: m.diagnostics_runtime_gomaxprocs(), value: diag.runtime.gomaxprocs },
+ { label: m.diagnostics_runtime_num_cpu(), value: diag.runtime.numCpu },
+ { label: m.goroutines(), value: fmtNum(diag.runtime.goroutines) },
+ { label: m.diagnostics_runtime_leaked_goroutines(), value: leakedGoroutineValue(diag) },
+ { label: m.diagnostics_runtime_ws_workers(), value: fmtNum(diag.runtime.wsWorkerGoroutines) },
+ { label: m.diagnostics_runtime_cgo_calls(), value: fmtNum(diag.runtime.numCgoCall) },
+ { label: m.common_uptime(), value: fmtUptime(diag.runtime.uptimeSeconds) }
+ ])}
+ </div>
+ <div class="space-y-3">
+ <h4 class="text-xs font-semibold tracking-wider text-muted-foreground uppercase">
+ {m.diagnostics_section_memory()}
+ </h4>
+ {#if heapBar}
+ <div class="flex h-2 overflow-hidden rounded-full bg-muted/40">
+ <div class="bg-violet-500" style="width: {heapBar.inuse}%" title={m.diagnostics_mem_in_use()}></div>
+ <div class="bg-violet-500/40" style="width: {heapBar.idle}%" title={m.idle()}></div>
+ <div class="bg-zinc-500/40" style="width: {heapBar.released}%" title={m.diagnostics_mem_released()}></div>
+ </div>
+ <div class="flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-muted-foreground">
+ <span>
+ <span class="mr-1 inline-block size-2 rounded-full bg-violet-500"></span>
+ {m.diagnostics_mem_in_use()}
+ {fmtBytes(diag.memory.heapInuse)}
+ </span>
+ <span>
+ <span class="mr-1 inline-block size-2 rounded-full bg-violet-500/40"></span>
+ {m.idle()}
+ {fmtBytes(diag.memory.heapIdle - diag.memory.heapReleased)}
+ </span>
+ <span>
+ <span class="mr-1 inline-block size-2 rounded-full bg-zinc-500/40"></span>
+ {m.diagnostics_mem_released()}
+ {fmtBytes(diag.memory.heapReleased)}
+ </span>
+ </div>
+ {/if}
+ {@render statusList([
+ { label: m.diagnostics_mem_heap_alloc(), value: fmtBytes(diag.memory.heapAlloc) },
+ { label: m.diagnostics_mem_heap_sys(), value: fmtBytes(diag.memory.heapSys) },
+ { label: m.diagnostics_mem_heap_objects(), value: fmtNum(diag.memory.heapObjects) },
+ { label: m.diagnostics_mem_stack_in_use(), value: fmtBytes(diag.memory.stackInuse) },
+ { label: m.diagnostics_mem_total_alloc(), value: fmtBytes(diag.memory.totalAlloc) },
+ { label: m.diagnostics_mem_sys_total(), value: fmtBytes(diag.memory.sys) },
+ { label: m.diagnostics_mem_next_gc(), value: fmtBytes(diag.memory.nextGc) },
+ {
+ label: m.diagnostics_mem_gc_cpu_fraction(),
+ value: `${(diag.memory.gcCpuFraction * 100).toFixed(3)}%`
+ }
+ ])}
+ </div>
+ </div>
+ </section>
+
+ <section class="space-y-4 border-t border-border/50 pt-8">
+ {@render sectionHeading(m.diagnostics_section_gc())}
+ <div class="grid items-start gap-10 lg:grid-cols-2">
+ {@render statusList([
+ { label: m.diagnostics_gc_total_cycles(), value: fmtNum(diag.gc.numGc) },
+ { label: m.diagnostics_gc_forced_cycles(), value: fmtNum(diag.memory.numForcedGc) },
+ { label: m.diagnostics_gc_total_pause(), value: fmtMs(diag.gc.pauseTotalNs) },
+ { label: m.diagnostics_gc_last(), value: diag.gc.lastGc ? formatTime(diag.gc.lastGc) : '—' }
+ ])}
+ {#if diag.gc.recentPausesNs?.length}
+ <div>
+ <div class="mb-1 text-[11px] text-muted-foreground">{m.diagnostics_gc_recent_pauses()}</div>
+ <div class="flex h-12 items-end gap-0.5">
+ {#each diag.gc.recentPausesNs as p, i (i)}
+ <div
+ class="flex-1 rounded-sm bg-amber-500/70"
+ style="height: {maxPause ? Math.max(4, (p / maxPause) * 100) : 4}%"
+ title={fmtMs(p)}
+ ></div>
+ {/each}
+ </div>
+ </div>
+ {/if}
+ </div>
+ </section>
+ </Tabs.Content>
+
+ <Tabs.Content value="connections" class="mt-6 space-y-4">
+ {@render sectionHeading(m.diagnostics_section_connections({ count: diag.websocket.connections?.length ?? 0 }))}
+ <div class="grid grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-3 lg:grid-cols-6">
+ {#each wsCounts as c (c.label)}
+ <div>
+ <div class="text-xs text-muted-foreground">{c.label}</div>
+ <div class="text-lg font-semibold tabular-nums">{fmtNum(c.value)}</div>
+ </div>
+ {/each}
</div>
- {/if}
- <div class="divide-y divide-border/40">
- {@render row(m.diagnostics_mem_heap_alloc(), fmtBytes(diag.memory.heapAlloc))}
- {@render row(m.diagnostics_mem_heap_sys(), fmtBytes(diag.memory.heapSys))}
- {@render row(m.diagnostics_mem_heap_objects(), fmtNum(diag.memory.heapObjects))}
- {@render row(m.diagnostics_mem_stack_in_use(), fmtBytes(diag.memory.stackInuse))}
- {@render row(m.diagnostics_mem_total_alloc(), fmtBytes(diag.memory.totalAlloc))}
- {@render row(m.diagnostics_mem_sys_total(), fmtBytes(diag.memory.sys))}
- {@render row(m.diagnostics_mem_next_gc(), fmtBytes(diag.memory.nextGc))}
- {@render row(m.diagnostics_mem_gc_cpu_fraction(), `${(diag.memory.gcCpuFraction * 100).toFixed(3)}%`)}
- </div>
- </section>
-
- <!-- GC -->
- <section>
- {@render sectionHeader(m.diagnostics_section_gc(), RefreshIcon)}
- <div class="divide-y divide-border/40">
- {@render row(m.diagnostics_gc_total_cycles(), fmtNum(diag.gc.numGc))}
- {@render row(m.diagnostics_gc_forced_cycles(), fmtNum(diag.memory.numForcedGc))}
- {@render row(m.diagnostics_gc_total_pause(), fmtMs(diag.gc.pauseTotalNs))}
- {@render row(m.diagnostics_gc_last(), diag.gc.lastGc ? formatTime(diag.gc.lastGc) : '—')}
- </div>
- {#if diag.gc.recentPausesNs?.length}
- <div class="mt-3">
- <div class="mb-1 text-[11px] text-muted-foreground">{m.diagnostics_gc_recent_pauses()}</div>
- <div class="flex h-12 items-end gap-0.5">
- {#each diag.gc.recentPausesNs as p, i (i)}
- <div
- class="flex-1 rounded-sm bg-amber-500/70"
- style="height: {maxPause ? Math.max(4, (p / maxPause) * 100) : 4}%"
- title={fmtMs(p)}
- ></div>
+ {#if diag.websocket.connections?.length}
+ <div class="overflow-x-auto">
+ <Table.Root>
+ <Table.Header>
+ <Table.Row>
+ <Table.Head>{m.diagnostics_conn_kind()}</Table.Head>
+ <Table.Head>{m.resource()}</Table.Head>
+ <Table.Head>{m.diagnostics_conn_client_ip()}</Table.Head>
+ <Table.Head>{m.common_user()}</Table.Head>
+ <Table.Head>{m.diagnostics_conn_since()}</Table.Head>
+ </Table.Row>
+ </Table.Header>
+ <Table.Body>
+ {#each diag.websocket.connections as c (c.id)}
+ <Table.Row>
+ <Table.Cell>{wsKindLabels[c.kind] ?? c.kind}</Table.Cell>
+ <Table.Cell class="font-mono text-xs text-muted-foreground">{c.resourceId || '—'}</Table.Cell>
+ <Table.Cell class="font-mono text-xs text-muted-foreground">{c.clientIp || '—'}</Table.Cell>
+ <Table.Cell class="text-xs text-muted-foreground">{c.userId || '—'}</Table.Cell>
+ <Table.Cell class="text-xs text-muted-foreground tabular-nums">
+ {c.startedAt ? formatTime(c.startedAt) : '—'}
+ </Table.Cell>
+ </Table.Row>
+ {/each}
+ </Table.Body>
+ </Table.Root>
+ </div>
+ {:else}
+ <p class="py-8 text-sm text-muted-foreground">{m.diagnostics_connections_empty()}</p>
+ {/if}
+ </Tabs.Content>
+
+ <Tabs.Content value="logs" class="mt-6">
+ <DiagnosticLogPanel height="min(70vh, 640px)" />
+ </Tabs.Content>
+
+ <Tabs.Content value="profiling" class="mt-6 space-y-8">
+ <section class="space-y-4">
+ {@render sectionHeading(m.diagnostics_section_leaks())}
+ <DiagnosticLeakPanel
+ leakedGoroutines={diag.runtime.leakedGoroutines}
+ leakScannedAt={diag.runtime.leakScannedAt}
+ onscanned={onLeakScanned}
+ />
+ </section>
+
+ <section class="space-y-4 border-t border-border/50 pt-8">
+ {@render sectionHeading(m.diagnostics_section_dumps())}
+ <div class="space-y-2">
+ {#each dumps as d (d.id)}
+ <Collapsible.Root open={dumpOpen[d.id]} onOpenChange={(o: boolean) => onDumpToggle(d.id, o)}>
+ <Collapsible.Trigger
+ class="flex w-full items-center justify-between rounded-lg border border-border/60 px-3 py-2 text-sm font-medium hover:bg-muted/30"
+ >
+ {d.label}
+ <ArrowDownIcon class={cn('size-4 transition-transform', dumpOpen[d.id] && '-rotate-180')} />
+ </Collapsible.Trigger>
+ <Collapsible.Content>
+ <pre
+ class="mt-1 max-h-96 overflow-auto rounded-lg border border-border/60 bg-background p-3 font-mono text-[11px] leading-relaxed">{dumpLoading[
+ d.id
+ ]
+ ? m.common_loading()
+ : dumpText[d.id] || m.diagnostics_dump_empty()}</pre>
+ </Collapsible.Content>
+ </Collapsible.Root>
{/each}
</div>
- </div>
- {/if}
- </section>
-
- <!-- WebSocket -->
- <section>
- {@render sectionHeader(m.diagnostics_section_websocket(), ConnectionIcon)}
- <div class="divide-y divide-border/40">
- {@render row(m.diagnostics_ws_project_logs(), fmtNum(diag.websocket.snapshot.projectLogsActive))}
- {@render row(m.diagnostics_ws_container_logs(), fmtNum(diag.websocket.snapshot.containerLogsActive))}
- {@render row(m.diagnostics_ws_container_stats(), fmtNum(diag.websocket.snapshot.containerStats))}
- {@render row(m.diagnostics_ws_terminals(), fmtNum(diag.websocket.snapshot.containerExec))}
- {@render row(m.diagnostics_ws_system_stats(), fmtNum(diag.websocket.snapshot.systemStats))}
- {@render row(m.diagnostics_ws_service_logs(), fmtNum(diag.websocket.snapshot.serviceLogsActive))}
- </div>
- </section>
- </div>
-
- <!-- Active connections table -->
- {#if diag.websocket.connections?.length}
- <section class="mt-8">
- {@render sectionHeader(m.diagnostics_section_connections({ count: diag.websocket.connections.length }), ConnectionIcon)}
- <div class="overflow-x-auto rounded-xl border border-border/60">
- <table class="w-full text-left text-sm">
- <thead class="bg-muted/30 text-xs text-muted-foreground">
- <tr>
- <th class="px-3 py-2 font-medium">{m.diagnostics_conn_kind()}</th>
- <th class="px-3 py-2 font-medium">{m.resource()}</th>
- <th class="px-3 py-2 font-medium">{m.diagnostics_conn_client_ip()}</th>
- <th class="px-3 py-2 font-medium">{m.common_user()}</th>
- <th class="px-3 py-2 font-medium">{m.diagnostics_conn_since()}</th>
- </tr>
- </thead>
- <tbody class="divide-y divide-border/40">
- {#each diag.websocket.connections as c (c.id)}
- <tr class="hover:bg-muted/20">
- <td class="px-3 py-2">{wsKindLabels[c.kind] ?? c.kind}</td>
- <td class="px-3 py-2 font-mono text-xs text-muted-foreground">{c.resourceId || '—'}</td>
- <td class="px-3 py-2 font-mono text-xs text-muted-foreground">{c.clientIp || '—'}</td>
- <td class="px-3 py-2 text-xs text-muted-foreground">{c.userId || '—'}</td>
- <td class="px-3 py-2 text-xs text-muted-foreground tabular-nums">
- {c.startedAt ? formatTime(c.startedAt) : '—'}
- </td>
- </tr>
+ </section>
+
+ <section class="space-y-4 border-t border-border/50 pt-8">
+ {@render sectionHeading(m.diagnostics_section_profiles(), m.diagnostics_profiles_hint())}
+ <ul class="divide-y divide-border/40">
+ {#each profiles as p (p.id)}
+ <li class="flex items-center justify-between gap-4 py-2.5">
+ <span class="text-sm font-medium">{p.label}</span>
+ <ArcaneButton
+ action="base"
+ tone="outline"
+ size="sm"
+ icon={DownloadIcon}
+ customLabel={m.diagnostics_download()}
+ loading={downloading === p.id}
+ disabled={downloading !== null}
+ onclick={() => download(p.id)}
+ />
+ </li>
{/each}
- </tbody>
- </table>
- </div>
- </section>
+ </ul>
+ </section>
+ </Tabs.Content>
+ </Tabs.Root>
+ {:else if !error}
+ <div class="py-16 text-center text-sm text-muted-foreground">{m.diagnostics_loading()}</div>
{/if}
-
- <!-- Live logs -->
- <section class="mt-8">
- {@render sectionHeader(m.diagnostics_section_logs(), ActivityIcon)}
- <DiagnosticLogPanel />
- </section>
-
- <!-- Dumps -->
- <section class="mt-8">
- {@render sectionHeader(m.diagnostics_section_dumps(), CpuIcon)}
- <div class="space-y-2">
- {#each [{ id: 'goroutine', label: m.diagnostics_dump_goroutine() }, { id: 'heap', label: m.diagnostics_dump_heap() }] as d (d.id)}
- {@const name = d.id as 'goroutine' | 'heap'}
- <Collapsible.Root open={dumpOpen[name]} onOpenChange={(o: boolean) => onDumpToggle(name, o)}>
- <Collapsible.Trigger
- class="flex w-full items-center justify-between rounded-lg border border-border/60 bg-card/40 px-3 py-2 text-sm font-medium hover:bg-muted/30"
- >
- {d.label}
- <ArrowDownIcon class={cn('size-4 transition-transform', dumpOpen[name] && '-rotate-180')} />
- </Collapsible.Trigger>
- <Collapsible.Content>
- <pre
- class="mt-1 max-h-96 overflow-auto rounded-lg border border-border/60 bg-background p-3 font-mono text-[11px] leading-relaxed">{dumpLoading[
- name
- ]
- ? m.common_loading()
- : dumpText[name] || m.diagnostics_dump_empty()}</pre>
- </Collapsible.Content>
- </Collapsible.Root>
- {/each}
- </div>
- </section>
-
- <!-- Profiles -->
- <section class="mt-8 pb-8">
- {@render sectionHeader(m.diagnostics_section_profiles(), DownloadIcon)}
- <p class="mb-3 text-sm text-muted-foreground">{m.diagnostics_profiles_hint()}</p>
- <div class="flex flex-wrap gap-2">
- {#each profiles as p (p.id)}
- <ArcaneButton
- action="base"
- tone="outline"
- size="sm"
- icon={DownloadIcon}
- customLabel={p.label}
- loading={downloading === p.id}
- disabled={downloading !== null}
- onclick={() => download(p.id)}
- />
- {/each}
- </div>
- </section>
- {:else if !error}
- <div class="py-16 text-center text-sm text-muted-foreground">{m.diagnostics_loading()}</div>
- {/if}
-</div>
+ {/snippet}
+</SettingsPageLayout>
diff --git a/frontend/src/routes/(app)/settings/diagnostics/diagnostic-leak-panel.svelte b/frontend/src/routes/(app)/settings/diagnostics/diagnostic-leak-panel.svelte
new file mode 100644
index 000000000..87e7c4c4a
--- /dev/null
+++ b/frontend/src/routes/(app)/settings/diagnostics/diagnostic-leak-panel.svelte
@@ -0,0 +1,119 @@
+<script lang="ts">
+ import { m } from '#lib/paraglide/messages';
+ import { ArcaneButton } from '#lib/components/arcane-button/index.js';
+ import { AlertTriangleIcon, DownloadIcon } from '#lib/icons';
+ import { diagnosticsService } from '#lib/services/diagnostics-service';
+ import type { GoroutineLeakReport } from '#lib/types/diagnostics';
+ import { formatTime } from '#lib/utils/formatting';
+ import { cn } from '#lib/utils';
+
+ interface Props {
+ leakedGoroutines: number;
+ leakScannedAt?: string;
+ onscanned?: (report: GoroutineLeakReport) => void;
+ }
+
+ let { leakedGoroutines, leakScannedAt, onscanned }: Props = $props();
+
+ let scanning = $state(false);
+ let downloading = $state(false);
+ let error = $state<string | null>(null);
+ let report = $state.raw<GoroutineLeakReport | null>(null);
+
+ const scannedAt = $derived(report?.scannedAt ?? leakScannedAt);
+ const count = $derived(report?.count ?? leakedGoroutines);
+ const hasScan = $derived(Boolean(scannedAt) || count > 0);
+ const profileText = $derived(report?.profile ?? '');
+
+ async function scan() {
+ scanning = true;
+ error = null;
+ try {
+ const next = await diagnosticsService.scanGoroutineLeaks();
+ report = next;
+ onscanned?.(next);
+ } catch (e) {
+ error = e instanceof Error ? e.message : m.diagnostics_error_scan_leaks();
+ } finally {
+ scanning = false;
+ }
+ }
+
+ async function download() {
+ downloading = true;
+ error = null;
+ try {
+ await diagnosticsService.downloadProfile('goroutineleak');
+ } catch (e) {
+ error = e instanceof Error ? e.message : m.diagnostics_error_download();
+ } finally {
+ downloading = false;
+ }
+ }
+</script>
+
+<div class="space-y-4">
+ <p class="text-sm text-muted-foreground">
+ {m.diagnostics_leaks_hint()}
+ {m.diagnostics_leaks_limitations()}
+ </p>
+
+ <div class="flex flex-wrap items-center gap-3">
+ <div
+ class={cn(
+ 'rounded-lg border px-3 py-2 text-sm',
+ hasScan && count > 0
+ ? 'border-rose-500/40 bg-rose-500/10 text-rose-600 dark:text-rose-400'
+ : 'border-border/60 bg-card/40'
+ )}
+ >
+ {#if !hasScan}
+ {m.diagnostics_leaks_not_scanned()}
+ {:else if count > 0}
+ <span class="inline-flex items-center gap-1.5 font-medium">
+ <AlertTriangleIcon class="size-4" />
+ {m.diagnostics_leaks_count({ count })}
+ </span>
+ {:else}
+ {m.diagnostics_leaks_none()}
+ {/if}
+ {#if scannedAt}
+ <span class="ml-2 text-xs text-muted-foreground">
+ {m.diagnostics_leaks_last_scan({ when: formatTime(scannedAt) })}
+ </span>
+ {/if}
+ </div>
+
+ <ArcaneButton
+ action="scan"
+ size="sm"
+ customLabel={m.diagnostics_leaks_scan()}
+ loading={scanning}
+ disabled={scanning || downloading}
+ onclick={scan}
+ />
+ <ArcaneButton
+ action="base"
+ tone="outline"
+ size="sm"
+ icon={DownloadIcon}
+ customLabel={m.diagnostics_profile_goroutineleak()}
+ loading={downloading}
+ disabled={scanning || downloading}
+ onclick={download}
+ />
+ </div>
+
+ {#if error}
+ <div class="rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive">
+ {error}
+ </div>
+ {/if}
+
+ {#if profileText}
+ <pre
+ class="max-h-96 overflow-auto rounded-lg border border-border/60 bg-background p-3 font-mono text-[11px] leading-relaxed">{profileText}</pre>
+ {:else if hasScan && count === 0}
+ <p class="text-sm text-muted-foreground">{m.diagnostics_leaks_empty()}</p>
+ {/if}
+</div>
diff --git a/go.work b/go.work
index 618e7bdf2..2a2a4c863 100644
--- a/go.work
+++ b/go.work
@@ -1,4 +1,4 @@
-go 1.26.6
+go 1.27
use (
./backend
diff --git a/go.work.sum b/go.work.sum
index 8e08dba21..919513f34 100644
--- a/go.work.sum
+++ b/go.work.sum
@@ -360,6 +360,8 @@ github.com/ClickHouse/clickhouse-go/v2 v2.47.0 h1:ZDAzrnKSOPTIsm4tdUNfrii2yc8dk4
github.com/ClickHouse/clickhouse-go/v2 v2.47.0/go.mod h1:sPj7C7UYQ2MWHcfX+4eGN6nwnCqwUKfgO6PcwKpd6K8=
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
+github.com/GoogleCloudPlatform/confidential-space/server v0.0.0-20260307011055-895ec9019dd7 h1:Iz7wjnn93xcmPlUS/9ue7CeyH7yvcxHAXKu+2lE2/is=
+github.com/GoogleCloudPlatform/confidential-space/server v0.0.0-20260307011055-895ec9019dd7/go.mod h1:sNFt/HcARjGxR3/2s7hwlqvHlUzXdaCiS62u7A4rnHg=
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.3 h1:2afWGsMzkIcN8Qm4mgPJKZWyroE5QBszMiDMYEBrnfw=
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.3/go.mod h1:dppbR7CwXD4pgtV9t3wD1812RaLDcBjtblcDF5f1vI0=
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.6.0 h1:BzsL0qE7LvtTEtXG7Dt5NS1EP0CQwI21HZfj9aGghhw=
@@ -764,6 +766,8 @@ github.com/containerd/cgroups/v3 v3.0.5/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM
github.com/containerd/containerd v1.7.23 h1:H2CClyUkmpKAGlhQp95g2WXHfLYc7whAuvZGBNYOOwQ=
github.com/containerd/containerd v1.7.27 h1:yFyEyojddO3MIGVER2xJLWoCIn+Up4GaHFquP7hsFII=
github.com/containerd/containerd v1.7.27/go.mod h1:xZmPnl75Vc+BLGt4MIfu6bp+fy03gdHAn9bz+FreFR0=
+github.com/containerd/containerd v1.7.30 h1:/2vezDpLDVGGmkUXmlNPLCCNKHJ5BbC5tJB5JNzQhqE=
+github.com/containerd/containerd v1.7.30/go.mod h1:fek494vwJClULlTpExsmOyKCMUAbuVjlFsJQc4/j44M=
github.com/containerd/containerd/api v1.9.0/go.mod h1:GhghKFmTR3hNtyznBoQ0EMWr9ju5AqHjcZPsSpTKutI=
github.com/containerd/containerd/api v1.10.0/go.mod h1:NBm1OAk8ZL+LG8R0ceObGxT5hbUYj7CzTmR3xh0DlMM=
github.com/containerd/containerd/v2 v2.1.2/go.mod h1:8C5QV9djwsYDNhxfTCFjWtTBZrqjditQ4/ghHSYjnHM=
@@ -858,6 +862,8 @@ github.com/danielgtaylor/shorthand/v2 v2.4.0 h1:IeVgSkTMPXQ/CC3f+pfCiipoJXtXbBO9
github.com/danielgtaylor/shorthand/v2 v2.4.0/go.mod h1:+JG16ZY99pciTkGphx18ruwefahdwHCv/jmllgUGKSM=
github.com/data-accelerator/zdfs v0.1.5 h1:F7td8AwicTZ3t618SsEYr8CMyMcxBE1KjkoyYO4T2GI=
github.com/data-accelerator/zdfs v0.1.5/go.mod h1:/MyNTsQHHKVLznaRBz+PivhIDwglu+wuXKoZxUNmLKI=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8=
github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
@@ -1153,6 +1159,8 @@ github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pS
github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=
github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ=
+github.com/google/go-attestation v0.5.1 h1:jqtOrLk5MNdliTKjPbIPrAaRKJaKW+0LIU2n/brJYms=
+github.com/google/go-attestation v0.5.1/go.mod h1:KqGatdUhg5kPFkokyzSBDxwSCFyRgIgtRkMp6c3lOBQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
@@ -1164,6 +1172,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/go-configfs-tsm v0.3.3-0.20240919001351-b4b5b84fdcbc h1:SG12DWUUM5igxm+//YX5Yq4vhdoRnOG9HkCodkOn+YU=
+github.com/google/go-configfs-tsm v0.3.3-0.20240919001351-b4b5b84fdcbc/go.mod h1:EL1GTDFMb5PZQWDviGfZV9n87WeGTR/JUg13RfwkgRo=
github.com/google/go-containerregistry v0.20.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI=
github.com/google/go-containerregistry v0.20.6/go.mod h1:T0x8MuoAoKX/873bkeSfLD2FAkwCDf9/HZgsFJ02E2Y=
github.com/google/go-containerregistry v0.20.7/go.mod h1:Lx5LCZQjLH1QBaMPeGwsME9biPeo1lPx6lbGj/UmzgM=
@@ -1172,14 +1182,24 @@ github.com/google/go-dap v0.12.0 h1:rVcjv3SyMIrpaOoTAdFDyHs99CwVOItIJGKLQFQhNeM=
github.com/google/go-dap v0.12.0/go.mod h1:tNjCASCm5cqePi/RVXXWEVqtnNLV1KTWtYOqu6rZNzc=
github.com/google/go-dap v0.12.1-0.20250904181021-d7a2259b058b h1:m+yLjBIoXaMKk6pwd1IJYYgM76+mwcy7J9+cuY7LqmQ=
github.com/google/go-dap v0.12.1-0.20250904181021-d7a2259b058b/go.mod h1:tNjCASCm5cqePi/RVXXWEVqtnNLV1KTWtYOqu6rZNzc=
+github.com/google/go-eventlog v0.0.3-0.20260305053119-5cd85087f9f9 h1:YDFEn5cuFcI2xNV3D8N4xpsV0y+D29s94cfyW1tGd4E=
+github.com/google/go-eventlog v0.0.3-0.20260305053119-5cd85087f9f9/go.mod h1:7huE5P8w2NTObSwSJjboHmB7ioBNblkijdzoVa2skfQ=
github.com/google/go-intervals v0.0.2 h1:FGrVEiUnTRKR8yE04qzXYaJMtnIYqobR5QbblK3ixcM=
github.com/google/go-intervals v0.0.2/go.mod h1:MkaR3LNRfeKLPmqgJYs4E66z5InYjmCjbbr4TQlcT6Y=
github.com/google/go-pkcs11 v0.3.0 h1:PVRnTgtArZ3QQqTGtbtjtnIkzl2iY2kt24yqbrf7td8=
github.com/google/go-pkcs11 v0.3.0/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY=
+github.com/google/go-sev-guest v0.14.0 h1:dCb4F3YrHTtrDX3cYIPTifEDz7XagZmXQioxRBW4wOo=
+github.com/google/go-sev-guest v0.14.0/go.mod h1:SK9vW+uyfuzYdVN0m8BShL3OQCtXZe/JPF7ZkpD3760=
+github.com/google/go-tdx-guest v0.3.2-0.20250814004405-ffb0869e6f4d h1:Ff8goEP/ue2/rZT5qyoRicuySCYDbAXEZS8Cf1fgsUo=
+github.com/google/go-tdx-guest v0.3.2-0.20250814004405-ffb0869e6f4d/go.mod h1:uHy3VaNXNXhl0fiPxKqTxieeouqQmW6A0EfLcaeCYBk=
+github.com/google/go-tspi v0.3.0 h1:ADtq8RKfP+jrTyIWIZDIYcKOMecRqNJFOew2IT0Inus=
+github.com/google/go-tspi v0.3.0/go.mod h1:xfMGI3G0PhxCdNVcYr1C4C+EizojDg/TXuX5by8CiHI=
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/logger v1.1.1 h1:+6Z2geNxc9G+4D4oDO9njjjn2d0wN5d7uOo0vOIW1NQ=
+github.com/google/logger v1.1.1/go.mod h1:BkeJZ+1FhQ+/d087r4dzojEg1u2ZX+ZqG1jTUrLM+zQ=
github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc=
github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
@@ -1473,8 +1493,6 @@ github.com/microsoft/go-mssqldb v1.10.0 h1:pHEt+Qz6YFPWqREq10mqSE524QQo+/QremwTC
github.com/microsoft/go-mssqldb v1.10.0/go.mod h1:mnG7lGa9iYJbzJqGCXyuQCegStKMr3kogDLD6+bmggg=
github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM=
github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
-github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ=
-github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ=
github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU=
github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
@@ -1527,8 +1545,6 @@ github.com/moby/sys/mount v0.3.4 h1:yn5jq4STPztkkzSKpZkLcmjue+bZJ0u2AuQY1iNI1Ww=
github.com/moby/sys/mount v0.3.4/go.mod h1:KcQJMbQdJHPlq5lcYT+/CjatWM4PuxKe+XLSVS4J6Os=
github.com/moby/sys/mount v0.3.5-0.20260529155943-fc52b7222d0b h1:RB/940R3dFkU1fLLk5rBIvcv/C3HfbjqVkStfi/wlb4=
github.com/moby/sys/mount v0.3.5-0.20260529155943-fc52b7222d0b/go.mod h1:WUQDO+/uCiCIkIztx8SrwIDVn2dtMFRBebRhpDFT71M=
-github.com/moby/sys/mount v0.3.5 h1:eS3fsZTjHaBihwjp4/+5Z3jxqLXYsbwxqpVSfFv3M00=
-github.com/moby/sys/mount v0.3.5/go.mod h1:WUQDO+/uCiCIkIztx8SrwIDVn2dtMFRBebRhpDFT71M=
github.com/moby/sys/reexec v0.1.0 h1:RrBi8e0EBTLEgfruBOFcxtElzRGTEUkeIFaVXgU7wok=
github.com/moby/sys/reexec v0.1.0/go.mod h1:EqjBg8F3X7iZe5pU6nRZnYCMUTXoxsjiIfHup5wYIN8=
github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko=
@@ -2017,8 +2033,6 @@ go.etcd.io/raft/v3 v3.6.0 h1:5NtvbDVYpnfZWcIHgGRk9DyzkBIXOi8j+DDp1IcnUWQ=
go.etcd.io/raft/v3 v3.6.0/go.mod h1:nLvLevg6+xrVtHUmVaTcTz603gQPHfh7kUAwV6YpfGo=
go.getarcane.app/acfs v0.2.0 h1:m7yXsLIB4MfsAE/AFP54RgtMXUr+AFEVCNiF5784XYI=
go.getarcane.app/acfs v0.2.0/go.mod h1:sU3t21KctTsQM3OW10+RNB0Z6lR+YfaSr5Nxubq3cpI=
-go.getarcane.app/acfs v0.4.1 h1:R1o9lBrAWLtqY74l4nmAyMMMitPt4ctJpCOop+cZqFs=
-go.getarcane.app/acfs v0.4.1/go.mod h1:sU3t21KctTsQM3OW10+RNB0Z6lR+YfaSr5Nxubq3cpI=
go.getarcane.app/updater v0.3.6 h1:+BqoycaRsHj+cLVSzcYQuqbHxUKbtmaozMNblz5bVSw=
go.getarcane.app/updater v0.3.6/go.mod h1:2ENitZR/lA5MuBn60OZYR5wvU3ZCE+pAgfrebfOlRDA=
go.getarcane.app/updater v0.3.7 h1:WqHsxudvt8gvCR7iSHdxdzwH0+hM0FAh64bSypBX9Mo=
@@ -2209,6 +2223,8 @@ golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU=
golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ=
golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0=
+golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40=
+golang.org/x/mod v0.39.0/go.mod h1:bvIbwjQ0HUFFf5AKukeeYQG4ZBUG9yxQbR9aEweIwYY=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -2367,6 +2383,8 @@ golang.org/x/telemetry v0.0.0-20260625142307-59b4966ccb57 h1:nwGZBCt+FnXUrGsj5vj
golang.org/x/telemetry v0.0.0-20260625142307-59b4966ccb57/go.mod h1:3AWMyWHS+caVoiEXpiq6+tzKA40J4vQT3MYr80ZtQpc=
golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959 h1:RJhm5l6Fo4rmEIcndxDllNhhf/fAx8qIm4t6A7vpm2A=
golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959/go.mod h1:LV7u5Oco+Z/g6XI7PqN+EUUUGGkEcmB1uj2ceI0fOVg=
+golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5 h1:ZUSxONxc981v7AW7QUg+I9WwZzSTTJ019ENBYr5pV/Q=
+golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5/go.mod h1:LVehoXe41cL5SCVQilsV7Gg6BNG+Js6P9PhSbYTIUkQ=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -2441,6 +2459,7 @@ golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI
golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0=
golang.org/x/tools v0.46.0/go.mod h1:FrD85F8l+NWL+9XWBSyVSHO6Ne4jutsfIFba7AWQ5Ys=
golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA=
+golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk=
golang.org/x/tools/go/expect v0.1.0-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=
golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM=
golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY=
diff --git a/tests/spec/diagnostics-logs.spec.ts b/tests/spec/diagnostics-logs.spec.ts
index 0e041abd3..a907ecf61 100644
--- a/tests/spec/diagnostics-logs.spec.ts
+++ b/tests/spec/diagnostics-logs.spec.ts
@@ -122,10 +122,10 @@ test.describe('Diagnostics logs', () => {
}
});
- await page.goto('/settings/diagnostics');
+ await page.goto('/settings/diagnostics?tab=logs');
await page.waitForLoadState('domcontentloaded');
- await expect(page).toHaveURL(/\/settings\/diagnostics$/);
+ await expect(page).toHaveURL(/\/settings\/diagnostics/);
await expect(page.getByText('duplicate diagnostic entry', { exact: true })).toHaveCount(2);
expect(recentLogsRequests).toBe(0);
diff --git a/types/dockerinfo/docker_info_test.go b/types/dockerinfo/docker_info_test.go
index 5dc79877d..a8e67afa7 100644
--- a/types/dockerinfo/docker_info_test.go
+++ b/types/dockerinfo/docker_info_test.go
@@ -4,20 +4,17 @@ import (
"encoding/json/v2"
"testing"
- "github.com/moby/moby/api/types/system"
"github.com/stretchr/testify/require"
)
func TestInfoMarshalsEmbeddedDockerFieldsAtTopLevel(t *testing.T) {
data, err := json.Marshal(Info{
- Info: system.Info{
- Name: "arcane-host",
- NCPU: 8,
- MemTotal: 16 * 1024 * 1024 * 1024,
- ContainersRunning: 3,
- },
- Success: true,
- APIVersion: "1.55",
+ Name: "arcane-host",
+ NCPU: 8,
+ MemTotal: 16 * 1024 * 1024 * 1024,
+ ContainersRunning: 3,
+ Success: true,
+ APIVersion: "1.55",
})
require.NoError(t, err,
diff --git a/types/go.mod b/types/go.mod
index f4348b0c1..f46e29117 100644
--- a/types/go.mod
+++ b/types/go.mod
@@ -1,6 +1,6 @@
module github.com/getarcaneapp/arcane/types/v2
-go 1.26.6
+go 1.27
require (
emperror.dev/errors v0.8.1
@@ -8,7 +8,7 @@ require (
github.com/docker/go-units v0.5.0
github.com/moby/moby/api v1.55.0
github.com/moby/moby/client v0.5.1
- github.com/stretchr/testify v1.11.1
+ github.com/stretchr/testify v1.12.1
)
require (
@@ -16,9 +16,8 @@ require (
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
- github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
- github.com/docker/go-connections v0.7.0 // indirect
+ github.com/docker/go-connections v0.8.1 // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
@@ -28,17 +27,16 @@ require (
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
- github.com/sirupsen/logrus v1.9.4 // indirect
+ github.com/sirupsen/logrus v1.10.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 // indirect
- go.opentelemetry.io/otel v1.44.0 // indirect
- go.opentelemetry.io/otel/metric v1.44.0 // indirect
- go.opentelemetry.io/otel/trace v1.44.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 // indirect
+ go.opentelemetry.io/otel v1.45.0 // indirect
+ go.opentelemetry.io/otel/metric v1.45.0 // indirect
+ go.opentelemetry.io/otel/trace v1.45.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
+ go.yaml.in/yaml/v3 v3.0.5 // indirect
go.yaml.in/yaml/v4 v4.0.0-rc.6 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/types/go.sum b/types/go.sum
index fc0442391..33fc918bf 100644
--- a/types/go.sum
+++ b/types/go.sum
@@ -12,12 +12,10 @@ github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151X
github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
-github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
-github.com/docker/go-connections v0.7.0 h1:6SsRfJddP22WMrCkj19x9WKjEDTB+ahsdiGYf0mN39c=
-github.com/docker/go-connections v0.7.0/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
+github.com/docker/go-connections v0.8.1 h1:JibmG5hULs5qXSr/cp/w3Pw5fZuStt4MOHMUExb29/M=
+github.com/docker/go-connections v0.8.1/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc=
@@ -33,10 +31,6 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
-github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
-github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mattn/go-shellwords v1.0.14 h1:yUKzIgsCnosndOASY6/enly1EAuaXeFSQ7cdyA3OuYg=
github.com/mattn/go-shellwords v1.0.14/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
@@ -52,47 +46,40 @@ github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgr
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
-github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
-github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
-github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=
-github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=
+github.com/sirupsen/logrus v1.10.0 h1:T8MxJJXVZkfcC5zSRMRAg2F8+lxjmUCGGWPzFxO+Msc=
+github.com/sirupsen/logrus v1.10.0/go.mod h1:FXZFonkDAnFozmO+5hGAFvB0Yg9/j2SIhA/QuIkP180=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
-github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
+github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
+github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI=
-go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU=
-go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc=
-go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc=
-go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo=
-go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58=
-go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0=
-go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI=
-go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA=
-go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk=
-go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 h1:LMuyCAyfalSjDyjdC65nK6N0zoTT63+E/u95X0JovZI=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0/go.mod h1:085m8qbm4hgc8rZWGDEa4vmyyo2c3nPxUslYUKUIU04=
+go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU=
+go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ=
+go.opentelemetry.io/otel/metric v1.45.0 h1:7Eg1uH7CJ5cXv9is6tnBe1FI6rj1nwUdbFypRm3br/M=
+go.opentelemetry.io/otel/metric v1.45.0/go.mod h1:HAPbm1nd3p1PmFH7v2dR+6BjXxw+Lq4a2+pndMAm08s=
+go.opentelemetry.io/otel/sdk v1.45.0 h1:4VVSMgQ83dUgW2aoX5f6JgLvHwIvzcuLnF9lUdCSpCw=
+go.opentelemetry.io/otel/sdk v1.45.0/go.mod h1:Sr40LgXV7DsKMMJMKOhUWOgMWTfAaqvm2kF0g7ilwuA=
+go.opentelemetry.io/otel/sdk/metric v1.45.0 h1:oVFszMfyj1Am6s24Vtc7wBb8BKLcwepJjNEYILuiE3o=
+go.opentelemetry.io/otel/sdk/metric v1.45.0/go.mod h1:vUWUxDZvu1WVRj8JA8S0AdhsPrZoDpA2DdZauIh4mDA=
+go.opentelemetry.io/otel/trace v1.45.0 h1:l/mP6Uv7oNO7/TblbhpbgMidxhq1uO/rPsikOyVhxag=
+go.opentelemetry.io/otel/trace v1.45.0/go.mod h1:qoJJA2xNMnxRrdISU/kLtfUH2wNeQbiv+jhs/CxI8bc=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
+go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
go.yaml.in/yaml/v4 v4.0.0-rc.6 h1:1h7H1ohdUh93/FyE4YaDa1Zh64K6VVbjF4K6WUxMtH4=
go.yaml.in/yaml/v4 v4.0.0-rc.6/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
diff --git a/types/system/diagnostics.go b/types/system/diagnostics.go
index 6e3961d21..e3b49e4df 100644
--- a/types/system/diagnostics.go
+++ b/types/system/diagnostics.go
@@ -30,15 +30,26 @@ type Diagnostics struct {
// RuntimeInfo describes the Go runtime, build, and scheduler state.
type RuntimeInfo struct {
- Goroutines int `json:"goroutines"`
- WSWorkerGoroutines int `json:"wsWorkerGoroutines"`
- GOMAXPROCS int `json:"gomaxprocs"`
- NumCPU int `json:"numCpu"`
- GoVersion string `json:"goVersion"`
- OS string `json:"os"`
- Arch string `json:"arch"`
- NumCgoCall int64 `json:"numCgoCall"`
- UptimeSeconds int64 `json:"uptimeSeconds"`
+ Goroutines int `json:"goroutines"`
+ WSWorkerGoroutines int `json:"wsWorkerGoroutines"`
+ LeakedGoroutines int `json:"leakedGoroutines"`
+ GOMAXPROCS int `json:"gomaxprocs"`
+ NumCPU int `json:"numCpu"`
+ GoVersion string `json:"goVersion"`
+ OS string `json:"os"`
+ Arch string `json:"arch"`
+ NumCgoCall int64 `json:"numCgoCall"`
+ UptimeSeconds int64 `json:"uptimeSeconds"`
+ LeakScannedAt time.Time `json:"leakScannedAt,omitzero"`
+}
+
+// GoroutineLeakReport is the result of an on-demand goroutine leak scan. The
+// scan triggers a leak-detection GC cycle, then writes the goroutineleak
+// pprof profile as debug=1 text (leaked stacks only).
+type GoroutineLeakReport struct {
+ Count int `json:"count"`
+ Profile string `json:"profile"`
+ ScannedAt time.Time `json:"scannedAt"`
}
// MemoryInfo is the subset of runtime.MemStats surfaced in diagnostics. All