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
5 changes: 5 additions & 0 deletions .mise/tasks/stencil/post/go-sync
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ source "$DEVBASE_LIB_DIR"/sed.sh

appDir="$(get_repo_directory)"

if ! grep -q '^golang ' "$appDir/.tool-versions"; then
info "No Go version found in $appDir/.tool-versions, skipping"
exit 0
fi

goVersion="$(grep "^golang " "$appDir"/.tool-versions | awk '{print $2}')"
gomodGoVersion=""
if [[ -f "$appDir/go.mod" ]]; then
Expand Down
1 change: 1 addition & 0 deletions .mise/tasks/stencil/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
#MISE depends=["devbase:sync"]
#MISE depends_post=["stencil:post"]

mise upgrade github:getoutreach/stencil@latest
exec stencil --skip-update
25 changes: 9 additions & 16 deletions e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/getoutreach/devbase/v2/e2e/config"
"github.com/getoutreach/gobox/pkg/box"
githubauth "github.com/getoutreach/gobox/pkg/cli/github"
"github.com/getoutreach/gobox/pkg/set"
"github.com/pkg/errors"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -53,7 +54,7 @@ func osStdOutErr(c *exec.Cmd) *exec.Cmd {
// is a flat list of all of the dependencies of the initial root
// application who's dependency list was provided.
func BuildDependenciesList(ctx context.Context, conf *box.Config) ([]string, error) {
deps := make(map[string]struct{})
deps := make(set.Set[string])

dc, err := config.FromFile("devenv.yaml")
if err != nil {
Expand All @@ -66,17 +67,12 @@ func BuildDependenciesList(ctx context.Context, conf *box.Config) ([]string, err
}
}

depsList := make([]string, 0)
for d := range deps {
depsList = append(depsList, d)
}

return depsList, nil
return deps.Slice(), nil
}

// findDependenciesInRepo finds the dependencies in a repository
// at all of the possible paths
func findDependenciesInRepo(ctx context.Context, conf *box.Config, serviceName string) (map[string]struct{}, error) {
func findDependenciesInRepo(ctx context.Context, conf *box.Config, serviceName string) (set.Set[string], error) {
possibleFiles := []string{"devenv.yaml", "noncompat-service.yaml", "service.yaml"}
gh, err := githubauth.NewClient()
if err != nil {
Expand All @@ -100,11 +96,8 @@ func findDependenciesInRepo(ctx context.Context, conf *box.Config, serviceName s
return nil, nil
}

deps := make(map[string]struct{})
// We deploy just required transitive dependencies
for _, d := range dc.Dependencies.Required {
deps[d] = struct{}{}
}
deps := set.Of(dc.Dependencies.Required...)

return deps, nil
}
Expand All @@ -113,15 +106,15 @@ func findDependenciesInRepo(ctx context.Context, conf *box.Config, serviceName s
// it on the fly via git cloning of the dependencies. Passed in
// is a hash map used to prevent infinite recursion and de-duplicate
// dependencies. New dependencies are inserted into the provided hash-map
func grabDependencies(ctx context.Context, conf *box.Config, deps map[string]struct{}, serviceName string) error {
func grabDependencies(ctx context.Context, conf *box.Config, deps set.Set[string], serviceName string) error {
// We special case this here to ensure we don't fail on deps that haven't updated
// their dependency yet.
if serviceName == flagship {
serviceName = "outreach"
}

// Skip if we've already been downloaded
if _, ok := deps[serviceName]; ok {
if deps.Contains(serviceName) {
return nil
}

Expand All @@ -135,9 +128,9 @@ func grabDependencies(ctx context.Context, conf *box.Config, deps map[string]str

// Mark us as resolved to prevent inf dependency resolution
// when we encounter cyclical dependency.
deps[serviceName] = struct{}{}
deps.Insert(serviceName)

for d := range foundDeps {
for d := range foundDeps.All() {
if err := grabDependencies(ctx, conf, deps, d); err != nil {
return err
}
Expand Down
92 changes: 56 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,86 +6,106 @@ toolchain go1.25.7

require (
github.com/chainguard-dev/git-urls v1.0.2
github.com/getoutreach/gobox v1.111.4
github.com/getoutreach/gobox v1.116.0
github.com/getoutreach/localizer v1.15.19
github.com/google/go-github/v84 v84.0.0
github.com/magefile/mage v1.17.2
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.35.1
google.golang.org/grpc v1.81.1
google.golang.org/grpc v1.82.1
gopkg.in/yaml.v2 v2.4.0
gotest.tools/v3 v3.5.2
)

require (
al.essio.dev/pkg/shellescape v1.5.1 // indirect
charm.land/bubbles/v2 v2.1.1 // indirect
charm.land/bubbletea/v2 v2.0.8 // indirect
charm.land/lipgloss/v2 v2.0.5 // indirect
dario.cat/mergo v1.0.2 // indirect
github.com/AlecAivazis/survey/v2 v2.3.7 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.3.0 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charmbracelet/colorprofile v0.4.3 // indirect
github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 // indirect
github.com/charmbracelet/log v1.0.0 // indirect
github.com/charmbracelet/ultraviolet v0.0.0-20260703014108-f5a850f9c2b7 // indirect
github.com/charmbracelet/x/ansi v0.11.7 // indirect
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
github.com/charmbracelet/x/term v0.2.2 // indirect
github.com/charmbracelet/x/termios v0.1.1 // indirect
github.com/charmbracelet/x/windows v0.2.2 // indirect
github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/cloudflare/circl v1.6.3 // indirect
github.com/creack/pty v1.1.24 // indirect
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
github.com/danieljoos/wincred v1.2.2 // indirect
github.com/danieljoos/wincred v1.2.3 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.8.0 // indirect
github.com/go-git/go-git/v5 v5.17.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-git/go-billy/v5 v5.9.1 // indirect
github.com/go-git/go-git/v5 v5.19.1 // indirect
github.com/go-logfmt/logfmt v0.6.1 // indirect
github.com/go-logr/logr v1.4.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/godbus/dbus/v5 v5.2.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/go-querystring v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
github.com/honeycombio/beeline-go v1.19.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
github.com/honeycombio/beeline-go v1.20.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v1.6.0 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/lucasb-eyer/go-colorful v1.4.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mattn/go-isatty v0.0.22 // indirect
github.com/mattn/go-runewidth v0.0.24 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pjbgf/sha1cd v0.5.0 // indirect
github.com/prometheus/client_golang v1.23.2 // indirect
github.com/pjbgf/sha1cd v0.6.0 // indirect
github.com/prometheus/client_golang v1.24.1 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.5 // indirect
github.com/prometheus/procfs v0.19.2 // indirect
github.com/prometheus/common v0.70.1 // indirect
github.com/prometheus/procfs v0.21.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sahilm/fuzzy v0.1.3 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/skeema/knownhosts v1.3.2 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/zalando/go-keyring v0.2.6 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/zalando/go-keyring v0.2.8 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 // indirect
go.opentelemetry.io/otel v1.43.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.42.0 // indirect
go.opentelemetry.io/otel/metric v1.43.0 // indirect
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
go.opentelemetry.io/otel/trace v1.43.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/otel/exporters/otlp/otlptrace v1.44.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc 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/trace v1.44.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/net v0.52.0 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/crypto v0.54.0 // indirect
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect
golang.org/x/net v0.57.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/term v0.41.0 // indirect
golang.org/x/text v0.35.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260311181403-84a4fc48630c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/term v0.45.0 // indirect
golang.org/x/text v0.40.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading