forgejo/services/issue
Mathieu Fenniak 327cdc1787 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.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

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>
2025-10-31 15:53:45 +01:00
..
assignee.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
assignee_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
comments.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
comments_test.go fix: make sure to use unaltered fields when saving a shadow copy for updated profiles or comments (#8533) 2025-07-20 23:52:58 +02:00
commit.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
commit_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
content.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue.go fix: reduce deadlocks merging PRs w/ async milestone stat recalcs (#9916) 2025-10-31 15:53:45 +01:00
issue_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
label.go fix: remove redundant permission check in RemoveLabel (#7835) 2025-05-14 16:20:43 +00:00
label_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
milestone.go fix: reduce deadlocks merging PRs w/ async milestone stat recalcs (#9916) 2025-10-31 15:53:45 +01:00
milestone_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
pull.go feat: avoid remote for codeowner's merge base (#9610) 2025-10-10 15:50:38 +02:00
reaction.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
status.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
template.go feat: search in the docs directory for issue and pull request templates (#8863) 2025-08-26 22:08:10 +02:00