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
2 changes: 1 addition & 1 deletion src/cmd/cli/command/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func makeStackListCmd() *cobra.Command {
}

if len(stacks) == 0 {
_, err = term.Infof("No Defang stacks found in the current directory.\n")
_, err = term.Warnf("No Defang stacks found in the current directory.\n")
return err
}

Expand Down
2 changes: 1 addition & 1 deletion src/cmd/cli/command/stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestStackListCmd(t *testing.T) {
{
name: "no stacks present",
stacks: []stacks.Parameters{},
expectOutput: " * No Defang stacks found in the current directory.\n",
expectOutput: " ! No Defang stacks found in the current directory.\n",
},
{
name: "multiple stacks present",
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/cli/command/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func ListWorkspaces(cmd *cobra.Command, args []string) error {
rows := cli.WorkspaceRows(info, currentWorkspace)

if len(rows) == 0 {
term.Info("No workspaces found for this account.")
term.Warn("No workspaces found for this account.")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ require (
go.opentelemetry.io/otel/metric v1.41.0 // indirect
go.opentelemetry.io/otel/sdk v1.40.0 // indirect
go.opentelemetry.io/otel/trace v1.41.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sync v0.19.0
golang.org/x/text v0.32.0 // indirect
golang.org/x/time v0.12.0 // indirect
golang.org/x/tools v0.39.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions src/pkg/agent/plugins/compat_oai/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"encoding/json"
"errors"
"fmt"
"log/slog"
"strings"

"github.com/DefangLabs/defang/src/pkg/term"
"github.com/firebase/genkit/go/ai"
"github.com/openai/openai-go"
"github.com/openai/openai-go/packages/param"
Expand Down Expand Up @@ -258,7 +258,7 @@ func (g *ModelGenerator) generateStream(ctx context.Context, handleChunk func(co
if err != nil {
return nil, fmt.Errorf("failed to marshal request params for debug: %w", err)
}
_, _ = term.Debugf("Chat.Completions.NewStreaming: %s", string(reqParams))
slog.DebugContext(ctx, "Chat.Completions.NewStreaming", "params", string(reqParams))
stream := g.client.Chat.Completions.NewStreaming(ctx, *g.request)
defer stream.Close()

Expand Down
3 changes: 2 additions & 1 deletion src/pkg/cli/cd.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ func CdListFromStorage(ctx context.Context, provider client.Provider, allRegions
if allRegions {
accountInfo.Region = ""
}
term.Printf("No projects found in %v\n", accountInfo)
term.Warnf("No projects found in %v\n", accountInfo)
return nil
}

return term.Table(stacks, "Project", "Stack", "Workspace", "CdRegion")
Expand Down
16 changes: 8 additions & 8 deletions src/pkg/cli/client/byoc/aws/byoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,14 @@ func (b *ByocAws) runCdCommand(ctx context.Context, cmd cdCommand) (awscodebuild
}
}

if cmd.statesUrl != "" {
env["DEFANG_STATES_UPLOAD_URL"] = cmd.statesUrl
}

if cmd.eventsUrl != "" {
env["DEFANG_EVENTS_UPLOAD_URL"] = cmd.eventsUrl
}

if os.Getenv("DEFANG_PULUMI_DIR") != "" {
// Convert the environment to a human-readable array of KEY=VALUE strings for debugging
debugEnv := []string{"AWS_REGION=" + string(b.driver.Region)}
Expand All @@ -574,14 +582,6 @@ func (b *ByocAws) runCdCommand(ctx context.Context, cmd cdCommand) (awscodebuild
}
}

if cmd.statesUrl != "" {
env["DEFANG_STATES_UPLOAD_URL"] = cmd.statesUrl
}

if cmd.eventsUrl != "" {
env["DEFANG_EVENTS_UPLOAD_URL"] = cmd.eventsUrl
}

// Prepend the entrypoint; CodeBuild runs buildspec commands in a shell, not via Docker ENTRYPOINT
args := append([]string{"node", "lib/index.js"}, cmd.command...)
return b.driver.Run(ctx, "/app", b.CDImage, env, args...)
Expand Down
11 changes: 6 additions & 5 deletions src/pkg/cli/client/byoc/aws/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ func ListPulumiStacks(ctx context.Context, s3client S3Client, bucketName string)
if obj.Key == nil || obj.Size == nil {
continue
}
state, err := state.ParsePulumiStateFile(ctx, s3Obj{obj}, bucketName, func(ctx context.Context, bucket, path string) ([]byte, error) {
state, err := state.ParsePulumiStateFile(ctx, s3Obj{obj}, func(ctx context.Context, path string) ([]byte, error) {
getObjectOutput, err := s3client.GetObject(ctx, &s3.GetObjectInput{
Bucket: &bucket,
Bucket: &bucketName,
Key: &path,
})
if err != nil {
return nil, err
}
defer getObjectOutput.Body.Close()
return io.ReadAll(getObjectOutput.Body)
})
if err != nil {
Expand Down Expand Up @@ -140,15 +141,15 @@ func (b *ByocAws) listPulumiStacksAllRegions(ctx context.Context, s3client S3Cli
wg.Add(1)
go func(region aws.Region) {
defer wg.Done()
stacks, err := b.listPulumiStacksInBucket(ctx, region, *bucket.Name)
stateInfos, err := b.listPulumiStacksInBucket(ctx, region, *bucket.Name)
if err != nil {
return
}
for stack := range stacks {
for stateInfo := range stateInfos {
select {
case <-ctx.Done():
return
case stackCh <- stack:
case stackCh <- stateInfo:
}
}
}(bucketRegion)
Expand Down
Loading
Loading