Refactor everything
Change-Id: Ic3a37c38cfecba943c91f6ae545ce1c5b551c0d5
diff --git a/server/config/config.go b/server/config/config.go
index 86dd7a5..c51bd43 100644
--- a/server/config/config.go
+++ b/server/config/config.go
@@ -62,7 +62,7 @@
// GitConfig represents Git operation configuration
type GitConfig struct {
- BranchPrefix string `yaml:"branch_prefix"`
+ RepoPath string `yaml:"repo_path"`
CommitMessageTemplate string `yaml:"commit_message_template"`
PRTemplate string `yaml:"pr_template"`
}
@@ -158,9 +158,6 @@
}
// Git defaults
- if config.Git.BranchPrefix == "" {
- config.Git.BranchPrefix = "task/"
- }
if config.Git.CommitMessageTemplate == "" {
config.Git.CommitMessageTemplate = "Task {task_id}: {task_title}\n\n{solution}\n\nGenerated by Staff AI Agent: {agent_name}"
}
@@ -207,11 +204,11 @@
// Validate that at least one Git provider is configured
hasGitHub := config.GitHub.Token != "" && config.GitHub.Owner != "" && config.GitHub.Repo != ""
hasGerrit := config.Gerrit.Username != "" && config.Gerrit.Password != "" && config.Gerrit.BaseURL != "" && config.Gerrit.Project != ""
-
+
if !hasGitHub && !hasGerrit {
return fmt.Errorf("either GitHub or Gerrit configuration is required")
}
-
+
// Validate GitHub config if provided
if config.GitHub.Token != "" {
if config.GitHub.Owner == "" {
@@ -221,7 +218,7 @@
return fmt.Errorf("github.repo is required when github.token is provided")
}
}
-
+
// Validate Gerrit config if provided
if config.Gerrit.Username != "" {
if config.Gerrit.Password == "" {