Skip to content

Conversation

@frrist
Copy link
Member

@frrist frrist commented Dec 5, 2025

No description provided.

Copy link
Member

@Peeja Peeja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mostly looks great! A couple of notes worth addressing, and some conflicts to resolve, but I'll leave it all to your discretion.

return fmt.Errorf("loading config: %w", err)
}

c := cmdutil.MustGetClient(storePath, client.WithAdditionalProofs(proofs...))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Did we mean to lose the additional proofs here?

setSpanAttributes(cmd, span)

storePath = filepath.Join(guppyDirPath, "store.json")
cfg, err := config.Load()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: If we're doing this here already, can we "pass down" the config somehow, or do we have to config.Load() in each command that needs it as well?


func initFlags() {
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "",
"Config file path. Attempts to load from user config directory if not set e.g. ~/.config/"+defaultConfigFilePath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: .config, or .storacha?


func init() {
cobra.EnableTraverseRunHooks = true
// Register flags/commands before Cobra parses args so subcommands are available.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Can you say more? I'm not following.

viper.SetEnvPrefix("GUPPY")
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))

// if no flag was provided look in $HOME/.config/guppy/config.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: This isn't accurate on macOS (or some other OSes).

Suggested change
// if no flag was provided look in $HOME/.config/guppy/config.toml
// if no flag was provided look in <os.UserConfigDir()>/guppy/config.toml

That said, using ~/Library/Application Support/guppy feels weird, too.

if err != nil {
return err
}
// FIXME: We should fix this!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think this is about to be solved with the UI overhaul.

}

func (r RepoConfig) PreparationDatabaseFilePath() string {
return filepath.Join(r.DataDir, "preparation.db")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Is this no longer independently configurable? I'm not against that, just confirming. It was probably too flexible before.

Comment on lines +10 to +13
Identity IdentityConfig `mapstruct:"identity"`
Repo RepoConfig `mapstruct:"repo"`
UploadService ServiceConfig `mapstruct:"upload_service"`
IndexingService ServiceConfig `mapstruct:"indexing_service"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question/suggestion: Should this be

Suggested change
Identity IdentityConfig `mapstruct:"identity"`
Repo RepoConfig `mapstruct:"repo"`
UploadService ServiceConfig `mapstruct:"upload_service"`
IndexingService ServiceConfig `mapstruct:"indexing_service"`
Identity IdentityConfig `mapstructure:"identity"`
Repo RepoConfig `mapstructure:"repo"`
UploadService ServiceConfig `mapstructure:"upload_service"`
IndexingService ServiceConfig `mapstructure:"indexing_service"`

?

Comment on lines +24 to +26
func (r RepoConfig) AgentDataFilePath() string {
return filepath.Join(r.DataDir, "store.json")
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: This seems off to me. You can have agent data when there's no repo. The repo/db is only used for guppy upload. Lots of commands use the agent data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants