[Ongoing] Replace engine.connect() with engine.begin()
- Dominant language
- Python
- Stars
- 13
- Forks
- 17
- Avg merge
- 6h 59m
- Merged PRs (30d)
- 1
Description
> [!NOTE]
> Migrated from [augurlabs/augur#3733](https://github.com/augurlabs/augur/issues/3733)
> Originally opened by `@MoralCode` on 2026-02-24
---
As notedin augurlabs/augur#3716:
> In SQLAlchemy 2.0 engine.connect() uses autobegin but NOT autocommit. Every call to update_issue_closed_cntrbs_by_repo_id was rolling back at context-manager exit, leaving cntrb_id stale. Switching to engine.begin() makes the transaction commit on success and roll back only on exception, which is the correct behavior.
We should audit all of our `engine.connect()` calls and slowly replace them with `engine.begin()` on a one-by one basis. (one PR per replacement so it can be evaluated, especially for newcomers.
Contributor guide
Assessment
This issue has not been assessed yet.