Skip to content

feat(gitea): Gitea task source (refresh of #5493) - #48552

Open
markelm1 wants to merge 34 commits into
stablyai:mainfrom
markelm1:feat/gitea-task-source-refresh
Open

markelm1 wants to merge 34 commits into
stablyai:mainfrom
markelm1:feat/gitea-task-source-refresh

Conversation

@markelm1

@markelm1 markelm1 commented Nov 24, 2026 •

Copy link
Copy Markdown

ELI5

Teams that host their code on Gitea or Forgejo can now pick Gitea in Tasks, see their issues and pull requests next to GitHub/GitLab/Linear/Jira, open one, and start a workspace from it, from the desktop app, a paired server or the web client.

What Changed

This is a refresh of #5493 (by @beatkapo, kept as co-author on every commit) rebuilt on today's main, plus what it took to make it behave like the GitLab source.

Before: Gitea was a hosted-review provider only. Tasks listed GitHub, GitLab, Linear and Jira; a Gitea project showed "No GitHub source detected", and Gitea credentials could only come from ORCA_GITEA_TOKEN in the environment.

After:

  • Tasks source. gitea joins TASK_PROVIDERS. Its list plugs into the Tasks page pipeline like GitLab: views (All / Issues / PRs), the shared project picker, state and involvement chips (All open / Assigned to me / Created / Closed), refresh, New issue, and the same ID / Title / Type·State / Updated table with Start workspace and Open in Gitea. Selected projects are read in parallel, each on the host that owns it, and non-Gitea projects in a mixed selection are skipped quietly.
  • Detail. Issues and PRs open in the feat(tasks): add Gitea and Forgejo task source #5493 detail sheets (body, comments, labels, assignees, close/reopen; PR files, checks, review comments, merge). The list chrome hides while one is open.
  • PR and issue actions. A PR's title and description can be edited, the PR closed or reopened, a WIP: draft marked ready, and a review submitted (approve, request changes, comment). Issue descriptions are editable through the same inline editor. These go through new gitea.prUpdate / gitea.prSubmitReview methods like every other Gitea call.
  • CI runs. When the server exposes the Actions API (recent Gitea and Forgejo), the PR Checks tab lists the workflow runs for the head commit with their jobs. Expanding a job shows its log (ANSI stripped, last 512 KB), and a job or a whole run can be re-run, using Gitea's nested job path or Forgejo's direct one. Commit statuses that a listed run already covers are hidden, and servers without Actions show the commit statuses as before. These go through gitea.actionRuns / gitea.actionJobLog / gitea.actionRerun.
  • Composer search. The new-workspace composer gets a Gitea tab for repos on a connected server. It searches open issues and PRs by keyword (Gitea's q=), and picking one links it to the new workspace like the Tasks page's Start workspace.
  • Workspace references. orca worktree create --reference and orca reference add accept self-hosted Gitea issue URLs ([Feature]: Support Gitea issue URLs as workspace references #49681), and PR URLs under a subpath install. A self-hosted /owner/repo/issues/N URL can't be told apart from GitHub Enterprise by its shape, so the CLI asks the host through gitea.matchReferenceUrl whether the URL is on a Gitea server it knows; the method answers yes or no only. Subpath installs parse for Gitea only, and the workspace link editor gains a "Gitea issue" kind. orca reference remove matches the URL against saved links without asking the host, so links stay removable after a server is disconnected.
  • Start workspace. Carries the task source context with a Gitea provider identity (server, owner, repo), a seeded name and the item's repo, so the workspace keeps an openable link to its issue. A Gitea-linked issue also feeds AI pull request generation, like GitHub and GitLab.
  • Remote hosts and the web client. feat(tasks): add Gitea and Forgejo task source #5493 called a desktop-only preload bridge, so it could not work for repos on a paired server or in the web client. Every Gitea call is now a gitea.* runtime RPC method validated by shared zod params (gitea-params.ts) that the desktop IPC handlers reuse, and the renderer routes through giteaApiFor() exactly like gitLabApiFor().
  • Credentials. Servers can be connected in Settings (token stored with the shared encrypted credential caches, like Jira sites). One resolver serves the task source and pull requests: ORCA_GITEA_TOKEN / ORCA_GITEA_API_BASE_URL first (unchanged), then a server saved for the remote's host. Create PR checks the token for the repo's own host. Settings has one Gitea card (connect, add server, test, disconnect) instead of two cards sharing a DOM id.
  • Provider validation. Several validators listed providers by hand, so a Gitea source context normalized to null and creating a workspace from a Gitea issue failed with "Invalid linked work item". TaskProvider now derives from the TASK_PROVIDERS tuple and those validators read it.
  • Mobile. Tasks on the phone lists Gitea issues and PRs per repository with the same views and filters, and tapping one starts a linked workspace. Phones may call gitea.listWorkItems (routed to the repo's host), and the host advertises gitea.mobile-tasks.v1 so older hosts keep Gitea off the phone. Tapping an item opens the shared item page (description, labels, assignees, commit statuses, discussion with a comment box, close/reopen) on hosts that also advertise gitea.mobile-item-detail.v1; older hosts send the tap straight to the workspace form. Editing titles, labels and assignees, reviews and merges stay on desktop and web.
  • Reads that used to drop data silently. Labels and reviews are read page by page (Gitea caps pages at 50), a failed review-comment or diff read now shows an error and Retry instead of vanishing or showing a blank diff, large PRs load diffs only as they scroll into view, and a PR or issue refresh after an edit can no longer be overwritten by an older read.
  • Translations. Every Gitea string is translated in all 11 desktop locales and the mobile locales.

Why

#4703 has been waiting since June, and #5493 was rebuilt on the task-source refactor but has since drifted ~12.5k commits behind main; 23 of the files it touched moved. Rather than open a parallel implementation, this ports that work forward and fixes what blocked it in practice: remote/web routing, credential parity with PRs, and the provider validators. A plugin task source (#22174) would be another route, but plugins are not available on a headless orca serve, which is where several Forgejo users in #4703 run Orca.

Self-hosted Gitea commonly runs on plain HTTP inside a LAN. The hosted-review client, Jira Server and glab already accept those hosts, so the task source accepts them too; URLs still reject embedded credentials, queries and fragments, a saved token only goes to its own host, and token-carrying requests refuse redirects.

Linked Issue

Fixes #4703
Fixes #49681

Supersedes #5493 (same feature, rebased and extended; happy to fold this back into that PR instead if @beatkapo prefers). Related: #43931 / #43714 (self-hosted Gitea issue URLs as references; this PR covers the Gitea side).

Visual Proof

All "after" shots are the web client paired to an orca serve built from this branch, against a self-hosted Gitea over HTTP, with credentials connected from Settings only (no environment variables).

Before (main) After
Tasks on main Gitea source in Tasks
Issues · Assigned to me Issue detail
Assigned issues Issue detail
Start workspace Settings: before connecting → connected
Composer with linked Gitea issue Card, not connected Card, connected

On main the Gitea card only explains the environment variables; there is no way to connect a server from Settings.

Testing

Tested on Linux, against a self-hosted Gitea (HTTP, non-default port) with a sandbox repo of 30 issues, labels, a milestone, comments and two PRs (one draft):

  • Web client paired to orca serve from this branch: Tasks lists issues and PRs; views, Assigned to me / Created / Closed, refresh and New issue work; the source summary names the owning host.
  • Issue detail loads body, comments, labels and assignees; Start workspace opens the composer with the linked issue, and the created workspace persists linkedWorkItem (provider gitea) and a linkedTaskSourceContext with the Gitea provider identity.
  • Settings: connect a server with URL + token over runtime RPC, the card turns Connected, Test and Disconnect work; Tasks then authenticates with the saved server only (Assigned to me needs the token).
  • pnpm check:changed --base=origin/main: all 46 checks pass on the current head.
  • pnpm tc:node, pnpm tc:web, mobile typecheck and typecheck:tests, verify:rpc-params-catalog and the localization verifiers pass after rebasing on today's main.

Added after the screenshots above and not yet tried by hand against a live Gitea: the PR/issue actions, the CI runs panel, composer search, the reference URLs and the phone list and item page. They are covered by typecheck, lint, the gate, an invariant test for reference-URL attribution, and scratch probes of the CLI resolution, the host matcher, the phone's reply schema and create params, and the Actions client against Gitea- and Forgejo-shaped responses (a server without Actions, a run for another commit, ANSI logs, Forgejo's re-run fallback).

Not tested: macOS, Windows/WSL and SSH-hosted repos by hand (the WSL distro and SSH connection now flow into every Gitea call through the same helpers GitLab uses).

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Kept from #5493 and updated: credential destinations (a saved token never reaches another host, the env token is scoped to ORCA_GITEA_API_BASE_URL, redirects are refused with a token), work-item mappers, server-store identity helpers and the checks mapping. Dropped per the anti-pattern guide: tests that mocked the whole store/IPC or asserted UI behavior.

Performance

None, because the Gitea list only loads while the Gitea source is open, reads selected projects with the same bounded concurrency (6) as GitLab, and caches nothing new; credential reads reuse the shared async file caches.

Risk

Level: Medium

  • Adds a provider to TASK_PROVIDERS, which persisted settings and source contexts read. Unknown providers were already dropped on load, so older clients ignore a saved Gitea source; a revert leaves any saved gitea entries ignored the same way.
  • Pull request reads/creation now also accept a Settings-saved server. Environment variables keep precedence, so existing setups resolve exactly as before; the only behavior change there is that token-carrying requests no longer follow redirects (anonymous reads still do).
  • Older paired servers do not know gitea.* methods, so a new client against an old server shows a load error in the Gitea source; other sources are unaffected.

AI Disclosure

Implemented with Claude Opus 5.5 (Claude Code running inside Orca), directed and reviewed by the PR author. The base is @beatkapo's #5493.

Review

  • Cross-platform: WSL distro and SSH connection flow into every Gitea remote read via GiteaRepoTarget; no new paths, shells or shortcuts.
  • SSH/remote: all Gitea calls are owner-routed runtime RPC methods; the IPC repo lookup checks the owning host like GitLab's, so same-path twins on two hosts stay separate; connect/disconnect over RPC reset the preflight cache like IPC.
  • Agents/integrations: linked Gitea issues reach the composer and AI PR generation; the phone lists Gitea tasks only on hosts that advertise gitea.mobile-tasks.v1, and opens their item page only with gitea.mobile-item-detail.v1.
  • Performance: no hot-path or polling changes.
  • UI: reuses the shared Tasks chrome, project picker and table; the ported sheets now pass the React Compiler, render-path translate, link-open and UI-locale gates.
  • Security: tokens are encrypted at rest with the shared credential caches, never sent to a host other than their own, and never follow redirects.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused — it is not small: it carries feat(tasks): add Gitea and Forgejo task source #5493 forward plus the routing and validation fixes it needed. Happy to split it (task source / Settings + credentials / validators) if that is easier to review.
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred) — lint, typecheck and the affected tests pass via check:changed; the full renderer pnpm build exceeds my build container's memory, so I'm relying on CI for it.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

This change adds Gitea and Forgejo as task sources. It adds server connection and credential storage, repository-scoped issue and pull-request operations, and desktop and web RPC access. The renderer gains Gitea task listings, issue and pull-request workspaces, and connection settings. Shared provider types, schemas, localization, mobile provider filtering, tests, and setup documentation are also updated.

Merge Risk: Low · previous review d0565 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(gitea): Gitea task source (refresh of #5493)" names the main change: adding Gitea as a task source. It follows the conventional-commit style and is specific. It omits the broader crede…
Linked Issues check Passed Directly linked issue [#4703] asks for Gitea as a task source, so users can connect Gitea tasks in Orca. The issue has no other acceptance criteria. The whole-PR summary (merge base 4ccbfc2 to head d0…
Out of Scope Changes check Passed Each changed area maps to the Gitea task source objective of [#4703] or supports it:
- Runtime RPC methods, preload bridge, and web routes let the feature run on paired servers and in the web client.
…
Description check Passed The description follows the repository template closely. It includes ELI5, What Changed, Why, Linked Issue (Fixes #4703 and #49681), Visual Proof with before and after images, Testing with a checklist…
Full details: Title check

Explanation

The title "feat(gitea): Gitea task source (refresh of #5493)" names the main change: adding Gitea as a task source. It follows the conventional-commit style and is specific. It omits the broader credential, routing, and validator work, which the description says is expected from a title.

Full details: Linked Issues check

Explanation

Directly linked issue [#4703] asks for Gitea as a task source, so users can connect Gitea tasks in Orca. The issue has no other acceptance criteria. The whole-PR summary (merge base 4ccbfc2 to head d056557) shows the required behavior:

  • [#4703] gitea is added to TASK_PROVIDERS, and TaskProvider derives from that tuple (src/shared/work-items/task-providers.ts).
  • [#4703] The Tasks page has a Gitea list hook (task-page/gitea/use-task-page-gitea-list.ts), filters and views (task-page/gitea/Filters.tsx), an item list (ItemList.tsx), and issue and PR detail sheets (GiteaIssueWorkspace.tsx, GiteaPullRequestWorkspace.tsx).
  • [#4703] Starting a workspace from a Gitea item is handled in task-page/gitea/Content.tsx, with a Gitea linked-item identity and seed.
  • [#4703] Reads use gitea.* runtime RPC methods (source-control/gitea/gitea.ts) and the web route map (web-gitea-routes.ts), so the source also works on paired servers and in the web client.
  • [#4703] Credentials come from a server store and a Settings connection flow (src/main/gitea/servers/*, gitea-connect-dialog.tsx).
  • Automated tests cover work-item mappers, API URL validation, server-store helpers, the PR resource hook, and checks mapping.
    The issue does not require mobile support. Mobile filters Gitea out, which the issue does not forbid. The evidence is the whole-PR summary and file-level descriptions. No source was read directly in this pass. The ignored file (src/shared/rpc-contract/rpc-params-catalog.generated.ts) is not needed for any requirement, so no requirement depends on it.
Full details: Out of Scope Changes check

Explanation

Each changed area maps to the Gitea task source objective of [#4703] or supports it:

  • Runtime RPC methods, preload bridge, and web routes let the feature run on paired servers and in the web client.
  • Settings credential flow (gitea-connect-dialog.tsx, gitea-connected-servers.tsx, TaskSourceGiteaSetup.tsx) and the server store supply auth for task reads.
  • Provider validators (TASK_PROVIDERS derivation; isTaskProvider in workspace-linked-item.ts, task-source-context.ts, automation params) let Gitea-linked workspaces validate.
  • Shared TaskRepoSourcePicker and TaskFilterChip are extracted from GitLab filters and reused by Gitea. This supports the Gitea UI. The GitLab Filters.tsx change is a refactor with a concrete link to the Gitea UI.
  • PR creation and repository-ref changes (pull-request-creation.ts, repository-ref.ts, hosted-review-creation-provider.ts) reuse the same Gitea credential resolver, so tasks and PRs share one token source. The redirect change for token-carrying PR requests is a behavior change. The PR description states it, and it is tied to the shared credential model.
  • Mobile filtering (mobile-task-providers.ts and related files) keeps Gitea out of screens without Gitea views. This follows from adding the provider to TASK_PROVIDERS.
  • Runtime construction and review-command surface changes wire the Gitea command owner into the existing review surface, which the Gitea runtime methods need.
  • Documentation (docs/reference/gitea-task-source.md) and locale files describe the feature.
    The PR description states that orca reference add (#43931 / #43714) is complementary and not included. No changed area lacks a concrete link to the Gitea task source. Evidence comes from the whole-PR summary. Source was not read directly in this pass, so the verdict rests on file-level descriptions.
Full details: Description check

Explanation

The description follows the repository template closely. It includes ELI5, What Changed, Why, Linked Issue (Fixes #4703 and #49681), Visual Proof with before and after images, Testing with a checklist, Performance ("None, because..." with a reason), Risk with a level and rollback considerations, AI Disclosure, Review, and Notes. Gaps: the Checklist includes unchecked items, notably the pnpm lint/typecheck/test/build item, which the author says is only partly complete because the full renderer build was not run locally. The Risk section names the riskiest parts, but it does not give an explicit revert procedure. Some tested items are listed as not yet tried by hand. The Testing section also says macOS, Windows/WSL, and SSH were not tested. The AI Disclosure section is filled in. The Agent skill upstream boundary section is checked.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4014c5e4-cd98-4e9e-9f81-61e438506fb7
Commits

Reviewing files that changed from the base of the PR and between ed6f27c and d056557.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 9

  • mobile/src/i18n/locales/en.json
  • src/main/ipc/register-core-handlers/register-core-handlers.ts
  • src/main/runtime/rpc/methods/rpc-method-registry.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
Files skipped from review as they are similar to previous changes: 7

  • mobile/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@markelm1
markelm1 force-pushed the feat/gitea-task-source-refresh branch from fb3afd0 to be4fe25 Compare November 24, 2026 23:07

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 8

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Recognize Gitea credential decryption errors. · integration-credential-errors.ts:14

src/shared/secure-storage/integration-credential-errors.ts:14
Minor · Functional Correctness · Quick win

Recognize Gitea credential decryption errors.

The new service type permits credentialDecryptionMessage('Gitea'), but isIntegrationCredentialDecryptionError(new Error(credentialDecryptionMessage('Gitea'))) returns false. The classifier checks only the four existing services.

Add the Gitea message comparison. This recognizes the new service without changing classification for existing services.

Minor comments: 19

src/main/gitea/client.ts: 1

58-58: Minor · Functional Correctness · Quick win

Scan cache keys ignore the request host and can return another server's pull requests.

giteaPullRequestScanKey uses ORCA_GITEA_API_BASE_URL whenever it is set. requestJson does not use that base for every repo. resolveGiteaAuth sends requests to the environment base only when the environment token is set and the host matches, and otherwise uses the repo's stored server or derived base. Two repos with the same owner and name on different hosts therefore share one scan key while requesting different servers. The cache and in-flight lookup in scanGiteaPullRequests use only that key. A repo can then receive another repo's pull request list for up to 30 seconds, and the branch selector can return a matching PR from the wrong server.

Build the scan key from the base URL that requestJson uses, resolveGiteaAuth(repo).apiBaseUrl. Update invalidateGiteaPullRequestScanForRepo to use the same base, because it currently derives its key from the same function.

src/main/gitea/pull-request-creation.ts: 2

180-180: Minor · Security & Privacy · Quick win

Refuse redirects on the token-bearing PR create request.

requestHostedReviewJson sets no redirect option, and this call does not supply one. The create request therefore follows redirects while it sends Authorization: token .... The PR states that token-bearing requests refuse redirects. The Gitea GET and mutation helpers in gitea-request.ts follow that rule. This request does not.

Set the redirect policy on the create request so that it matches the rule for token-bearing requests. Anonymous requests keep the default follow behavior.

Suggested fix

         headers: {
           Accept: 'application/json',
           'Content-Type': 'application/json',
           ...(auth.token ? { Authorization: `***REDACTED_SECRET_ASSIGNMENT***` } : {})
         },
+        redirect: auth.token ? 'error' : 'follow',
         body: JSON.stringify(requestBody)

31-31: Minor · Functional Correctness · Quick win

Forward the WSL Git options into the Gitea authentication lookup.

isProviderAuthenticated receives the execution options for the create request. For gitea, it drops them and calls isGiteaReviewCreationAuthenticated(repoPath, connectionId). That function resolves the repository without the WSL distro hint. For a WSL repository whose path does not name its distribution, the remote probe can fail. The gate then returns false, and creation stops with the Settings authentication message even though the token is configured. UNC repository paths are not affected because they name their distribution.

Pass the options through, as the other Gitea paths do:

Suggested fix

 // src/main/source-control/hosted-review-creation-provider.ts
   if (provider === 'gitea') {
     return isGiteaReviewCreationAuthenticated(
       repoPath,
-      hostedReviewSshConnectionId(executionHostId)
+      hostedReviewSshConnectionId(executionHostId),
+      getHostedReviewLocalGitOptions(options)
     )
   }
 // src/main/gitea/pull-request-creation.ts
-import { getGiteaRepoRef, type GiteaRepoRef } from './repository-ref'
+import { getGiteaRepoRef, type GiteaLocalGitOptions, type GiteaRepoRef } from './repository-ref'
 
 export async function isGiteaReviewCreationAuthenticated(
   repoPath: string,
-  connectionId?: string | null
+  connectionId?: string | null,
+  localGitOptions: GiteaLocalGitOptions = {}
 ): Promise<boolean> {
   if (getEnvGiteaAuth().token) {
     return true
   }
-  const repo = await getGiteaRepoRef(repoPath, connectionId)
+  const repo = await getGiteaRepoRef(repoPath, connectionId, localGitOptions)
   return repo ? (await resolveGiteaAuth(repo)).token !== null : false
 }

Import getHostedReviewLocalGitOptions in the provider file. Its source is hosted-review-git-options.ts, which the provider already uses for its option types.

The change leaves the other cases unchanged. A UNC repository path still selects its own distribution, and a call without WSL options still passes {}. The environment-token short-circuit still returns before the lookup.

src/renderer/src/components/integrations/source-control/gitea-connected-servers.tsx: 1

29-29: Minor · Functional Correctness · Quick win

Show disconnect failures instead of suppressing them.

If giteaDisconnect rejects, this catch hides the failure. The server remains listed, and the component clears its verification results without explaining why removal failed.

Store and display a disconnect error for that server. Clear the error on retry. Keep status reconciliation if the request can fail after partial progress, but do not hide the rejection.

src/renderer/src/components/task-page/gitea/Filters.tsx: 1

114-114: Minor · Functional Correctness · Quick win

Show an error when issue creation rejects.

If createGiteaIssue rejects, this callback exits before toast.error. GiteaNewIssueDialog catches the rejection and converts it to false, so the dialog stays open without an error message.

Catch the rejection here, show an error, and return false. Keep the refresh and true return for successful creation.

src/renderer/src/components/settings/tasks/use-task-source-provider-readiness.ts: 1

62-63: Minor · Functional Correctness · Quick win

Gitea readiness is not tied to the active runtime, so it can keep the previous runtime's connected state.

giteaChecking and giteaConnected (lines 62-63) depend only on giteaStatusLoaded and giteaStatus. Jira and Linear (lines 64-67) also compare a status context key with providerRuntimeContextKey. A runtime switch changes that key, so those providers report checking until they reload. Gitea has no such key, and nothing reloads its status on a switch. After switching from a connected runtime to one without Gitea, this hook can still report Gitea as connected. The status reloads only after a connect, disconnect, or connection test, or when the Gitea integration card mounts.

Store the runtime context key with the Gitea status when it is refreshed. Derive giteaChecking from a mismatch with providerRuntimeContextKey, as the Jira and Linear checks do. A runtime switch must also clear the Gitea status or start a refresh for the new runtime, so the hook does not read the previous runtime's status.

src/renderer/src/components/task-page/gitea/gitea-task-options.ts: 1

30-30: Minor · Functional Correctness · Quick win

Show Closed for a closed draft PR.

For { type: 'pull', state: 'closed', draft: true }, this branch returns Draft. The Type / State column therefore hides that the PR is closed. Require item.state === 'open' for the draft label. Keep the merged-state check first.

src/renderer/src/components/task-page/gitea/use-task-page-gitea-list.ts: 1

191-191: Minor · Functional Correctness · Quick win

Report failures when other repositories return rows.

If repository A returns an issue and repository B fails authentication, this expression returns error: null. The UI shows A's rows without any indication that B failed to load.

Keep the successful rows and expose the repository failure. Suppress expected non-Gitea results separately, rather than suppressing every error when any row exists.

src/renderer/src/components/gitea-item-dialog/GiteaPullRequestWorkspace.tsx: 1

127-129: Minor · Data Integrity & Integration · Quick win

Keep an accepted review-comment write separate from the follow-up refresh.

When prAddReviewComment succeeds, handleAddReviewComment can still return false if the prReviewComments refresh rejects. runGiteaMutation converts that rejection into false. The line composer then keeps the draft, so a second submit posts the same comment again. Gitea creates a new review each time, so the comment is duplicated on the pull request, and the error toast is wrong because the write was accepted.

The callback must return success once the write is accepted, whether or not the refresh succeeds. A refresh failure must not turn an accepted write into a false result, and the composer must clear the draft for that write. The refresh error can still be reported to the user, but it must not be reported as a failed comment.

src/renderer/src/components/gitea-item-dialog/GiteaIssueWorkspace.tsx: 1

110-113: Minor · Functional Correctness · Quick win

Prevent the initial load from reversing a successful state change.

The state button renders for every issue and stays enabled while the initial resources load (GiteaIssueWorkspace.tsx:280-291). Its disabled prop checks only statePending. A state change that completes before Promise.allSettled resolves can be overwritten. The initial-result callback sets closed from the issue read captured before the change (line 113). The header then shows the issue as open after the server has closed it, or the reverse. The callback's guard covers only a changed selection (line 107), not a write made during the load.

The header shows the wrong state until the next refresh. A second click on the button sends the state request again. The window is limited to the time the initial load takes.

Either disable state writes while the initial load is running, or ignore the initial snapshot when a state write completes after the load starts.

src/renderer/src/components/gitea-item-dialog/use-gitea-pr-resources.ts: 1

69-69: Minor · Functional Correctness · Quick win

Keep checks pending until the checks request completes.

When the initial requests finish before prChecks, the detached request remains pending while finally sets loading to false. The Checks tab then receives [] and displays “No status checks reported for this PR.”

Track checks loading separately, or include this request in the loading lifecycle. Show the empty message only after a successful empty response.

docs/reference/gitea-task-source.md: 1

17-18: Minor · Functional Correctness · Quick win

Correct the server URL requirement in the Gitea setup guide.

The guide says HTTPS is required except for loopback HTTP. The URL validator accepts http:// and https:// for any host, and the PR states that plain HTTP self-hosted servers are supported. A user with a LAN server such as http://gitea:3000 will read this text and conclude that the server is unsupported. Replace the requirement with the accepted schemes.

Suggested documentation fix

-Enter the server's web URL and token in Orca. HTTPS is required except for
-loopback HTTP used by local development instances. Non-default HTTPS ports are
+Enter the server's web URL and token in Orca. Orca accepts HTTP and HTTPS server
+URLs. Non-default HTTPS ports are
mobile/src/tasks/screen-state/use-mobile-tasks-runtime-hydration.tsx: 1

112-117: Minor · Functional Correctness · Quick win

Keep mobile task sources non-empty when Gitea is the only saved source.

A saved visibleTaskProviders: ['gitea'] reaches the mobile Tasks hydration path. Desktop Settings can hide every source except one, and Gitea is a valid provider. The shared availability filter treats Gitea as always available, so its github fallback does not run. mobileTaskProviders then removes Gitea and returns an empty list. applyView publishes that empty list. As a result, the mobile provider picker has no options, and the active view resolves to github while github is absent from the visible list. The composer path in use-new-workspace-runtime-context.ts also produces an empty list for this configuration.

After the Gitea exclusion, mobile must keep the visible provider list non-empty. The selected provider must also appear in that list. Apply this requirement to both the hydration path and the composer path.

src/renderer/src/i18n/locales/es.json: 1

8858-8858: Minor · Functional Correctness · Quick win

Keep the provider name as “Gitea”.

giteaLabel contains “casa rural” (“country house”), which does not identify the provider. Replace this value with “Gitea”, consistent with the adjacent setup strings.

src/renderer/src/i18n/locales/zh.json: 1

30422-30422: Minor · Functional Correctness · Quick win

Translate the added-file status as “已添加”.

The shared status-label map uses this value for added files. “额外” means “extra”, not “added”, so the label gives the wrong file-change meaning. Replace it with “已添加”.

src/main/gitea/issues/gitea-work-item-mappers.ts: 1

105-105: Minor · Functional Correctness · Quick win

Keep raw issue and pull request bodies untrimmed.

mapGiteaIssue calls trim() on raw.body. trim() removes leading indentation from the first line. A body such as " example()" then loses the indentation that makes it an indented Markdown code block. GiteaIssue.body is documented as the raw Markdown body, so the mapper should keep the original text. Keep the emptiness check so that blank bodies still map to undefined.

The same expression appears in getGiteaPullRequestDetail at src/main/gitea/pull-request-review-operations.ts:117. Apply the same change there.

Suggested fix

-    body: raw.body?.trim() || undefined,
+    body: raw.body?.trim() ? raw.body : undefined,
src/renderer/src/components/task-page/use-task-page-source-summary.ts: 1

88-88: Minor · Functional Correctness · Quick win

Count unavailable hosts and selected sources in the same unit.

getTaskSourceAvailabilityNotice compares the number of distinct unavailable hosts with sourceCount. Its callers pass the number of selected repositories instead. When two selected repositories use one unavailable host, the helper returns one unavailable host and sourceCount is 2. blocking is then false, and the notice reads "Some Gitea source hosts unavailable", although both repositories are unavailable. The GitHub and GitLab notices in the same hook use the same count, so they have the same issue. The active notice has the same mismatch because it passes taskSourceRepoContexts.length.

Choose one unit and apply it at every call site. Either pass the number of distinct selected hosts, including hosts that are available, or classify availability per repository so that blocking and the wording use the same count.

src/renderer/src/components/gitea-item-dialog/gitea-issue-meta-controls.tsx: 1

37-37: Minor · Functional Correctness · Quick win

Sync the title draft when the loaded title changes.

GiteaIssueMetaControls seeds titleDraft once with useState(title). GiteaIssueWorkspace passes title={detail?.title ?? item?.title ?? ''}. The component mounts with the list title and keeps that draft when the detail title arrives. If the two titles differ, the input shows the stale list title, and the Save button enables. Saving then writes the stale title back over the newer one.

Reinitialize the draft when the loaded title changes, or sync it only while the draft still matches the previous title. Keep an unsaved user edit intact.

src/renderer/src/components/gitea-item-dialog/gitea-pr-file-diff.tsx: 1

138-139: Minor · Stability & Availability · Quick win

Remove the keep flags from the Gitea diff editor.

keepCurrentOriginalModel and keepCurrentModifiedModel tell @monaco-editor/react not to dispose the models on unmount. This component passes no originalModelPath or modifiedModelPath, and no other code disposes these models. Each mount of the Files tab therefore leaves its model pair retained for the renderer session. The sibling diff editors keep their flags only because they also key their models by path and have a disposal owner. This component has neither, and it is read-only, so it needs no retention.

Remove both flags. The library then disposes the models on unmount, as its default behavior does.

Suggested fix

             theme={isDark ? 'vs-dark' : 'vs'}
-            keepCurrentOriginalModel
-            keepCurrentModifiedModel
             options={{
Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8ef8f2af-90d0-4bf9-9ac8-5faed472e872
Commits

Reviewing files that changed from the base of the PR and between 9120306 and fb3afd0.

Files ignored due to path filters: 1

  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 115

  • docs/reference/gitea-task-source.md
  • mobile/src/i18n/locales/en.json
  • mobile/src/new-workspace/creation/runtime/use-new-workspace-runtime-context.ts
  • mobile/src/tasks/mobile-task-providers.ts
  • mobile/src/tasks/screen-state/task-queries.ts
  • mobile/src/tasks/screen-state/use-mobile-tasks-runtime-hydration.tsx
  • mobile/src/tasks/screen/mobile-tasks-screen-chrome.tsx
  • mobile/src/tasks/task-list/mobile-task-view-options.tsx
  • mobile/src/tasks/workspace-creation/mobile-tasks-create-drawers.tsx
  • src/main/gitea/client.ts
  • src/main/gitea/issues/gitea-issues.ts
  • src/main/gitea/issues/gitea-work-item-mappers.test.ts
  • src/main/gitea/issues/gitea-work-item-mappers.ts
  • src/main/gitea/pull-request-creation.ts
  • src/main/gitea/pull-request-review-operations.ts
  • src/main/gitea/repository-ref.ts
  • src/main/gitea/requests/gitea-api-url.test.ts
  • src/main/gitea/requests/gitea-api-url.ts
  • src/main/gitea/requests/gitea-repo-target.ts
  • src/main/gitea/requests/gitea-request.ts
  • src/main/gitea/servers/gitea-server-connection.ts
  • src/main/gitea/servers/gitea-server-store.test.ts
  • src/main/gitea/servers/gitea-server-store.ts
  • src/main/ipc/register-core-handlers/register-core-handlers.ts
  • src/main/ipc/source-control/gitea-pull-request-handlers.ts
  • src/main/ipc/source-control/gitea-repo-access.ts
  • src/main/ipc/source-control/gitea.ts
  • src/main/runtime/construction/runtime-construction.ts
  • src/main/runtime/construction/runtime-repository-command-state.ts
  • src/main/runtime/construction/runtime-review-command-surface.ts
  • src/main/runtime/integrations/gitea/runtime-gitea-commands.ts
  • src/main/runtime/rpc/methods/rpc-method-registry.ts
  • src/main/runtime/rpc/methods/source-control/gitea/gitea.ts
  • src/main/source-control/hosted-review-creation-provider.ts
  • src/main/source-control/pull-request-linked-issue.ts
  • src/preload/api-types.ts
  • src/preload/api/gitea/gitea-api.ts
  • src/preload/api/gitea/gitea.ts
  • src/preload/index.ts
  • src/renderer/src/components/automations/details/automation-source-display.ts
  • src/renderer/src/components/gitea-item-dialog/GiteaIssueWorkspace.tsx
  • src/renderer/src/components/gitea-item-dialog/GiteaPullRequestWorkspace.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-issue-comments.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-issue-meta-controls.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-mutation.ts
  • src/renderer/src/components/gitea-item-dialog/gitea-pr-checks.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-pr-file-diff.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-pr-line-comments.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-pr-merge-button.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-pr-request-scope.ts
  • src/renderer/src/components/gitea-item-dialog/gitea-pr-tab-body.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-status-label.ts
  • src/renderer/src/components/gitea-item-dialog/use-gitea-pr-resources.test.tsx
  • src/renderer/src/components/gitea-item-dialog/use-gitea-pr-resources.ts
  • src/renderer/src/components/icons/GiteaIcon.tsx
  • src/renderer/src/components/integrations/source-control/gitea-connect-dialog.tsx
  • src/renderer/src/components/integrations/source-control/gitea-connected-servers.tsx
  • src/renderer/src/components/integrations/source-control/token-source-control-integration-cards.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/checks-panel-gitea.test.ts
  • src/renderer/src/components/right-sidebar/checks-panel/checks-panel-gitea.ts
  • src/renderer/src/components/settings/tasks/TaskSourceGiteaSetup.tsx
  • src/renderer/src/components/settings/tasks/TasksPane.tsx
  • src/renderer/src/components/settings/tasks/tasks-search.ts
  • src/renderer/src/components/settings/tasks/use-task-source-provider-readiness.ts
  • src/renderer/src/components/task-page/Content.tsx
  • src/renderer/src/components/task-page/ProviderFilters.tsx
  • src/renderer/src/components/task-page/TaskFilterChip.tsx
  • src/renderer/src/components/task-page/TaskPage.tsx
  • src/renderer/src/components/task-page/gitea/Content.tsx
  • src/renderer/src/components/task-page/gitea/Filters.tsx
  • src/renderer/src/components/task-page/gitea/ItemList.tsx
  • src/renderer/src/components/task-page/gitea/NewIssueDialog.tsx
  • src/renderer/src/components/task-page/gitea/gitea-task-options.ts
  • src/renderer/src/components/task-page/gitea/use-task-page-gitea-list.ts
  • src/renderer/src/components/task-page/gitlab/Filters.tsx
  • src/renderer/src/components/task-page/linear/issues/use-task-page-linear-list-selection.ts
  • src/renderer/src/components/task-page/source-selection/TaskRepoSourcePicker.tsx
  • src/renderer/src/components/task-page/source-selection/task-source-context-summary.ts
  • src/renderer/src/components/task-page/task-page-list-chrome-visibility.ts
  • src/renderer/src/components/task-page/task-page-localized-options.tsx
  • src/renderer/src/components/task-page/task-page-source-context.tsx
  • src/renderer/src/components/task-page/use-task-page-composer-actions.ts
  • src/renderer/src/components/task-page/use-task-page-runtime-hosts.ts
  • src/renderer/src/components/task-page/use-task-page-source-availability.ts
  • src/renderer/src/components/task-page/use-task-page-source-summary.ts
  • src/renderer/src/hooks/composer-state/derived-model.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/work-items/task-repo-source-context.ts
  • src/renderer/src/runtime/repository-gitea/gitea-owner-api.ts
  • src/renderer/src/runtime/repository-gitea/runtime-gitea-api.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/slices/gitea/gitea.ts
  • src/renderer/src/store/slices/ui/ui-slice-contract-core.ts
  • src/renderer/src/store/testing/app-store-test-fixture.ts
  • src/renderer/src/store/types.ts
  • src/renderer/src/web/preload-api/gitea/web-gitea-routes.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/gitea/gitea-types.ts
  • src/shared/orcad-migration/orcad-migration-dormant-automation-validation.ts
  • src/shared/rpc-contract/automations/automation-params.ts
  • src/shared/rpc-contract/automations/task-provider-identity-params.ts
  • src/shared/rpc-contract/source-control/gitea-params.ts
  • src/shared/secure-storage/integration-credential-errors.ts
  • src/shared/work-items/task-provider-identity.ts
  • src/shared/work-items/task-providers.ts
  • src/shared/work-items/task-source-context.ts
  • src/shared/workspace-attachments/workspace-linked-item.ts
  • src/shared/workspace-attachments/workspace-reference-identity.ts
  • src/shared/workspace/naming/workspace-name.ts
  • src/shared/worktree/types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/main/gitea/issues/gitea-issues.ts Resolved
@saberone

Copy link
Copy Markdown

Would it be possible to have the usage of the "gt" cli tool as an option?

@markelm1

Copy link
Copy Markdown
Author

Thanks for the review. Addressed in the latest push:

Outside-diff / minor

  • Gitea credential decryption errors are now recognized by isIntegrationCredentialDecryptionError.
  • The PR scan cache key uses the remote's own host, so same-named repos on two servers no longer share a scan.
  • Create PR refuses redirects when it carries a token, and the auth gate gets the WSL distro.
  • Disconnect and New issue failures are shown instead of swallowed.
  • A closed draft PR shows Closed.
  • List errors are shown next to rows from other projects, prefixed with the failing project.
  • An accepted comment or review comment is no longer reported as failed when the follow-up refresh fails (no duplicate review on retry); the refresh failure gets its own message.
  • The issue state button is disabled while the issue loads.
  • Checks show a loading state until the checks request settles.
  • The title draft follows the loaded title unless it was edited.
  • The Gitea diff editor no longer keeps its Monaco models.
  • The setup guide now matches the HTTP/HTTPS policy (and the current Settings/remote behavior).
  • Mobile keeps a non-empty source list when Gitea was the only saved source.
  • Translations: es "casa rural" → Gitea, zh added → 已添加, plus consistent file-status labels in es/fr/ja/zh.
  • Raw issue and PR bodies are no longer trimmed.

Not changed here:

  • Tying Gitea readiness to providerRuntimeContextKey: Gitea server connections are managed on the client's own runtime (window.api.gitea: the desktop, or the server a web client is paired to), not on the provider runtime, so switching that runtime does not change the status the card reads. Routing them by the default host like Jira/Linear would add focus reads, which the focus-read ratchet rejects for new code ("route by the resource's owner"). Repo-scoped calls are already owner-routed via giteaApiFor. The Integrations/Tasks panes now also load the Gitea status on first open, so the readiness no longer depends on the card being mounted.
  • The availability-notice unit mismatch (sourceCount vs distinct hosts) is shared with the GitHub and GitLab notices in use-task-page-source-summary.ts; fixing it for one provider would make them disagree, so it is better as a separate change across all repo-backed sources.

@saberone Orca's Gitea integration talks to the Gitea REST API directly, so it works without a CLI on remote hosts and in the web client. Which gt tool do you mean (a link would help)? A CLI-backed option like GitLab's glab would be a separate design question, and I'd rather keep this PR focused, but I'm happy to look at it as a follow-up.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9b5f27ef-e3ab-4259-b0dc-18763905c357
Commits

Reviewing files that changed from the base of the PR and between be4fe25 and d44b806.

Files selected for processing: 40

  • docs/reference/gitea-task-source.md
  • mobile/src/tasks/mobile-task-providers.ts
  • src/main/gitea/client.ts
  • src/main/gitea/issues/gitea-issues.ts
  • src/main/gitea/issues/gitea-work-item-mappers.ts
  • src/main/gitea/pull-request-creation.ts
  • src/main/gitea/pull-request-files.ts
  • src/main/gitea/pull-request-review-operations.ts
  • src/main/gitea/requests/gitea-api-url.test.ts
  • src/main/gitea/requests/gitea-api-url.ts
  • src/main/gitea/requests/gitea-request.ts
  • src/main/gitea/servers/gitea-server-store.ts
  • src/main/ipc/source-control/gitea-pull-request-handlers.ts
  • src/main/ipc/source-control/gitea.ts
  • src/main/runtime/integrations/gitea/runtime-gitea-commands.ts
  • src/main/source-control/hosted-review-creation-provider.ts
  • src/preload/api/gitea/gitea-api.ts
  • src/renderer/src/components/gitea-item-dialog/GiteaIssueWorkspace.tsx
  • src/renderer/src/components/gitea-item-dialog/GiteaPullRequestWorkspace.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-issue-meta-controls.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-mutation.ts
  • src/renderer/src/components/gitea-item-dialog/gitea-pr-checks.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-pr-file-diff.tsx
  • src/renderer/src/components/gitea-item-dialog/gitea-pr-tab-body.tsx
  • src/renderer/src/components/gitea-item-dialog/use-gitea-pr-resources.test.tsx
  • src/renderer/src/components/gitea-item-dialog/use-gitea-pr-resources.ts
  • src/renderer/src/components/integrations/source-control/gitea-connected-servers.tsx
  • src/renderer/src/components/task-page/gitea/Content.tsx
  • src/renderer/src/components/task-page/gitea/Filters.tsx
  • src/renderer/src/components/task-page/gitea/gitea-task-options.ts
  • src/renderer/src/components/task-page/gitea/use-task-page-gitea-list.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/runtime/hosts/observations/use-integration-provider-status-refresh.ts
  • src/renderer/src/store/slices/gitea/gitea.ts
  • src/shared/rpc-contract/source-control/gitea-params.ts
  • src/shared/secure-storage/integration-credential-errors.ts
Files with no reviewable changes: 1

  • src/renderer/src/components/gitea-item-dialog/gitea-pr-file-diff.tsx
Files skipped from review as they are similar to previous changes: 6

  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/store/slices/gitea/gitea.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread docs/reference/gitea-task-source.md Resolved
Comment thread docs/reference/gitea-task-source.md Resolved
@saberone

Copy link
Copy Markdown

@markelm1 Yes it's a cli tool like "gh" for GitHub. See https://gitea.com/gitea/cli and https://blog.gitea.com/release-of-gitea-cli-2.0.0/

And you're right the "remote use case" is not supported. But the auth a bit more secure.

@markelm1
markelm1 force-pushed the feat/gitea-task-source-refresh branch 3 times, most recently from 596b4a5 to 8f5a119 Compare November 26, 2026 09:17
@elenium3

Copy link
Copy Markdown

Interested in seeing this land: for projects hosted on Gitea, hosted review already works, and Tasks is the missing piece (#4703).

The branch conflicts with main at the moment. Is a rebase planned?

@markelm1
markelm1 force-pushed the feat/gitea-task-source-refresh branch 3 times, most recently from 0212454 to 7b8337f Compare November 27, 2026 10:18
@markelm1

Copy link
Copy Markdown
Author

@elenium3 Thanks! Rebased onto current main today; there are no conflicts now. CI is waiting for a maintainer to approve the workflows (first-time contributor).

@markelm1
markelm1 force-pushed the feat/gitea-task-source-refresh branch 2 times, most recently from 75e5cc2 to 44ebe85 Compare November 29, 2026 09:09
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge with two non-blocking issues in the Gitea detail-to-list flow.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge with two non-blocking issues in the Gitea detail-to-list flow.

Findings

  1. P2 Failed reads look empty ▶
  2. P2 Saved changes leave old rows ▶

Summary

Adds Gitea and Forgejo Tasks across desktop, web, and mobile, with saved credentials, issue and PR actions, workspace links, and composer search.

  • Gitea issues and pull requests appear in Tasks with details and actions.
  • Gitea calls use saved server connections and reach the host that owns each repository.
  • Gitea issues can seed workspaces and become workspace references.
  • Phones can list Gitea tasks and start linked workspaces.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  C[Desktop, web, or phone] --> R[Choose repository owner]
  R --> H[Owning Orca host]
  H --> A[Resolve Gitea credentials]
  A --> G[Gitea or Forgejo API]
  G --> T[Tasks and detail sheets]
  T --> W[Create linked workspace]
Loading

Reviews (6) · Last reviewed commit: "feat(gitea): show Actions runs on PRs an..." · Reviewed by Greptile

Comment thread src/main/gitea/client.ts Resolved
Comment thread src/main/gitea/issues/gitea-issues.ts Resolved
@markelm1
markelm1 force-pushed the feat/gitea-task-source-refresh branch from 44ebe85 to 5e6ceae Compare November 29, 2026 16:26
Comment thread src/main/gitea/pull-request-creation.ts Resolved
Comment thread src/cli/references/reference.ts Resolved
markelm1 and others added 29 commits December 1, 2026 09:02
Several validators still listed providers by hand, so every Gitea task
source context normalized to null and creating a workspace from a Gitea
issue failed with "Invalid linked work item". They now read the one
TASK_PROVIDERS tuple, and TaskProvider derives from it so a new
provider cannot be missed again: source contexts, linked work items,
automation source contexts and the dormant-automation migration check.

A workspace linked to a Gitea issue also feeds that issue to AI pull
request generation, like GitHub and GitLab.

Co-authored-by: fgo <[email protected]>
Pull request reads, creation and the review-provider status now resolve
Gitea credentials through the same path as the task source:
ORCA_GITEA_TOKEN / ORCA_GITEA_API_BASE_URL first, unchanged, then a
server saved in Settings for the remote's host. Previously a server
connected in Settings listed issues but could not create or read pull
requests. Create PR now checks the token for the repo's own host, and
its auth hint names both ways to connect.

Requests that carry a token refuse redirects; anonymous reads keep
following them as before.

Co-authored-by: fgo <[email protected]>
Settings showed two Gitea cards sharing one DOM id: the review-provider
card and a task-provider card. GitLab has a single card for both, so the
server list (test, disconnect) and the Connect/Add server action move
into the review-provider card, which now has its own file like
Bitbucket's. The Tasks setup "Manage servers" step opens that card.

Connecting or disconnecting over runtime RPC resets the preflight cache
like the desktop IPC path, so a paired client sees the card update.

Co-authored-by: fgo <[email protected]>
…gates

The stablyai#5493 detail sheets predate several ratchets on main:
- move try/finally and throw-in-try out of components into a shared
  runGiteaMutation helper so React Compiler can optimize them
- translate through useTranslate() during render
- open web links with openAppHttpLink
- format comment times in the UI language
- route the IPC repo lookup through getRepoRoutingConnectionId
- load the task list through useEffectEvent instead of a lint suppression

The Gitea card stays in the token-provider cards file, drop the mocked
IPC e2e spec, and the catalogs drop the keys of removed copy.

Co-authored-by: fgo <[email protected]>
Mobile reads the same visible task providers as the desktop, so the new
Gitea provider would show a source the phone cannot list yet. The tasks
screen and the new-workspace composer now drop it, and the exhaustive
provider maps gain a Gitea entry so the phone still typechecks.
The Gitea icon was the brand-colored SVG asset, so it stood out in green
next to the monochrome GitHub, GitLab, Linear and Jira marks. It is now
an inline currentColor glyph like JiraIcon, so it follows the text color
in both themes, and the asset is gone.
- Credentials: one host-matching rule for the environment token and
  saved servers (an SSH remote matches its server by hostname),
  anonymous reads honor ORCA_GITEA_API_BASE_URL for its own host, the
  PR scan cache is keyed by the remote's host, PR creation refuses
  redirects with a token and passes the WSL distro to its auth gate,
  and Gitea decryption errors are recognized.
- Reads: assigned/created searches and PR files page until an empty
  page (Gitea caps pages at 50), the Issues/PRs views request each type
  so issues cannot crowd PRs out, diffs start at the PR merge base, and
  issue/PR bodies keep their leading indentation.
- Writes: an empty successful merge body is a success, and an accepted
  comment or review comment is no longer reported as failed when the
  follow-up refresh fails (a retry would post a duplicate review).
- UI: rows match their repo by id and host, list errors name the
  failing project beside other rows, closed drafts show Closed, checks
  show a loading state, the state button waits for the initial load,
  the title draft follows the loaded title, create/disconnect failures
  are shown, and the diff editor no longer keeps its Monaco models.
  Settings loads the Gitea status on first open.
- Mobile keeps a non-empty source list when Gitea was the only one.
- Translations and the setup guide are corrected.

The PR file listing moves to its own module to stay under the line
budget.

Co-authored-by: fgo <[email protected]>
- Back-to-back comments and review comments start overlapping refreshes;
  only the newest read may replace a list, so an older answer that
  resolves last can no longer drop a newer comment.
- Overlapping Gitea status reads apply in order.
- The Files tab says how many of the PR's changed files it shows when the
  1,000-file read limit cuts the list.
- The setup guide warns that plain HTTP exposes the token unless the
  network or a tunnel protects it, and that ORCA_GITEA_TOKEN without
  ORCA_GITEA_API_BASE_URL goes to any open repository's Gitea host.

Co-authored-by: fgo <[email protected]>
The Linear list selection now runs after the Gitea list stage, so its
test model takes that stage's type.
A bracketed IPv6 host such as [::1] contains colons but names no port,
so an SSH remote on [::1] now matches an API base on [::1]:3000 like a
named host does.
Main now registers forge IPC channels and runtime commands up front but
imports their modules only on the first call (stablyai#50592). The Gitea task
source joins that: its 19 IPC channels go through
registerLazyIpcHandleGroup, and LazyRuntimeGiteaCommands imports the
runtime commands on the first RPC, so startup no longer evaluates the
Gitea client.
Main now ratchets top-level Zod schemas to zero, since an eager schema
keeps its objects and closures on the heap from module load. The Gitea
RPC params and the saved-server schema now go through lazyZodSchema,
like the GitLab params.
Main now routes non-core RPC namespaces through prefix groups; give gitea.* one next to gitlab.*.
Match GitLab after stablyai#50486: rail header with the repository scope, view tabs, refresh and New actions, filters in a popover, and rail row gutters in the list. Drop TaskRepoSourcePicker now that TaskPageRepositoryScope covers it, and show the remote host context for Gitea like the other repo-backed sources.
Two installations served from subpaths of one host (git.example/one and
git.example/two) matched the first saved server by host, so a repository
could be read or changed with the other installation's API and token, and
their same-named repositories shared one cached PR scan. Saved servers now
match the remote's own API base first, and the PR scan is keyed by it.
Gitea caps each page at 50 labels by default, so the label picker dropped
the rest on larger repositories. Labels are now read page by page.
A failed or timed-out base/head read came back as an empty string, so the
Files tab showed a blank or false diff instead of its error and Retry. Only
an added or deleted side is empty now; other failed reads reject.

Each file diff also waits until it is near the visible area before it
reads both sides and builds its Monaco editor, so opening a large PR no
longer starts every read and editor at once.
If the issue read failed but the assignee list loaded, the picker treated
the current assignees as empty, so one click sent just that user and
removed everyone already assigned. Assignee edits now wait for the
issue's real assignees, like label edits already wait for its labels.
Any ORCA_GITEA_TOKEN made creation look authenticated, even when
ORCA_GITEA_API_BASE_URL scopes it to another host. A public repository
on that other host could then prepare a pull request whose POST went out
without a token and failed. The gate now asks the same resolver the
request uses.
Review comments came from the first page of reviews only, and a failed
read of one review's comments was dropped, so those comments vanished from
the Files tab without an error. Reviews are now read page by page and a
failed comment read rejects, so the dialog reports it.

PR files, labels and reviews share one paged reader instead of three
loops.
de, pt, ru, tr and zh-Hant had none of the Gitea task source strings, and
es, fr, ja, ko and zh were missing 14 of them, so those users saw English.
Terms follow each locale's existing GitHub and GitLab wording.
`orca worktree create --reference` and `orca reference add` rejected a
self-hosted Gitea issue URL as unsupported, because /owner/repo/issues/N
looks the same on GitHub Enterprise (stablyai#49681). The CLI now asks
the Orca host whether the URL belongs to a Gitea server it knows (one
connected in Settings, or ORCA_GITEA_API_BASE_URL) and records it as a
Gitea issue. The new gitea.matchReferenceUrl method returns only a yes or
no; older hosts keep the previous error. Installs under a subpath parse for
Gitea only, and the workspace link editor gains a "Gitea issue" kind.
The Gitea PR sheet could only comment and merge. It can now edit the
title and description, close and reopen the PR, mark a WIP draft ready by
dropping its prefix, and submit a review that approves, requests changes
or comments. Issues gain description editing through the same inline
editor, which replaces the two read-only description blocks.

New gitea.prUpdate and gitea.prSubmitReview calls go through IPC, the
runtime RPC and the web client like the other Gitea calls.
The phone hid Gitea because it had no Gitea task views and could not call
gitea.listWorkItems. Tasks on the phone now lists Gitea issues and pull
requests per repository, with the desktop's All / Issues / PRs views and
Open / Assigned to me / Created / Closed filters, and tapping a row starts
a workspace linked to that item.

Phones may now call gitea.listWorkItems, routed to the repo's host like
the GitHub and GitLab reads, and the host advertises
gitea.mobile-tasks.v1 so older hosts keep Gitea off the phone. GitLab and
Gitea share one per-repo reader for concurrency and partial failures.
Issue and PR details stay on the desktop for now.
…etail refreshes

- The CLI now sends a Gitea PR URL under a subpath to the host for
  attribution, not only issue URLs.
- orca reference remove matches Gitea URLs against the saved links, so
  they stay removable after the server is disconnected.
- PR and issue detail refreshes are awaited and ordered: an older read
  can no longer restore a stale title, body or state, or undo a merge.
Tapping a Gitea task now opens the shared item page: title, state,
author, description, labels and assignees for issues, commit statuses
for PRs, and the discussion with a comment box. The ⋯ menu closes or
reopens the item. The page needs a host that advertises
gitea.mobile-item-detail.v1; older hosts keep sending the tap to the
workspace form.
- The PR Checks tab lists the Actions workflow runs for the head commit,
  for both Gitea and Forgejo. Expanding a job shows its log, and a job
  or a whole run can be re-run. Commit statuses that a listed run
  already covers are hidden. Servers without the Actions API show the
  commit statuses only, as before.
- The new-workspace composer gets a Gitea tab for repos on a connected
  server. It searches open issues and PRs by keyword (Gitea's q=) and
  links the picked item to the new workspace.
A failed files, comments or line-comments read left its list empty, so
the sheet said "No changed files" or "No comments yet." Each read now
keeps its own failure and shows a Retry in place of the empty state.
Closing an issue or PR sheet after an edit, close or merge kept the old
rows until Refresh. Accepted writes now mark the list stale, and leaving
the sheet reloads it.
@markelm1
markelm1 force-pushed the feat/gitea-task-source-refresh branch from 64bdd1a to 59d474e Compare December 1, 2026 09:06

This branch has not been deployed

No deployments
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.

[Feature]: Support Gitea issue URLs as workspace references [Feature]: Gitea task sources

3 participants