Add a local_site parameter to SCMClients.

Review Request #14910 — Created March 17, 2026 and updated

Information

Review Board
release-7.1.x

Reviewers

Many SCMClients need to manage state tied to a Local Site, and do so by
passing in a client-specific local_site_name. With the upcoming cert
work, this is going to be needed more broadly, and we'll need an
instance.

We always have access to an instance in places where we initialize a
client. This happens in both an SCMTool's __init__() and in
check_repository(). This makes it easy to pass this in.

This change updates the base SCMClient to take and store this,
updates all subclasses to pass it to the parent, and updates call sites
to pass it to the client. In many cases, surrounding code has been
cleaned up to avoid duplicate effort or to bail early when there are
problems.

There were a couple of clients that didn't inherit from SCMClient.
This change updates most of them. A notable exception is the Subversion
clients, which have a lot more complexity going on and aren't worth
tackling in this change.

Unit tests pass.

Summary ID
Add a local_site parameter to SCMClients.
Many SCMClients need to manage state tied to a Local Site, and do so by passing in a client-specific `local_site_name`. With the upcoming cert work, this is going to be needed more broadly, and we'll need an instance. We always have access to an instance in places where we initialize a client. This happens in both an SCMTool's `__init__()` and in `check_repository()`. This makes it easy to pass this in. This change updates the base `SCMClient` to take and store this, updates all subclasses to pass it to the parent, and updates call sites to pass it to the client. In many cases, surrounding code has been cleaned up to avoid duplicate effort or to bail early when there are problems. There were a couple of clients that didn't inherit from `SCMClient`. This change updates most of them. A notable exception is the Subversion clients, which have a lot more complexity going on and aren't worth tackling in this change.
44faab9b3c5435949d662cf2e08c58349fd4fb8b
Description From Last Updated

A bunch of the clients also take local_site_name and then store it as an attribute. Perhaps we should plumb that …

daviddavid

'reviewboard.site.models.LocalSite' imported but unused Column: 5 Error code: F401

reviewbotreviewbot

Typo: local_site -> local_site_name

daviddavid
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
  1. 
      
  2. Show all issues

    A bunch of the clients also take local_site_name and then store it as an attribute. Perhaps we should plumb that through to the base class as well, and then we could derive local_site or local_site_name as needed if one or the other is provided?

  3. reviewboard/scmtools/git.py (Diff revision 1)
     
     
    Show all issues

    Typo: local_site -> local_site_name

  4.