<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Latest commits for branch codeberg-13</title>
    <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/branch/codeberg-13</link>
    <description>The code deployed to Codeberg. If you want to deploy Forgejo yourself or work on the code, check out:</description>
    <pubDate>Wed, 04 Mar 2026 02:27:44 +0100</pubDate>
    <item>
      <title>CB/feat: ToU announcement</title>
      <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/commit/7c93f1d7b11250c2b6fb0918ed1ef5f1643e3fbe</link>
      <description>CB/feat: ToU announcement&#xA;&#xA;Usable for nosJS environment (no way to hide it).&#xA;Do not show it by default to avoid it briefly showing and shifting the&#xA;layout when the announcement is dismissed.&#xA;&#xA;A dummy `&lt;div&gt;` is used as first child that has the same width of the&#xA;button so the text is correctly centered (we can&#39;t use `position:&#xA;absolute` that will overlap with the text at certain screen widths).&#xA;</description>
      <content:encoded><![CDATA[CB/feat: ToU announcement

Usable for nosJS environment (no way to hide it).
Do not show it by default to avoid it briefly showing and shifting the
layout when the announcement is dismissed.

A dummy `<div>` is used as first child that has the same width of the
button so the text is correctly centered (we can't use `position:
absolute` that will overlap with the text at certain screen widths).
]]></content:encoded>
      <author>Gusted</author>
      <guid>7c93f1d7b11250c2b6fb0918ed1ef5f1643e3fbe</guid>
      <pubDate>Mon, 22 Dec 2025 01:48:31 +0100</pubDate>
    </item>
    <item>
      <title>CB/fix: reduce granulity of last used columns</title>
      <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/commit/1f5fe8bf398e6136606d8ec39088e7324e5043dd</link>
      <description>CB/fix: reduce granulity of last used columns&#xA;&#xA;These create many `UPDATE` queries, reduce the granulity to a minute.&#xA;</description>
      <content:encoded><![CDATA[CB/fix: reduce granulity of last used columns

These create many `UPDATE` queries, reduce the granulity to a minute.
]]></content:encoded>
      <author>Gusted</author>
      <guid>1f5fe8bf398e6136606d8ec39088e7324e5043dd</guid>
      <pubDate>Mon, 22 Dec 2025 01:48:31 +0100</pubDate>
    </item>
    <item>
      <title>CB/bp: fix: garbage collect lingering actions logs (#10009)</title>
      <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/commit/c8e745469f373b7d9c455118e2f2c2639e14e382</link>
      <description>CB/bp: fix: garbage collect lingering actions logs (#10009)&#xA;&#xA;If, for any reason (e.g. server crash), a task is recorded as done in the database but the logs are still in the database instead of being in storage, they need to be collected.&#xA;&#xA;The log_in_storage field is only set to true after the logs have been transfered to storage and can be relied upon to reflect which tasks have lingering logs.&#xA;&#xA;A cron job collects lingering logs every day, 3000 at a time, sleeping one second between them. In normal circumstances there will be only a few of them, even on a large instance, and there is no need to collect them as quickly as possible.&#xA;&#xA;When there are a lot of them for some reason, garbage collection must happen at a rate that is not too hard on storage I/O.&#xA;&#xA;Refs https://codeberg.org/forgejo/forgejo/issues/9999&#xA;&#xA;Co-authored-by: Mathieu Fenniak &lt;mathieu@fenniak.net&gt;&#xA;Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10009&#xA;Reviewed-by: Mathieu Fenniak &lt;mfenniak@noreply.codeberg.org&gt;&#xA;Reviewed-by: Gusted &lt;gusted@noreply.codeberg.org&gt;&#xA;Co-authored-by: Earl Warren &lt;contact@earl-warren.org&gt;&#xA;Co-committed-by: Earl Warren &lt;contact@earl-warren.org&gt;&#xA;&#xA;---&#xA;&#xA;Codeberg modification: Bump the values so it doesn&#39;t take a year to&#xA;transfer lingering action logs.&#xA;</description>
      <content:encoded><![CDATA[CB/bp: fix: garbage collect lingering actions logs (#10009)

If, for any reason (e.g. server crash), a task is recorded as done in the database but the logs are still in the database instead of being in storage, they need to be collected.

The log_in_storage field is only set to true after the logs have been transfered to storage and can be relied upon to reflect which tasks have lingering logs.

A cron job collects lingering logs every day, 3000 at a time, sleeping one second between them. In normal circumstances there will be only a few of them, even on a large instance, and there is no need to collect them as quickly as possible.

When there are a lot of them for some reason, garbage collection must happen at a rate that is not too hard on storage I/O.

Refs https://codeberg.org/forgejo/forgejo/issues/9999

Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10009
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>

---

Codeberg modification: Bump the values so it doesn't take a year to
transfer lingering action logs.
]]></content:encoded>
      <author>Earl Warren</author>
      <guid>c8e745469f373b7d9c455118e2f2c2639e14e382</guid>
      <pubDate>Mon, 22 Dec 2025 01:48:31 +0100</pubDate>
    </item>
    <item>
      <title>CB/bp: fix: readjust indexes on the &#39;action&#39; table</title>
      <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/commit/ee7c14e18a6fae929369ed6d41d0e45f0358ca79</link>
      <description>CB/bp: fix: readjust indexes on the &#39;action&#39; table&#xA;&#xA;Ref: forgejo/forgejo!10040&#xA;Codeberg modification: migration dropped, is manually created.&#xA;</description>
      <content:encoded><![CDATA[CB/bp: fix: readjust indexes on the 'action' table

Ref: forgejo/forgejo!10040
Codeberg modification: migration dropped, is manually created.
]]></content:encoded>
      <author>Mathieu Fenniak</author>
      <guid>ee7c14e18a6fae929369ed6d41d0e45f0358ca79</guid>
      <pubDate>Mon, 22 Dec 2025 01:48:31 +0100</pubDate>
    </item>
    <item>
      <title>CB/bp: chore: Remove IsDeleted from action (activity) table</title>
      <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/commit/13e38ef7e04e6dc77fe81d9ba1f94162530adaa8</link>
      <description>CB/bp: chore: Remove IsDeleted from action (activity) table&#xA;&#xA;Fixes https://codeberg.org/forgejo/forgejo/issues/3525 and supersedes https://codeberg.org/forgejo/forgejo/pulls/9586&#xA;&#xA;Co-authored-by: Mathieu Fenniak &lt;mathieu@fenniak.net&gt;&#xA;Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9829&#xA;Reviewed-by: Mathieu Fenniak &lt;mfenniak@noreply.codeberg.org&gt;&#xA;Co-authored-by: Leni Kadali &lt;lenikadali@noreply.codeberg.org&gt;&#xA;Co-committed-by: Leni Kadali &lt;lenikadali@noreply.codeberg.org&gt;&#xA;</description>
      <content:encoded><![CDATA[CB/bp: chore: Remove IsDeleted from action (activity) table

Fixes https://codeberg.org/forgejo/forgejo/issues/3525 and supersedes https://codeberg.org/forgejo/forgejo/pulls/9586

Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9829
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Leni Kadali <lenikadali@noreply.codeberg.org>
Co-committed-by: Leni Kadali <lenikadali@noreply.codeberg.org>
]]></content:encoded>
      <author>Leni Kadali</author>
      <guid>13e38ef7e04e6dc77fe81d9ba1f94162530adaa8</guid>
      <pubDate>Mon, 22 Dec 2025 01:48:31 +0100</pubDate>
    </item>
    <item>
      <title>CB/bp: fix: possible cause of invalid issue counts; cache invalidation occurs before a active transaction is committed (#10130)</title>
      <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/commit/dd76a566f4e2300e1a39f91cd70f196aa0308b4a</link>
      <description>CB/bp: fix: possible cause of invalid issue counts; cache invalidation occurs before a active transaction is committed (#10130)&#xA;&#xA;Although #9922 was deployed to Codeberg, it was reported on Matrix that a user observed a `-1` pull request count.&#xA;&#xA;@Gusted checked and verified that the stats stored in redis appeared incorrect, and that no errors occurred on Codeberg that included the repo ID (eg. deadlocks, SQL queries).&#xA;```&#xA;127.0.0.1:6379&gt; GET Repo:CountPulls:924266&#xA;&#34;1&#34;&#xA;127.0.0.1:6379&gt; GET Repo:CountPullsClosed:924266&#xA;&#34;2&#34;&#xA;```&#xA;&#xA;One possible cause is that when `UpdateRepoIssueNumbers` is invoked and invalidates the cache key for the repository, it is currently in a transaction; the next request for that cached count could be computed before the transaction is committed and the update is visible.  It&#39;s been verified that `UpdateRepoIssueNumbers` is called within a transaction in most interactions (I put a panic in it if `db.InTransaction(ctx)`, and most related tests failed).&#xA;&#xA;This PR fixes that hole by performing the cache invalidation in an `AfterTx()` hook which is invoked after the transaction is committed to the database.&#xA;&#xA;(Another possible cause is documented in #10127)&#xA;&#xA;Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10130&#xA;Reviewed-by: Gusted &lt;gusted@noreply.codeberg.org&gt;&#xA;Co-authored-by: Mathieu Fenniak &lt;mathieu@fenniak.net&gt;&#xA;Co-committed-by: Mathieu Fenniak &lt;mathieu@fenniak.net&gt;&#xA;</description>
      <content:encoded><![CDATA[CB/bp: fix: possible cause of invalid issue counts; cache invalidation occurs before a active transaction is committed (#10130)

Although #9922 was deployed to Codeberg, it was reported on Matrix that a user observed a `-1` pull request count.

@Gusted checked and verified that the stats stored in redis appeared incorrect, and that no errors occurred on Codeberg that included the repo ID (eg. deadlocks, SQL queries).
```
127.0.0.1:6379> GET Repo:CountPulls:924266
"1"
127.0.0.1:6379> GET Repo:CountPullsClosed:924266
"2"
```

One possible cause is that when `UpdateRepoIssueNumbers` is invoked and invalidates the cache key for the repository, it is currently in a transaction; the next request for that cached count could be computed before the transaction is committed and the update is visible.  It's been verified that `UpdateRepoIssueNumbers` is called within a transaction in most interactions (I put a panic in it if `db.InTransaction(ctx)`, and most related tests failed).

This PR fixes that hole by performing the cache invalidation in an `AfterTx()` hook which is invoked after the transaction is committed to the database.

(Another possible cause is documented in #10127)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10130
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
]]></content:encoded>
      <author>Mathieu Fenniak</author>
      <guid>dd76a566f4e2300e1a39f91cd70f196aa0308b4a</guid>
      <pubDate>Mon, 22 Dec 2025 01:48:31 +0100</pubDate>
    </item>
    <item>
      <title>CB/bp: fix: reduce deadlocks merging PRs w/ async milestone stat recalcs (#9916)</title>
      <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/commit/ebef9f594a7e1393ecf29615217386ad6b3c8735</link>
      <description>CB/bp: fix: reduce deadlocks merging PRs w/ async milestone stat recalcs (#9916)&#xA;&#xA;Continuing the pattern from #9868, fixes another deadlock discovered in synthetic testing of #9785.  This modifies the `milestone` table to have the `num_issues`, `num_closed_issues`, and `completeness` statistics be calculated asynchronously.&#xA;&#xA;An optional `updateTimestamp` field was added to the stats queue to support the conditional updating of the milestone&#39;s modification date, retaining existing functionality.&#xA;&#xA;Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9916&#xA;Reviewed-by: Earl Warren &lt;earl-warren@noreply.codeberg.org&gt;&#xA;Co-authored-by: Mathieu Fenniak &lt;mathieu@fenniak.net&gt;&#xA;Co-committed-by: Mathieu Fenniak &lt;mathieu@fenniak.net&gt;&#xA;</description>
      <content:encoded><![CDATA[CB/bp: fix: reduce deadlocks merging PRs w/ async milestone stat recalcs (#9916)

Continuing the pattern from #9868, fixes another deadlock discovered in synthetic testing of #9785.  This modifies the `milestone` table to have the `num_issues`, `num_closed_issues`, and `completeness` statistics be calculated asynchronously.

An optional `updateTimestamp` field was added to the stats queue to support the conditional updating of the milestone's modification date, retaining existing functionality.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9916
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
]]></content:encoded>
      <author>Mathieu Fenniak</author>
      <guid>ebef9f594a7e1393ecf29615217386ad6b3c8735</guid>
      <pubDate>Mon, 22 Dec 2025 01:48:31 +0100</pubDate>
    </item>
    <item>
      <title>CB/bp: fix: reduce deadlocks merging PRs w/ async label stat recalcs (#9868)</title>
      <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/commit/04cf260c273f186241a41b2ffd1cc7e31ea0c2cd</link>
      <description>CB/bp: fix: reduce deadlocks merging PRs w/ async label stat recalcs (#9868)&#xA;&#xA;The intent of this change is to reduce the scope of deadlock issues identified in #9785.  I&#39;ve identified other deadlock issues from synthetic testing, so this is not a complete fix, but it&#39;s a partial fix.  This design was discussed in #9785 and this is the most basic implementation, with a very small scope of work converted to use it.&#xA;&#xA;Introduces a new `forgejo.org/services/stats` module which allows for the queuing and routing of recalc requests for object stats; in this case, the &#34;number of issues&#34; that are assigned to a label, and the number of closed issues that are assigned to a label.&#xA;&#xA;The reasons that these calculations are performed asynchronously through a queue are:&#xA;- User operations that are common and performance-sensitive don&#39;t have to wait for recalculations that don&#39;t need to be exactly up-to-date at all times.  For example, merging a pull request will be a faster operation; as it closes an issue, it needs to recalculate `label.num_closed_issues` for every label attached to the PR.&#xA;&#xA;- Database deadlocks that can occur between concurrent operations -- for example, if you were holding a lock on an issue while recalculating a label&#39;s count of open issues -- can be broken by making the recalculation occur outside of the transaction.&#xA;&#xA;Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9868&#xA;Reviewed-by: Gusted &lt;gusted@noreply.codeberg.org&gt;&#xA;Co-authored-by: Mathieu Fenniak &lt;mathieu@fenniak.net&gt;&#xA;Co-committed-by: Mathieu Fenniak &lt;mathieu@fenniak.net&gt;&#xA;</description>
      <content:encoded><![CDATA[CB/bp: fix: reduce deadlocks merging PRs w/ async label stat recalcs (#9868)

The intent of this change is to reduce the scope of deadlock issues identified in #9785.  I've identified other deadlock issues from synthetic testing, so this is not a complete fix, but it's a partial fix.  This design was discussed in #9785 and this is the most basic implementation, with a very small scope of work converted to use it.

Introduces a new `forgejo.org/services/stats` module which allows for the queuing and routing of recalc requests for object stats; in this case, the "number of issues" that are assigned to a label, and the number of closed issues that are assigned to a label.

The reasons that these calculations are performed asynchronously through a queue are:
- User operations that are common and performance-sensitive don't have to wait for recalculations that don't need to be exactly up-to-date at all times.  For example, merging a pull request will be a faster operation; as it closes an issue, it needs to recalculate `label.num_closed_issues` for every label attached to the PR.

- Database deadlocks that can occur between concurrent operations -- for example, if you were holding a lock on an issue while recalculating a label's count of open issues -- can be broken by making the recalculation occur outside of the transaction.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9868
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
]]></content:encoded>
      <author>Mathieu Fenniak</author>
      <guid>04cf260c273f186241a41b2ffd1cc7e31ea0c2cd</guid>
      <pubDate>Mon, 22 Dec 2025 01:48:31 +0100</pubDate>
    </item>
    <item>
      <title>CB/bp: fix: possible cause of invalid issue counts; cache module doesn&#39;t guarantee concurrency safety</title>
      <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/commit/9b96dc2069d189dfb3a7ac46805f59954aea7bad</link>
      <description>CB/bp: fix: possible cause of invalid issue counts; cache module doesn&#39;t guarantee concurrency safety&#xA;</description>
      <content:encoded><![CDATA[CB/bp: fix: possible cause of invalid issue counts; cache module doesn't guarantee concurrency safety
]]></content:encoded>
      <author>Mathieu Fenniak</author>
      <guid>9b96dc2069d189dfb3a7ac46805f59954aea7bad</guid>
      <pubDate>Mon, 22 Dec 2025 01:48:31 +0100</pubDate>
    </item>
    <item>
      <title>CB/feat: better metrics</title>
      <link>https://codeberg.org/Codeberg-Infrastructure/forgejo/commit/e1b9befd3364e79f0f8240fa4f6eb4ed7fa07fbd</link>
      <description>CB/feat: better metrics&#xA;&#xA;Better prometheus metrics, the count of tables are not interesting and&#xA;rather slow.&#xA;</description>
      <content:encoded><![CDATA[CB/feat: better metrics

Better prometheus metrics, the count of tables are not interesting and
rather slow.
]]></content:encoded>
      <author>Gusted</author>
      <guid>e1b9befd3364e79f0f8240fa4f6eb4ed7fa07fbd</guid>
      <pubDate>Mon, 22 Dec 2025 01:48:31 +0100</pubDate>
    </item>
  </channel>
</rss>