Skip to content

The code index reads merged-PR history from a Forgejo host - #1711

Merged
zlareb1 merged 12 commits into
ClickHouse:mainfrom
KaloyanNaumov:pr/forgejo-pr-history
Dec 2, 2026
Merged

zlareb1 merged 12 commits into
ClickHouse:mainfrom
KaloyanNaumov:pr/forgejo-pr-history

Conversation

@KaloyanNaumov

@KaloyanNaumov KaloyanNaumov commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #1682

TL;DR: A repository entry with "forge": "forgejo" now gets merged-PR history from its Forgejo host's REST API, written to code_pr_history like the GitHub source. Review comments, the issue mirror and open-PR heads stay GitHub-only.

Changelog category (leave one):

  • New Feature

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

A code-index entry with "forge": "forgejo" reads merged-PR history from its Forgejo host, in the worker and in loom code backfill-prs. PR links for such a repository point at the /pulls/N page on the host and port of its remote.

Why

The code_pr_history worker skips every repository whose host is not GitHub, so a team that hosts its code on Forgejo gets no PR history and loses the ranking and symbol context it feeds (issue 1682).

Scope and risk

  • server/clients/forgejo.py reads closed PRs and their files over Forgejo's REST API and returns the GitHub client's MergedPR, raising its errors, so the worker keeps one stop-and-keep-the-cursor path. It uses the shared HTTP client, or, when LOOM_CODE_GIT_CA_FILE is set, a pooled client that verifies the host against that bundle in place of the default roots, as git does.
  • RepoConfig.forge ("forgejo" or empty) and RepoConfig.pr_source choose the source. An entry without forge behaves as before: GitHub entries read GitHub, every other host is skipped with the same note, and the GitHub-only backfills (backfill-reviews, backfill-items, backfill-assignees) now refuse it too.
  • The API has no target-branch filter and no merged-date search. The branch is matched on each PR's base.ref.
  • The worker finds the page of the closed-PR list (newest update first) that holds its pr_cursor, by doubling and bisecting, then reads upward from it, oldest update first, until it has 40 PRs merged into the branch, plus any updated in the same second as the 40th, or reaches the newest page. A page counts only once the page below it, read again, is unchanged, so a PR reopened or updated during the walk cannot slip across a page edge unread; a PR updated in the newest second read waits for the next page. The cursor is the newest updated_at written, and a list request that fails after some pages keeps the PRs those pages settled, so the cursor still moves. A first pass therefore starts at the oldest PR of the LOOM_CODE_PR_BACKFILL_MONTHS window and reaches the present over several passes. A pass costs two list requests per page plus a few to find the cursor's page.
  • backfill-prs walks closed PRs newest close first back to LOOM_CODE_PR_BACKFILL_MONTHS and resumes after the close time of the last PR it read (pr_backfill_closed). After each new page it reads the page above again; if that page changed (a PR above was reopened, which moves the first PR of the new page up across the edge, or a PR was closed), it goes over the new read of that page, skipping the PRs it already has, before it goes on. That costs one more list request per page. The check compares the page above with its first read: a PR reopened above it and another closed between the two reads of one step put that page back as it was and can still hide the PR at the edge, as can more than a page of PRs reopened between two requests. A finished walk starts over at page 1 on the next run and reads it. The saved page (pr_backfill_page) is only where to look: a resume steps back while the page is empty or starts at or past the saved close time, and skips the PRs closed after it. A PR closed in the same second as that boundary is read again, as the same row; --max-prs should exceed the number of PRs closed in one second.
  • Left alone: review comments, the issue mirror and open-PR heads. The worker and the backfill-reviews, backfill-items and backfill-assignees commands run them for GitHub entries only. The Repositories page does not set forge, so only LOOM_CODE_REPOS_JSON entries use it.
  • Risk: the new code runs only for an entry that sets forge. The two places that built a GitHub PR link now call pr_web_url, which returns the same link for an owner/name repository; for a Forgejo entry it builds the link from the entry's git_remote, as the API URL is, so a host on a port other than 443 keeps it.

Compatibility, rollout and rollback

  • Wire: none. loom code backfill-prs help text changes.
  • Operator steps: none for existing entries. To use the source, set "forge": "forgejo" and an HTTPS or SSH git_remote on the entry, with repo as host/owner/name (no port: it is the repository's identity in the registry); PR links and API calls use the host and HTTPS port of git_remote. github_token is then the host's access token. LOOM_CODE_GITHUB_TOKEN is never sent to a Forgejo host: an entry that names no token reads anonymously. A Forgejo host under a private certificate authority needs LOOM_CODE_GIT_CA_FILE, the bundle git already uses; with the setting set, the bundle must vouch for the Forgejo host, an SSH git_remote included.
  • Forgejo version: the worker uses sort=recentupdate, which every Forgejo has. backfill-prs uses sort=recentclose, which Forgejo has from 12.0; 11.0 and earlier ignore it and answer in creation order, so the backfill needs Forgejo 12 or later (the supported lines are 15.0 and 17.0). The docs say so.
  • Rollback: reverting leaves the written code_pr_history rows and the pr_backfill_page and pr_backfill_closed state keys in place; nothing reads them differently.

Tests

tests/unit/test_forgejo_pr_source.py replays recorded Forgejo API responses (tests/unit/fixtures/forgejo_pull_requests.json) through the client, the worker and the backfill: a closed-PR page by sort=recentupdate for the worker, a closed-PR page by sort=recentclose (recorded from a Forgejo 17 server) for the backfill, and one PR's file list; the other PRs' file lists are replayed as empty. It covers source selection, the API and web URLs, the cursor, a worker pass whose cursor sits behind ten pages of another branch's PRs (the PR behind them is written and the cursor does not pass it; a PR budget keeps the oldest and the PRs updated in the same second as the last one kept), a PR reopened between two pages of a pass (the PR that moved up is read by the two passes together), a PR added at the top during a pass (the page read again shows the PR it pushed down), a refused request mid-walk (the settled pages are returned and the next pass goes on), paging, a backfill resumed after a closed, unmerged PR on its last page is reopened (the PR that moved up into that page is read), a PR reopened within one backfill call (the call returns the PR that moved up and does not end early), a PR closed during a backfill call (no PR is returned twice), a resume at a page the shrunk list no longer has, a resume whose boundary second ties across a page edge after a reopen, a remote on port 8443 (the API URL and the PR link in the blame evidence keep the port), the branch filter, UTC timestamps, the error mapping, and that an entry with "forge": "forgejo" carries no GitHub token into the config or the request, and that the three GitHub-only backfill commands send nothing for a Forgejo entry. Without the change the file fails at import. The GitHub path is covered by the existing PR-history, GitHub client and repository-config tests, which pass unchanged, except the stand-in repository entries of one PR-history test and three blame and bisect tests, which gain the attributes the code now reads (pr_source; forge and git_remote). Ruff, every --check codegen script and make format-check's Prettier (3.9.9) on the changed docs are clean; the mypy gate's one error, in delta_file.py, is on main as well and not in this PR.

tests/unit/test_forgejo_ca_file.py serves a Forgejo list over TLS from a generated authority: it is read with that authority's bundle as LOOM_CODE_GIT_CA_FILE, refused with no bundle or another authority's, and an unreadable bundle is a GitHubError.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. I checked the diff against the Forgejo API responses recorded in the fixture and ran the tests and gates listed above.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.
  • I signed the Contributor License Agreement (CLA) if CLA assistant requested a signature.

Note

Medium Risk
New external API integration with complex pagination and resume logic, but changes are gated on explicit forge: forgejo entries and do not alter the default GitHub path.

Overview
Adds Forgejo as an optional merged-PR history source for code-index entries with "forge": "forgejo", so code_pr_history and loom code backfill-prs work for self-hosted Forgejo the way they already do for GitHub.

A new Forgejo REST client reuses GitHub’s MergedPR shape and error handling; the code_pr_history worker and CLI branch on RepoConfig.pr_source. Forgejo has no branch or merged-date filters, so the worker walks closed PRs by recentupdate with page-edge consistency checks, and backfill walks by recentclose (Forgejo 12+) with resumable pr_backfill_page / pr_backfill_closed cursors. Review backfills, issue mirror, and open-PR heads stay GitHub-only; Forgejo entries do not inherit LOOM_CODE_GITHUB_TOKEN. PR links in blame and bisect use pr_web_url from git_remote and forge type. LOOM_CODE_GIT_CA_FILE also trusts the Forgejo REST host via pooled get_ca_client httpx clients.

Docs, settings schema, and CLI help are updated; unit tests replay recorded Forgejo API fixtures including pagination, resume, and CA verification.

Reviewed by Cursor Bugbot for commit c725e54. Bugbot is set up for automated code reviews on this repo. Configure here.

A repository entry with "forge": "forgejo" gets its merged PRs, with their changed
files, from the host's REST API into code_pr_history, in the code_pr_history worker
and in `loom code backfill-prs`. The API has no target-branch filter and no
merged-date search, so the branch is matched on each PR's base ref and the backfill
walks closed PRs newest close first (sort=recentclose, Forgejo 12 or later),
resuming at the page it stopped at. A page cut by the PR budget is read whole, so a
resume never repeats a PR.

The deployment's GitHub token is never sent to a Forgejo host: an entry reads with
its own github_token, or anonymously.

Review comments, the issue mirror and open-PR heads stay GitHub-only. PR links for a
Forgejo repository point at the host's /pulls/N page.

Closes issue 1682

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Dec 2, 2026 2:58am UTC
loom-telemetry Ready Ready Preview Dec 2, 2026 2:58am UTC

Request Review

@cursor cursor 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.

Stale Bugbot comment from a previous run.

Comment thread server/clients/forgejo.py Resolved
@zlareb1 zlareb1 self-assigned this Nov 28, 2026

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The Forgejo backfill can omit a pull request when the closed list changes between pages. The incremental cursor finding also applies: the worker advances its timestamp before the bounded walk reaches the old cursor.

Comment thread server/cli/code_prs.py Resolved

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The format job fails on the adoption page with the same formatter output on clean main. The pinned Biome check passes with the tracked repair. Failed job · Repair #1706

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The rename report integration test fails at the same assertion on this head and on clean main. The tagged fixture describes a naming claim, so the planner returns about_naming. The same test passes with the fixture repair. PR job · Main job · Repair #1719

The saved page is an offset into the closed list, which moves: a reopened PR leaves
it and the later ones move up a page, so a resume at the saved page skipped the PR
that moved onto the page before. The backfill keeps the close time of the last PR it
read (pr_backfill_closed) beside the page. A resume steps back from the page while it
is empty or starts at or past that close time and skips the PRs closed after it. A PR
closed in the same second as that close time is read again, as the same row. Within
one call the paging is still an offset into a list that can change between two
requests, so a PR reopened while one call reads pages can be missed by that call; a
later run reads it once it is closed again.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The list has no branch filter, so ten pages of other branches' PRs could end the walk
before the cursor while a PR merged into the tracked branch sat behind them; the
cursor then moved to the newest PR read and the one behind was never fetched. The walk
reads list pages until the cursor and returns the oldest max_prs of the PRs merged
into the branch, plus any updated in the same second as the last of them. The cursor
is the newest updated_at returned. The paging is an offset into a list that can change
between two requests, so a PR reopened while one walk reads pages can be missed by
that walk; a later run reads it once it is closed again.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
@KaloyanNaumov

Copy link
Copy Markdown
Contributor Author

Both are fixed on the new head:

  • Backfill resume across a reopen: 4e8a48d, in the thread.
  • Worker cursor moving before the walk reaches it: 2c9c4fa, in the thread.

The format job and the rename report test fail the same way on main; #1706 and #1719 repair them, so this PR does not touch either.

@cursor cursor 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.

Stale Bugbot comment from a previous run.

Comment thread server/clients/forgejo.py Resolved

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The resume tests cover a reopen between backfill batches. The incremental worker can still advance past a merged PR when a reopen shifts a page during the walk. The deadline finding also applies to the unbounded scan.

Comment thread server/clients/forgejo.py Resolved

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The unit job reports the same coverage row limit and docstring cap failures as clean main. The same check passes locally with both repairs applied. Failed job · Coverage repair · Docstring repair

The worker walk read the closed-PR list newest first down to its cursor and
saved the newest PR of the oldest slice. A PR reopened between two page
requests moved a different PR onto a page already read, so the cursor could
pass a merged PR for good, and a rate limit or deadline anywhere in a long
walk left the cursor where it was.

The walk now finds the page that holds the cursor by doubling and bisecting,
then reads upward from it, oldest update first. A page counts only once the
page below it, read again, is unchanged, and a PR updated in the newest
second read waits for the next page, so the cursor never passes a PR that has
not been read. A failed request after some pages returns the PRs those pages
settled, and the next pass goes on from there.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
@KaloyanNaumov

Copy link
Copy Markdown
Contributor Author

Both are addressed on e3a8650, in the threads: the worker reads oldest first from the cursor's page and settles each page against a second read of the page below it. The backfill is unchanged. The format and unit failures are main's, repaired by #1706 and #1722.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The incremental reopen regression and the resume-between-batches regression pass. Within a single backfill batch, reopening a closed PR can still drop a different PR. Evidence links also lose the configured HTTPS port.

Comment thread server/clients/forgejo.py Resolved
Comment thread server/code/domain/index/remote.py Resolved

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The conflict resolver's attestation test fails at the same superseder assertion on this CI merge and on clean main with ClickHouse 26.11.5.8. Repair #1781 keeps the timestamp assertion at equal standing and tests the lower-standing refusal separately. The integration shard passes on the repair. PR job · Main job · Repair · Passing shard

Within one backfill call, a PR reopened after a page was read moved the
first PR of the next page onto the page already read, so the call could
skip a merged PR and still report the walk complete. After each new page
the walk now reads the page above it again. If that page changed, the
walk reads it again before going on, and skips the PRs it already has, so
a PR closed during the call is not returned twice either.

PR links for a Forgejo entry were built from the configured `repo`, which
has no port, so a host served on 8443 got links on 443. They are now built
from the entry's remote, as the API URL is, port included.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The check compares the page above with its first read. A PR reopened above it and
another closed between the two reads of one step put that page back as it was, so
the PR at the edge can still be missed, as can a shift of more than a page between
two requests. A finished walk starts over at page 1 on the next run and reads it.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

GitHub reports a merge conflict with main in docs/features/code-index/history-and-prs.md. Please resolve it so CI can check the combined tree.

zlareb1
zlareb1 previously approved these changes Nov 30, 2026

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The Forgejo backfill recovers the row moved across a page boundary by a reopen. Blame and bisect links keep the HTTPS port. The 74 focused Forgejo, blame, and bisect tests passed.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

GitHub reports merge conflicts with main in docs/features/code-index/history-and-prs.md and docs/operations/code-index-operations.md. Please resolve both so CI can test the combined tree.

Two doc conflicts, both kept on both sides:

- docs/features/code-index/history-and-prs.md: main's "History stays inside
  the indexed head" subsection stays under "The PR plane"; the "Forgejo
  hosts" section follows it.
- docs/operations/code-index-operations.md: the `repo` row keeps the
  `host/owner/name` form for Forgejo; the `git_dir`, `git_remote` row takes
  main's wording about entries that share a clone.

main's clone-ownership check added two statements to _configured_from_env,
which with the `forge` statement passed the 50-statement limit. The forge
spelling moves to _entry_forge, so the function is back at 50.

Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
@KaloyanNaumov

Copy link
Copy Markdown
Contributor Author

Merged main (ab52fee) into the branch with 0dd4cdd; the approved commits are unchanged, so there is no force-push.

  • docs/features/code-index/history-and-prs.md: main's "History stays inside the indexed head" subsection stays under "The PR plane", and "Forgejo hosts" follows it as its own section.
  • docs/operations/code-index-operations.md: the repo row keeps host/owner/name for a Forgejo host, and the git_dir, git_remote row takes main's wording about entries that share a clone.

Main's clone-ownership check added two statements to _configured_from_env, which with the forge statement passed the 50-statement function-length limit. The forge spelling now lives in _entry_forge; behaviour is unchanged.

On the merged tree the Forgejo, blame, bisect, history, doc-link and public-copy tests pass (580 passed, 10 skipped), and so do ruff, the function-length gate, the secret gate, Prettier on both docs and the SDK, settings, skills, plugin and reference codegen --check scripts.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 0dd4cdd. Configure here.

Comment thread server/clients/forgejo.py Resolved

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I reproduced the private CA finding against a local HTTPS endpoint. With the server CA configured as LOOM_CODE_GIT_CA_FILE, the Forgejo request fails certificate verification. The same endpoint responds when the client uses that bundle. Use the configured CA for Forgejo HTTPS and preserve certificate verification.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The type gate rejects the streamed SCIP header adapter's dynamic annotation. The same error reproduces on clean main. Repair #1915 uses the model field annotation and keeps the header bounds.

test_no_new_tunable_constant flagged server/clients/forgejo.py::_ATTEMPTS, a
numeric constant named like a retry count. It bounds the re-reads of one page
while the closed-PR list moves under the walk, a consistency retry rather than
an operator knob. The CLI's _LIST_ATTEMPTS in server/cli/okf.py is the same
shape and carries the same marker, so this follows it instead of adding a
setting.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
@KaloyanNaumov

Copy link
Copy Markdown
Contributor Author

tests/unit/test_tunable_constants.py::test_no_new_tunable_constant fails on the head: server/clients/forgejo.py::_ATTEMPTS is a numeric constant named like a retry count. It bounds the re-reads of one page while the closed-PR list moves under the walk, a consistency retry and not an operator knob, so it is not a setting. da4507b marks it # not a setting: ..., the form _LIST_ATTEMPTS in server/cli/okf.py already uses for the same kind of retry; no setting, no allow-list entry. The test, the Forgejo and PR-history unit tests, ruff, format and the function-length gate pass on it.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This head marks the page-consistency retry as a fixed constant. The private CA failure still applies. The HTTPS request still uses the shared client without LOOM_CODE_GIT_CA_FILE; the previous local comparison isolated certificate verification to that missing bundle.

KaloyanNaumov and others added 2 commits December 1, 2026 21:03
The Forgejo REST client went through the shared httpx client, which trusts only
the default roots. A Forgejo host under a private authority, which git already
reaches through LOOM_CODE_GIT_CA_FILE, failed every list and files request with
CERTIFICATE_VERIFY_FAILED, so the worker and backfill-prs wrote no PR history.

The client now takes its trust from the same setting: get_ca_client builds a
pooled client whose SSL context loads that bundle in place of the default roots,
as git's http.sslCAInfo does, and an unset bundle keeps the shared client. A
bundle that cannot be read is a GitHubError, so the worker's stop-and-keep-the-
cursor path handles it. No new setting; the setting's description and the
operations page now name the Forgejo client.

The new test serves a Forgejo list over TLS from a generated authority: it is
read with that bundle, refused with no bundle or another authority's, and an
unreadable bundle is a GitHubError.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
@KaloyanNaumov

Copy link
Copy Markdown
Contributor Author

The private CA finding is fixed in 4a90139. The Forgejo REST client now verifies the host against LOOM_CODE_GIT_CA_FILE, the bundle git uses for HTTPS remotes, in place of the default roots, and keeps the shared client when it is unset. server/clients/_http.py::get_ca_client builds one pooled client per bundle from ssl.create_default_context(cafile=...), so certificate verification stays on. A bundle that cannot be read is a GitHubError that names the setting and the path, which the worker already treats as stop-and-keep-the-cursor. No new setting; the setting's description, docs/reference/configuration.md and the operations page now name the Forgejo client, and the operations page says the bundle must vouch for the Forgejo host when its git_remote is SSH too.

tests/unit/test_forgejo_ca_file.py serves a Forgejo list over TLS from a generated authority. Before the change the request failed with CERTIFICATE_VERIFY_FAILED, as in your local comparison. After it, the list is read with the authority's bundle and refused with no bundle or another authority's, and the unreadable-bundle test asserts the message.

The constant marker on _ATTEMPTS is unchanged. main is merged in without conflicts. The new test, the Forgejo, PR-history, redirect and gateway tests, test_tunable_constants.py, ruff, format, mypy on the touched modules, the function-length gate and the settings generators pass.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Forgejo REST requests verify the configured Git CA bundle and refuse certificates outside it. All 88 focused client, worker, and history tests passed.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The exception-text gate fails on the reviewed head and passes on clean main. Failed unit job

Comment thread server/clients/forgejo.py Resolved
The GitHubError raised when LOOM_CODE_GIT_CA_FILE cannot be read carried
the configured path and the OS error text, and the history worker records
that message in its result. It now names only the setting; the path and
the OS error go to a warning on loom.clients.forgejo. The exception-text
ratchet fails on the previous head and passes with this change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
zlareb1
zlareb1 previously approved these changes Dec 2, 2026

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No code findings on this head. The CA-bundle error now returns fixed text, and the detailed error stays in the operator log. The earlier client, worker, and history review still applies.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

GitHub reports merge conflicts with main in docs/reference/status.md and tests/unit/snapshots/cli_help.json. Please resolve both so CI can test the combined tree.

Conflicts in docs/reference/status.md and
tests/unit/snapshots/cli_help.json came from main's wording changes
next to our PR-history and CA-bundle changes. Both files are regenerated,
not hand-edited: docs/reference/status.md with
scripts/codegen/docs_reference.py, cli_help.json with
LOOM_UPDATE_CLI_SNAPSHOT=1 on test_cli_surface_snapshot.py.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
@KaloyanNaumov

Copy link
Copy Markdown
Contributor Author

Merged current main (67fdb36) into the branch; no rebase.
Both files are regenerated, not hand-edited: status.md by scripts/codegen/docs_reference.py, and cli_help.json by LOOM_UPDATE_CLI_SNAPSHOT=1 on test_cli_surface_snapshot.py.

@zlareb1 zlareb1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The conflict resolution preserves the Forgejo client and history changes. The status reference and CLI snapshots include the combined wording. All 40 focused history, CA bundle and CLI snapshot tests passed.

@zlareb1
zlareb1 merged commit 6472a9e into ClickHouse:main Dec 2, 2026
77 of 78 checks passed
@KaloyanNaumov
KaloyanNaumov deleted the pr/forgejo-pr-history branch December 2, 2026 09:33
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.

Merged-PR history from Forgejo hosts

2 participants