letsencrypt / letsencrypt/boulder

Add a method to db.Executor instances passed inside of db.WithTransaction

Open
#7,503 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
5.8k
Forks
649
Avg merge
3d 23h
Merged PRs (30d)
24

Description

We have some functions inside of model.go which should only be called inside of a transaction but absolutely could be called outside of a transaction if the caller wasn't careful.

Modify db.WithTransaction func() to accept an Executor which meets the same interface but also includes a method that differentiates it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading model.go and the db.WithTransaction implementation to understand how db.Executor instances are passed into transaction-scoped functions. Determine the interface distinction needed for transaction-only calls and verify that callers can no longer use those functions outside a transaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.