go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/common/proto/srcman/manifest_diff.proto (about)

     1  // Copyright (c) 2015 The LUCI Authors. All rights reserved.
     2  // Use of this source code is governed under the Apache License, Version 2.0
     3  // that can be found in the LICENSE file.
     4  
     5  syntax = "proto3";
     6  
     7  package srcman;
     8  
     9  option go_package = "go.chromium.org/luci/common/proto/srcman";
    10  
    11  import "go.chromium.org/luci/common/proto/git/commit.proto";
    12  import "go.chromium.org/luci/common/proto/srcman/manifest.proto";
    13  
    14  // ManifestDiff holds basic difference information between two source manifests.
    15  message ManifestDiff {
    16    // The older of the two manifests.
    17    srcman.Manifest old = 1;
    18  
    19    // The newer of the two manifests.
    20    srcman.Manifest new = 2;
    21  
    22    // Stat indicates how a given item has changed.
    23    enum Stat {
    24      // These two items are identical
    25      EQUAL    = 0;
    26  
    27      // The item was added in `new` compared to `old`
    28      ADDED    = 1;
    29  
    30      // The item was removed in `new` compared to `old`
    31      REMOVED  = 2;
    32  
    33      // The item is in both, but is incomparable (e.g. repo_url changed from
    34      // `old` to `new`).
    35      MODIFIED = 4;
    36  
    37      // The item is in both, and is directly comparable (e.g. different
    38      // revisions of the same repo_url). This only applies to the revision fields
    39      // of SCM messages.
    40      //
    41      // This is 0x8 | MODIFIED, so that users who don't care about DIFF v.
    42      // MODIFIED can check `Status & MODIFIED`.
    43      DIFF     = 12;
    44    }
    45  
    46    // Indicates if there is some overall difference between old and new.
    47    Stat overall = 3;
    48  
    49    message GitCheckout {
    50      // Indicates if there is some overall difference between old and new.
    51      Stat overall = 1;
    52  
    53      // Indicates the status for the `revision` field.
    54      //
    55      // If this is DIFF, it is sensible to compute
    56      //   `git log repo_url old.revision new.revision`
    57      Stat revision = 2;
    58  
    59      // Indicates the status for the `patch_revision` field. It evaluates
    60      // the patch_fetch_ref values to ensure that old and new are different
    61      // patches from the same CL.
    62      //
    63      // If this is DIFF, it is sensible to compute
    64      //   `git log repo_url old.patch_revision new.patch_revision`
    65      Stat patch_revision = 3;
    66  
    67      // The URL that should be used for RPCs. It may differ from the url in old
    68      // or new if the service computing this ManifestDiff knows of e.g. a repo
    69      // URL migration.
    70      string repo_url = 4;
    71  
    72      // If revision==DIFF, this may be populated with git history occurring
    73      // between the two base revisions.
    74      repeated git.Commit history = 5;
    75    }
    76  
    77    message Directory {
    78      // This is the overall status for this Directory.
    79      Stat overall = 1;
    80  
    81      GitCheckout git_checkout = 2;
    82  
    83      Stat cipd_server_host = 3;
    84      // Note: this will only ever be MODIFIED, because we cannot (yet) determine
    85      // if two versions of a cipd package are diffable. We may later implement
    86      // DIFF detection (i.e. if both packages use `version:<sha1>` tags).
    87      map<string, Stat> cipd_package = 4;
    88  
    89      reserved 5, 6;
    90    }
    91  
    92    map<string, Directory> directories = 4;
    93  }