• 
      

    Add a local_site parameter to SCMClients.

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

    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.
    426dfb7fe088c3a196713f3c4e11b61c4477b076
    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 …

    david david

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

    reviewbot reviewbot

    Typo: local_site -> local_site_name

    david david
    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?

      1. I started doing that when working on this change and it was just feeling like a larger set of work I didn't want to tackle. I think it's something to circle back to once this is in.

      2. 👍

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

      Typo: local_site -> local_site_name

    4. 
        
    chipx86
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-7.1.x (fcd2d81)