Skip to content

[codex] add review action with built-in defaults#2

Merged
Svtter merged 1 commit into
mainfrom
codex/add-review-wrapper-action
Apr 2, 2026
Merged

[codex] add review action with built-in defaults#2
Svtter merged 1 commit into
mainfrom
codex/add-review-wrapper-action

Conversation

@Svtter
Copy link
Copy Markdown
Collaborator

@Svtter Svtter commented Apr 2, 2026

Summary

  • add a new review subdirectory action (Svtter/opencode-actions/review) as an opinionated PR-review wrapper
  • set review defaults in that action:
    • built-in review prompt template
    • built-in model default zhipuai-coding-plan/glm-5
  • update docs and example workflow to use review@v1 for the simplest setup
  • extend CI + local tests to cover the new action metadata and smoke usage

Why

  • make review workflows easier to configure without repeating prompt/model boilerplate

Validation

  • bash tests/test.sh (passes)
  • shellcheck ... could not be run locally in this environment because shellcheck is not installed; CI still runs it

@Svtter Svtter marked this pull request as ready for review April 2, 2026 02:58
@Svtter Svtter merged commit 15940e6 into main Apr 2, 2026
2 checks passed
Svtter added a commit that referenced this pull request May 26, 2026
- Remove dead httpRequest code and unused http/https imports (阻塞项 #1)
- Reverse diff fetch priority: pre-fetched file first, platform fetch as
  fallback to avoid duplicate API calls on GitHub (阻塞项 #2)
- Fix redundant Python exception catches (Exception covers subclasses)
- Use get_env() in detect_platform() for consistency
- Add HTTPS warning for GITEA_API_URL using plain HTTP
- Validate GITHUB_REPOSITORY format before API calls
- Lazy-cache hasTea() result to avoid repeated which calls
- Add pagination support for Gitea comment cleanup
- Revert tsup externals (https/http no longer imported)
- Remove duplicate empty-diff check in index.ts
Svtter added a commit that referenced this pull request May 27, 2026
TS (platform.ts):
- Cache detectPlatform() result to avoid repeated env reads (#6)
- getRepo() returns empty string + warn instead of throw (#5)
- fetchAllGiteaComments() capped at MAX_PAGES=20 (#1)
- getGiteaToken() checks both GITEA_TOKEN and GITHUB_RUN_OPENCODE_GITEA_TOKEN (#13)
- Add /* ignore */ comments to empty catch blocks (#11)

Python (run-github-opencode.py):
- Use specific exception types: (TimeoutExpired, JSONDecodeError) not bare Exception (#2)
- Add HTTP plaintext warning for GITEA_API_URL (#3)
- Validate repo/pr format before URL construction (#4)
- Add pagination for Gitea comment listing with max_pages=20 (#1)
- Unify token lookup to GITEA_TOKEN only (#13)
Svtter added a commit that referenced this pull request May 27, 2026
- Restore error log in GitHub cleanup catch block (#1)
- Add --repo to tea pulls diff call (#2)
- Python Gitea token fallback: check both GITEA_TOKEN and GITHUB_RUN_OPENCODE_GITEA_TOKEN (#4)
Svtter added a commit that referenced this pull request May 27, 2026
* feat: add Gitea CI compatibility via platform abstraction layer

- New platform.ts: auto-detect GitHub/Gitea via GITEA_API_URL env var
- Unified interfaces for PR diff fetch, comment posting, error comment cleanup
- Gitea: tea CLI (preferred) → curl REST API fallback
- GitHub: unchanged, zero-impact on existing workflows
- comment.ts refactored to thin proxy over platform.ts
- index.ts: platform-aware diff fetch with pre-fetched file fallback
- action.yml (multi-review, review): new gitea-token input
- Python: detect_platform() + Gitea error comment cleanup

Closes #55

* fix: address AI code review feedback

- Remove dead httpRequest code and unused http/https imports (阻塞项 #1)
- Reverse diff fetch priority: pre-fetched file first, platform fetch as
  fallback to avoid duplicate API calls on GitHub (阻塞项 #2)
- Fix redundant Python exception catches (Exception covers subclasses)
- Use get_env() in detect_platform() for consistency
- Add HTTPS warning for GITEA_API_URL using plain HTTP
- Validate GITHUB_REPOSITORY format before API calls
- Lazy-cache hasTea() result to avoid repeated which calls
- Add pagination support for Gitea comment cleanup
- Revert tsup externals (https/http no longer imported)
- Remove duplicate empty-diff check in index.ts

* fix: address second round AI code review feedback

TS (platform.ts):
- Cache detectPlatform() result to avoid repeated env reads (#6)
- getRepo() returns empty string + warn instead of throw (#5)
- fetchAllGiteaComments() capped at MAX_PAGES=20 (#1)
- getGiteaToken() checks both GITEA_TOKEN and GITHUB_RUN_OPENCODE_GITEA_TOKEN (#13)
- Add /* ignore */ comments to empty catch blocks (#11)

Python (run-github-opencode.py):
- Use specific exception types: (TimeoutExpired, JSONDecodeError) not bare Exception (#2)
- Add HTTP plaintext warning for GITEA_API_URL (#3)
- Validate repo/pr format before URL construction (#4)
- Add pagination for Gitea comment listing with max_pages=20 (#1)
- Unify token lookup to GITEA_TOKEN only (#13)

* fix: address third round review feedback

- Restore error log in GitHub cleanup catch block (#1)
- Add --repo to tea pulls diff call (#2)
- Python Gitea token fallback: check both GITEA_TOKEN and GITHUB_RUN_OPENCODE_GITEA_TOKEN (#4)
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