feat(pierre): add diff chunking and configurable review settings
This commit is contained in:
@@ -37,7 +37,19 @@ type LLMConfig struct {
|
||||
Model string `help:"Model to use" env:"LLM_MODEL"`
|
||||
}
|
||||
|
||||
// ReviewConfig holds the review‑specific CLI options.
|
||||
// The `default:"60000"` tag sets an integer default of 60 KB – Kong parses the string value into the int field, which can be confusing for readers.
|
||||
type ReviewConfig struct {
|
||||
MaxChunkSize int `help:"Maximum diff chunk size in bytes" default:"60000"`
|
||||
Guidelines []string `help:"Project guidelines to prepend" sep:","`
|
||||
DisableComments bool `help:"Disable posting comments (dry run)"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
// Embedding ReviewConfig with a prefix changes flag names to `--review-…`.
|
||||
// Existing configuration files using the old flag names will need to be updated.
|
||||
// Consider keeping backwards compatibility if required.
|
||||
Review ReviewConfig `embed:"" prefix:"review-"`
|
||||
GitProvider string `help:"Git provider (bitbucket or gitea)" env:"GIT_PROVIDER"`
|
||||
Bitbucket BitbucketConfig `embed:"" prefix:"bitbucket-"`
|
||||
Gitea GiteaConfig `embed:"" prefix:"gitea-"`
|
||||
@@ -117,7 +129,7 @@ func main() {
|
||||
log.Fatalf("Error initializing AI: %v", err)
|
||||
}
|
||||
|
||||
pierreService := pierre.New(ai, git)
|
||||
pierreService := pierre.New(ai, git, cfg.Review.MaxChunkSize, cfg.Review.Guidelines, cfg.Review.DisableComments)
|
||||
if err := pierreService.MakeReview(context.Background(), cfg.Repo.Owner, cfg.Repo.Repo, cfg.Repo.PRID); err != nil {
|
||||
log.Fatalf("Error during review: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user