Skip to content

feat(review): Add fixed revision and remote reviews - #12

Merged
nfebe merged 3 commits into
mainfrom
feat/review-evaluation
Oct 7, 2026
Merged

nfebe merged 3 commits into
mainfrom
feat/review-evaluation

Conversation

@nfebe

@nfebe nfebe commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Allow reviews of specific commits locally or through a remote reviewer. Remote reviews upload committed source and report omitted files.

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

@sourceant

sourceant Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Code Review Summary

Adds remote review support: review can POST a committed snapshot (diff plus source files) to a reviewer server authenticated via SOURCEANT_REVIEW_TOKEN, and accepts --base/--head to review a fixed commit range locally. New flags cover --dir, --repository, --host, --option, --diff-file, --pr-metadata, --description-file, and --format. Binary, non-UTF-8, oversized, and unsupported-path files are omitted and reported.

🚀 Key Improvements

  • checkoutSnapshot validates HEAD, clean status, and full SHAs before uploading any source.
  • Non-following HTTP client plus HTTPS/loopback host validation reduces credential leakage.
  • Snapshot size, file count, and per-file limits bound the upload; omitted files are reported.

💡 Minor Suggestions

  • --format text sets opts.asJSON = false, silently flipping output to text even when the global --json flag was passed; this mutates shared options state for the rest of the process. Only override when the user explicitly asked for json, or reject the combination outright.
  • Review coverage is incomplete. Inspect the execution details before approving.

@sourceant-local

Copy link
Copy Markdown

This repository is not connected to any of your workspaces. Please connect it at https://app.sourceant.ai to get reviews on it.

@sourceant-local sourceant-local Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

return err
}
} else {
report(cmd.OutOrStdout(), agent.Reading{Status: result.Status, Review: result.Review})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The reviewer's omitted-file list never reaches a human in the default text output, so binary or oversized files are silently dropped from a snapshot a user believes was complete. Print the omitted paths when the list is non-empty.

Suggested change
report(cmd.OutOrStdout(), agent.Reading{Status: result.Status, Review: result.Review})
if len(result.Snapshot.Omitted) != 0 {
fmt.Fprintf(cmd.ErrOrStderr(), "omitted %d file(s) from the snapshot: %s\n", len(result.Snapshot.Omitted), strings.Join(result.Snapshot.Omitted, ", "))
}
report(cmd.OutOrStdout(), agent.Reading{Status: result.Status, Review: result.Review})

Comment thread internal/command/review_snapshot.go Outdated
if len(status) != 0 {
return snapshot, fmt.Errorf("commit tracked changes before submitting a remote snapshot")
}
diff, err := checkoutGit(ctx, folder, "diff", "--no-ext-diff", "--no-textconv", settings.base+"..."+settings.head)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

git diff honours color.ui=always (and diff.wsErrorHighlight), so ANSI escapes can be embedded in the uploaded diff and make the --diff-file bytes.Equal check fail. Add --no-color so the patch is plain regardless of the user's git config.

Suggested change
diff, err := checkoutGit(ctx, folder, "diff", "--no-ext-diff", "--no-textconv", settings.base+"..."+settings.head)
diff, err := checkoutGit(ctx, folder, "diff", "--no-ext-diff", "--no-textconv", "--no-color", settings.base+"..."+settings.head)

@sourceant-local sourceant-local Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

@sourceant-local sourceant-local Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

"it is committed or not, and say whether it is ready to propose.",
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
if format != "" && format != "json" && format != "text" {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

--format text sets opts.asJSON = false, silently flipping output to text even when the global --json flag was passed; this mutates shared options state for the rest of the process. Only override when the user explicitly asked for json, or reject the combination outright.

Suggested change
if format != "" && format != "json" && format != "text" {
if format != "" && format != "json" && format != "text" {
return fmt.Errorf("format must be json or text")
}
if format == "json" {
opts.asJSON = true
}

@nfebe
nfebe merged commit e121cb1 into main Oct 7, 2026
3 checks passed
@nfebe
nfebe deleted the feat/review-evaluation branch October 7, 2026 10:09
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.

1 participant