Sonnet Review Bot sonnet-review-bot
  • Joined on 2026-04-24
sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 20:53:16 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[NIT] Double blank line before TestYAMLEmptyFileRejection. Minor formatting inconsistency — gofmt doesn't enforce blank-line counts between top-level declarations but it's slightly noisy.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:50:31 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[MINOR] The maxPosition helper shadows the builtin max identifier (available since Go 1.21). The local variable max inside the function will compile fine, but since the repo targets the latest stable Go, renaming to maxPos would avoid the shadowing and is more idiomatic.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:50:31 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[NIT] The section comment // --- PRReader --- is not standard Go doc style. The patterns doc recommends # Section Name within package doc comments for sections. For in-file section dividers, plain comments are fine, but the --- style is unusual in Go codebases. Minor style deviation, not a blocking issue.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:50:31 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[MINOR] The PostReview method fetches the full PR diff unconditionally whenever there are comments. If the diff is large, this adds latency and memory pressure for every review with inline comments. This is a design decision that may be acceptable, but it's worth noting that the diff could be cached or passed in if this becomes a performance concern.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:50:31 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[NIT] The +++ /dev/null prefix check must come before the +++ b/ check to be reachable. Currently the ordering is correct (+++ b/ is checked first, then +++ /dev/null), but since +++ /dev/null does not start with +++ b/, both checks are actually independent and ordering doesn't matter. A comment clarifying the ordering intent would improve readability.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:50:31 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[NIT] There is a blank line between TestAdapter_ListContents and TestAdapter_GetFileContent_RefRouting that is inconsistent with the rest of the file. Minor formatting issue that gofmt would not catch (extra blank line between top-level functions is still valid Go).

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 20:39:40 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MAJOR] Imports github.com/goccy/go-yaml, github.com/goccy/go-yaml/ast, and github.com/goccy/go-yaml/parser — none of which are on the approved dependency allowlist. This is a direct violation of the conventions' strict allowlist rule.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 20:39:40 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MAJOR] The repository conventions define a strict allowlist of approved third-party packages. github.com/goccy/go-yaml is NOT on the allowlist. The only approved YAML package is gopkg.in/yaml.v3. Per conventions: 'To request a new dependency: 1. Open a PR that ONLY updates this table. 2. Requires explicit approval from Aaron. 3. After merge, a separate PR may use the package.' This PR skips that process entirely.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 20:39:40 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MINOR] Extra blank line between TestYAMLDeeplyNestedRejection and TestYAMLEmptyFileRejection (two consecutive blank lines). Minor style issue per gofmt conventions (one blank line between top-level declarations).

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:31:49 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[MINOR] The BuildPositionToLineMap function never returns a non-nil error — all error paths are deferred to Translate. The function signature promises (*PositionMap, error) but the error is always nil. This misleads callers into error-checking something that never fails. Either the error return should be removed (making it func BuildPositionToLineMap(diff string) *PositionMap) or genuine parsing errors (e.g. malformed hunk headers) should be surfaced. Since parseHunkStart silently falls back to 1 on any parse failure, the latter may not be practical — but the always-nil error is a minor API lie.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:31:49 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[NIT] The call counter in TestAdapter_PostReview_WithComments_PositionTranslation assumes the diff fetch is always request #1 and the review POST is always request #2. This is a fragile ordering assumption — if the underlying client is ever refactored to make requests in a different order or adds a request, the test will silently misbehave. Using URL path inspection (r.URL.Path) to route requests would be more robust.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:31:49 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[NIT] TestAdapter_CompileTimeCheck is redundant — the same compile-time assertion already exists in gitea/conformance_test.go and vcs/check_test.go. A test function that only contains a compile-time var declaration adds no value as a Test* function (it can never fail at runtime). The assertion is already covered; this can be removed.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:31:49 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[MINOR] In PostReview, the CommitID field from vcs.ReviewComment is silently dropped when building giteaComments. The comment notes Gitea uses new_position (line number), but if the Gitea API also accepts a commit SHA on the review comment for anchoring, discarding it may cause comments to be placed on the wrong commit if the PR has been updated. At minimum, a comment explaining why CommitID is intentionally not forwarded would help future maintainers.

sonnet-review-bot commented on pull request rodin/review-bot#90 2026-05-12 20:31:49 +00:00
feat(vcs): Gitea adapter with diff-position translation (Phase 2)

[NIT] The maxPosition helper iterates over the map on every call to Translate for deletion lines. For large diffs this is O(n) per deletion-line translation. The position counter is already available during BuildPositionToLineMap — storing it per-file alongside the map would make Translate O(1). Not a correctness issue, but worth noting for large PRs.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 20:28:38 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MINOR] The empty document check (len(file.Docs) == 0) comes AFTER the multi-document check (len(file.Docs) > 1). While not a bug (both conditions are checked), it would be slightly more natural to check for empty first. More importantly: the previous gopkg.in/yaml.v3 implementation using dec.Decode(&node) would return an error on truly empty input, while parser.ParseBytes may return an empty Docs slice for whitespace-only or empty input. The new explicit empty-doc check is an improvement, but the error message 'empty YAML document' differs from what the old library would have returned — worth noting if callers match on error text.

sonnet-review-bot commented on pull request rodin/review-bot#89 2026-05-12 20:28:38 +00:00
fix(deps): replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml

[MAJOR] The repository CONVENTIONS.md defines a strict allowlist of approved third-party packages. The only approved YAML package is gopkg.in/yaml.v3. The package github.com/goccy/go-yaml is NOT on the allowlist. Per the documented process: 'To request a new dependency: 1. Open a PR that ONLY updates this table, 2. Requires explicit approval from Aaron, 3. After merge, a separate PR may use the package.' This PR skips that process entirely. Even if the intent is correct (issue #57 may have specified goccy/go-yaml), the dependency gate must be updated first in a separate PR before this change can be merged.