Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
531 changes: 437 additions & 94 deletions .golangci.yml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test-coverage:
@echo "$(OK_COLOR)==> Coverage report:$(NO_COLOR)"
@go tool cover -func=coverage.out | tee coverage.txt || true
@COVERAGE=$$(grep total: coverage.txt | awk '{print $$3}' | sed 's/%//'); \
REQUIRED=$${COVERAGE_THRESHOLD:-70.0}; \
REQUIRED=$${COVERAGE_THRESHOLD:-50.0}; \
if (( $$(echo $$COVERAGE '<' $$REQUIRED | bc -l) )); then \
echo "Coverage $$COVERAGE% is below required $$REQUIRED%"; \
exit 1; \
Expand Down Expand Up @@ -79,10 +79,10 @@ tools:

@if ! command -v golangci-lint > /dev/null ; then \
echo ">> [$@]: golangci-lint not found: installing"; \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.2; \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; \
fi

tools-update:
go install github.com/daixiang0/gci@latest; \
go install mvdan.cc/gofumpt@latest; \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.2;
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest;
21 changes: 10 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ require (
github.com/charmbracelet/log v0.4.2
github.com/charmbracelet/x/editor v0.1.0
github.com/cucumber/godog v0.14.1
github.com/docker/docker v28.2.2+incompatible
github.com/docker/docker v28.3.0+incompatible
github.com/docker/go-connections v0.5.0
github.com/dustin/go-humanize v1.0.1
github.com/gabriel-vasile/mimetype v1.4.9
github.com/gin-contrib/cors v1.7.5
github.com/gin-contrib/cors v1.7.6
github.com/gin-gonic/gin v1.10.1
github.com/google/uuid v1.6.0
github.com/joho/godotenv v1.5.1
Expand All @@ -30,7 +30,6 @@ require (
github.com/spf13/cobra v1.9.1
github.com/stretchr/testify v1.10.0
github.com/tmc/langchaingo v0.1.13
go.opentelemetry.io/otel/sdk v1.36.0
)

require (
Expand All @@ -43,9 +42,9 @@ require (
github.com/charmbracelet/bubbles v0.21.0 // indirect
github.com/charmbracelet/bubbletea v1.3.5 // indirect
github.com/charmbracelet/colorprofile v0.3.1 // indirect
github.com/charmbracelet/x/ansi v0.9.2 // indirect
github.com/charmbracelet/x/ansi v0.9.3 // indirect
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
github.com/charmbracelet/x/exp/strings v0.0.0-20250611152503-f53cdd7e01ef // indirect
github.com/charmbracelet/x/exp/strings v0.0.0-20250629123816-066ae234febc // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/cloudwego/base64x v0.1.5 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
Expand Down Expand Up @@ -73,7 +72,7 @@ require (
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
github.com/klauspost/cpuid/v2 v2.2.11 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
Expand Down Expand Up @@ -104,14 +103,14 @@ require (
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
go.opentelemetry.io/otel v1.36.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 // indirect
go.opentelemetry.io/otel v1.37.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect
go.opentelemetry.io/otel/metric v1.36.0 // indirect
go.opentelemetry.io/otel/trace v1.36.0 // indirect
go.opentelemetry.io/otel/metric v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.37.0 // indirect
golang.org/x/arch v0.18.0 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 // indirect
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/sync v0.15.0 // indirect
golang.org/x/sys v0.33.0 // indirect
Expand Down
22 changes: 22 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ github.com/charmbracelet/log v0.4.2 h1:hYt8Qj6a8yLnvR+h7MwsJv/XvmBJXiueUcI3cIxsy
github.com/charmbracelet/log v0.4.2/go.mod h1:qifHGX/tc7eluv2R6pWIpyHDDrrb/AG71Pf2ysQu5nw=
github.com/charmbracelet/x/ansi v0.9.2 h1:92AGsQmNTRMzuzHEYfCdjQeUzTrgE1vfO5/7fEVoXdY=
github.com/charmbracelet/x/ansi v0.9.2/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE=
github.com/charmbracelet/x/ansi v0.9.3 h1:BXt5DHS/MKF+LjuK4huWrC6NCvHtexww7dMayh6GXd0=
github.com/charmbracelet/x/ansi v0.9.3/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE=
github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k=
github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U=
Expand All @@ -54,6 +56,8 @@ github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payR
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
github.com/charmbracelet/x/exp/strings v0.0.0-20250611152503-f53cdd7e01ef h1:ZLTVitJZkZdoRKRbqiNtfhRfTi6o1Ny7+QooRJGbS5Q=
github.com/charmbracelet/x/exp/strings v0.0.0-20250611152503-f53cdd7e01ef/go.mod h1:Rgw3/F+xlcUc5XygUtimVSxAqCOsqyvJjqF5UHRvc5k=
github.com/charmbracelet/x/exp/strings v0.0.0-20250629123816-066ae234febc h1:XFsX2G2Z1k1p9/52+7TYs2iYW//XCJXSD7xWlEeGvBM=
github.com/charmbracelet/x/exp/strings v0.0.0-20250629123816-066ae234febc/go.mod h1:Rgw3/F+xlcUc5XygUtimVSxAqCOsqyvJjqF5UHRvc5k=
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY=
Expand Down Expand Up @@ -90,6 +94,8 @@ github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZ
github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/docker/docker v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw=
github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v28.3.0+incompatible h1:ffS62aKWupCWdvcee7nBU9fhnmknOqDPaJAMtfK0ImQ=
github.com/docker/docker v28.3.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
Expand All @@ -104,6 +110,8 @@ github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBv
github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok=
github.com/gin-contrib/cors v1.7.5 h1:cXC9SmofOrRg0w9PigwGlHG3ztswH6bqq4vJVXnvYMk=
github.com/gin-contrib/cors v1.7.5/go.mod h1:4q3yi7xBEDDWKapjT2o1V7mScKDDr8k+jZ0fSquGoy0=
github.com/gin-contrib/cors v1.7.6 h1:3gQ8GMzs1Ylpf70y8bMw4fVpycXIeX1ZemuSQIsnQQY=
github.com/gin-contrib/cors v1.7.6/go.mod h1:Ulcl+xN4jel9t1Ry8vqph23a60FwH9xVLd+3ykmTjOk=
github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=
github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=
github.com/gin-gonic/gin v1.10.1 h1:T0ujvqyCSqRopADpgPgiTT63DUQVSfojyME59Ei63pQ=
Expand Down Expand Up @@ -163,6 +171,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
github.com/klauspost/cpuid/v2 v2.2.11 h1:0OwqZRYI2rFrjS4kvkDnqJkKHdHaRnCm68/DY4OxRzU=
github.com/klauspost/cpuid/v2 v2.2.11/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
Expand Down Expand Up @@ -267,20 +277,30 @@ go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJyS
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 h1:Hf9xI/XLML9ElpiHVDNwvqI0hIFlzV8dgIr35kV1kRU=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0/go.mod h1:NfchwuyNoMcZ5MLHwPrODwUF1HWCXWrL31s8gSAdIKY=
go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E=
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc=
go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE=
go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs=
go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs=
go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY=
go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
go.opentelemetry.io/otel/sdk/metric v1.36.0 h1:r0ntwwGosWGaa0CrSt8cuNuTcccMXERFwHX4dThiPis=
go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4=
go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w=
go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA=
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
golang.org/x/arch v0.18.0 h1:WN9poc33zL4AzGxqf8VtpKUnGvMi8O9lhNyBMF/85qc=
Expand All @@ -292,6 +312,8 @@ golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 h1:bsqhLWFR6G6xiQcb+JoGqdKdRU6WzPWmK8E0jxTjzo4=
golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand Down
13 changes: 6 additions & 7 deletions pkg/archiver/copy_dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package archiver

import (
"context"
"crypto/md5"
"encoding/hex"
"errors"
"io"
Expand All @@ -16,8 +17,6 @@ import (
"github.com/kdeps/kdeps/pkg/logging"
"github.com/spf13/afero"

"crypto/md5"

"github.com/kdeps/kdeps/pkg/messages"
"github.com/kdeps/kdeps/pkg/schema"
pklProject "github.com/kdeps/schema/gen/project"
Expand Down Expand Up @@ -909,7 +908,7 @@ func TestMoveFolderAndGetFileMD5(t *testing.T) {
t.Fatalf("GetFileMD5 error: %v", err)
}

h := md5.Sum(content)
h := md5.Sum(content)
expectedHash := hex.EncodeToString(h[:])[:8]
if gotHash != expectedHash {
t.Fatalf("md5 mismatch: got %s want %s", gotHash, expectedHash)
Expand Down Expand Up @@ -1442,7 +1441,7 @@ func TestGetFileMD5Edges(t *testing.T) {
// Full length (32 chars) hash check.
got, err := GetFileMD5(fs, filePath, 32)
require.NoError(t, err)
h := md5.Sum(content)
h := md5.Sum(content)
expected := hex.EncodeToString(h[:])
require.Equal(t, expected, got)

Expand Down Expand Up @@ -1494,7 +1493,7 @@ func TestGetFileMD5SuccessAndError(t *testing.T) {
if err != nil {
t.Fatalf("GetFileMD5 error: %v", err)
}
h := md5.Sum(data)
h := md5.Sum(data)
expected := hex.EncodeToString(h[:])[:8]
if got != expected {
t.Fatalf("hash mismatch: got %s want %s", got, expected)
Expand Down Expand Up @@ -1966,7 +1965,7 @@ func TestMoveFolderAndGetFileMD5Small(t *testing.T) {
t.Fatalf("GetFileMD5 error: %v", err)
}

h := md5.New()
h := md5.New()
_, _ = io.WriteString(h, string(data))
wantFull := hex.EncodeToString(h.Sum(nil))
want := wantFull[:6]
Expand Down Expand Up @@ -2039,7 +2038,7 @@ func TestGetFileMD5AndCopyFileSuccess(t *testing.T) {
}

// Calculate expected MD5 manually (full hash then slice len 8)
hash := md5.Sum(content)
hash := md5.Sum(content)
wantMD5 := hex.EncodeToString(hash[:])[:8]

gotMD5, err := GetFileMD5(fs, srcPath, 8)
Expand Down
4 changes: 2 additions & 2 deletions pkg/archiver/file_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package archiver

import (
"context"
"crypto/md5"
"crypto/md5"
"encoding/hex"
"fmt"
"io"
Expand Down Expand Up @@ -73,7 +73,7 @@ func GetFileMD5(fs afero.Fs, filePath string, length int) (string, error) {
}
defer file.Close()

hash := md5.New()
hash := md5.New()
if _, err := io.Copy(hash, file); err != nil {
return "", err
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/data/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func PopulateDataFileRegistry(fs afero.Fs, baseDir string) (*map[string]map[stri
// Walk through the base directory
err = afero.Walk(fs, baseDir, func(path string, info os.FileInfo, walkErr error) error {
if walkErr != nil {

return nil // Ignore individual path errors, but continue walking
}

Expand All @@ -42,7 +41,6 @@ func PopulateDataFileRegistry(fs afero.Fs, baseDir string) (*map[string]map[stri
// Get the relative path from the base directory
relPath, err := filepath.Rel(baseDir, path)
if err != nil {

return nil // Ignore errors in computing relative paths
}

Expand Down Expand Up @@ -71,7 +69,6 @@ func PopulateDataFileRegistry(fs afero.Fs, baseDir string) (*map[string]map[stri
})
// If walking fails entirely (e.g., directory read error), return an empty registry
if err != nil {

return &files, nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/api_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func APIServerHandler(ctx context.Context, route *apiserver.APIServerRoutes, bas
contentType := c.GetHeader("Content-Type")
if strings.Contains(contentType, "multipart/form-data") {
if err := handleMultipartForm(c, dr, fileMap); err != nil {

if he, ok := err.(*handlerError); ok {
errors = append(errors, ErrorResponse{
Code: he.statusCode,
Expand Down Expand Up @@ -526,7 +526,7 @@ func processWorkflow(ctx context.Context, dr *resolver.DependencyResolver) error
return err
}

// context already passed via dr.Context
// context already passed via dr.Context
if _, err := dr.HandleRunAction(); err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func TestStartAndWaitForOllamaReady(t *testing.T) {
// TestStartAPIServerWrapper_Error ensures that the startAPIServer helper
// forwards the error coming from StartAPIServerMode when the API server
// is not properly configured (i.e., workflow settings are missing).
func TestStartAPIServerWrapper_Error(t *testing.T) {
func TestStartAPIServerWrapper_Error(t *testing.T) {
mw := &MockWorkflow{} // GetSettings will return nil ➜ configuration missing

dr := &resolver.DependencyResolver{
Expand All @@ -200,7 +200,7 @@ func TestStartAPIServerWrapper_Error(t *testing.T) {
// TestStartWebServerWrapper_Success verifies that the startWebServer helper
// returns nil when the underlying StartWebServerMode succeeds with a minimal
// (but valid) WebServer configuration.
func TestStartWebServerWrapper_Success(t *testing.T) {
func TestStartWebServerWrapper_Success(t *testing.T) {
portNum := uint16(0) // Ask gin to use any free port

settings := &project.Settings{
Expand Down
10 changes: 7 additions & 3 deletions pkg/docker/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func buildURL(baseURL, version, arch string) string {
return strings.NewReplacer("{version}", version, "{arch}", arch).Replace(baseURL)
}

func GenerateURLs(ctx context.Context) ([]download.DownloadItem, error) {
func GenerateURLs(ctx context.Context, installAnaconda bool) ([]download.DownloadItem, error) {
urlInfos := []URLInfo{
{
BaseURL: "https://github.com/apple/pkl/releases/download/{version}/pkl-linux-{arch}",
Expand All @@ -122,13 +122,17 @@ func GenerateURLs(ctx context.Context) ([]download.DownloadItem, error) {
Architectures: []string{"amd64", "aarch64"},
LocalNameTemplate: "pkl-linux-{version}-{arch}",
},
{
}

// Only include anaconda if it should be installed
if installAnaconda {
urlInfos = append(urlInfos, URLInfo{
BaseURL: "https://repo.anaconda.com/archive/Anaconda3-{version}-Linux-{arch}.sh",
IsAnaconda: true,
Version: "2024.10-1",
Architectures: []string{"x86_64", "aarch64"},
LocalNameTemplate: "anaconda-linux-{version}-{arch}.sh",
},
})
}

var items []download.DownloadItem
Expand Down
Loading
Loading