feat: add Gitea forge implementation (3/3)#134
Merged
Conversation
6c71f62 to
fde8ce5
Compare
Owner
|
I merged the |
Contributor
Author
|
let me rebase. this was exactly my question: I am unaware of a stacking approach for forks/PRs is something like that possible? |
Add GiteaClient implementing the ForgeClient interface for Gitea pull request operations. Supports creating, updating, merging PRs, stack comment management via issue comments, and CI status checks. Key additions: - src/forge/gitea.rs with full Gitea API v1 client - AuthorizationToken auth style and patch_json helper in forge/mod.rs - Integration tests for submit (comment/body/both/off modes) and merge/merge-when-ready with PR retargeting Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…nation limits - Fix is_pr_merged() to check only the `merged` field instead of also treating closed PRs as merged (a closed PR may have been rejected) - Add limit=50 to all Gitea list API calls (pulls, comments, statuses) to avoid silent truncation at Gitea's default page size of 30 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Map raw Gitea status strings to normalized conclusions: success->success, failure/error->failure. This matches the GitLab normalization pattern so downstream consumers get consistent values. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Pagination parameters only apply to GET requests. The limit=50 was accidentally added to the POST endpoint by a bulk replace. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…nings - Fix aggregate CI overall status: failure now takes priority over pending. Previously find_map short-circuited on the first non-success status, so [pending, failed] would report "pending" instead of "failure". Both GitLab and Gitea clients affected. - Replace GitHub-specific auth check in ci.rs with forge_token() so `stax ci` works on GitLab/Gitea repos. - Replace hardcoded "GitHub" in user-facing error messages (submit.rs, ci.rs) with forge-generic wording. - Rename API stats labels from "github.api.*" to "forge.api.*". - Add eprintln warnings when reviewers/labels/assignees are requested on forges that don't support them (were silent no-ops). - Add Display impl for ForgeType. - Add unit tests for aggregate_ci_overall priority logic. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Fix MergePullRequest serialization: Gitea API expects PascalCase "MergeTitleField" but we were sending snake_case "merge_title_field", causing squash merge commit titles to be silently ignored. - Recognize Forgejo (popular Gitea fork) in forge detection so self-hosted Forgejo instances use the Gitea client automatically. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Two bugs: 1. test_submit_gitea_comment_mode_creates_pull_and_issue_comment was missing the #[tokio::test] attribute, so the test runner never executed it (same class of bug as the GitLab one). 2. Gitea's API returns state="closed" for merged PRs (with a separate merged=true field), so pr.state.to_uppercase() produced "CLOSED" instead of "MERGED". This broke sync's metadata-based merge detection (sync.rs:1133 checks for state "MERGED"). Added normalize_gitea_state() that checks the merged field first, mirroring GitLab's normalize_gitlab_state() approach. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
0e3b3b9 to
3814cd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GiteaClientimplementing theForgeClientinterface for Gitea pull requestsAuthorizationTokenauth style andpatch_jsonhelper toforge/mod.rsThis is PR 3 of 3, splitting #100 into reviewable increments.
Stack:
Test plan
🤖 Generated with Claude Code