go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/lucicfg/testdata/scheduler/bbv2.star (about)

     1  lucicfg.enable_experiment("crbug.com/1182002")  # short BBv2 names + bindings
     2  
     3  luci.project(
     4      name = "project",
     5      buildbucket = "cr-buildbucket.appspot.com",
     6      scheduler = "luci-scheduler.appspot.com",
     7      swarming = "chromium-swarm.appspot.com",
     8  )
     9  
    10  luci.bucket(name = "buck1")
    11  luci.bucket(name = "buck2")
    12  
    13  luci.builder(
    14      name = "b1",
    15      bucket = "buck1",
    16      executable = luci.recipe(name = "noop", cipd_package = "noop"),
    17      service_account = "b1@example.com",
    18      schedule = "triggered",
    19  )
    20  
    21  luci.builder(
    22      name = "b2",
    23      bucket = "buck1",
    24      executable = luci.recipe(name = "noop", cipd_package = "noop"),
    25      service_account = "b2@example.com",
    26      triggered_by = ["b1"],
    27  )
    28  
    29  luci.builder(
    30      name = "b2",
    31      bucket = "buck2",
    32      executable = luci.recipe(name = "noop", cipd_package = "noop"),
    33      service_account = "b3@example.com",
    34      triggered_by = ["b1"],
    35  )
    36  
    37  # Expect configs:
    38  #
    39  # === cr-buildbucket.cfg
    40  # buckets {
    41  #   name: "buck1"
    42  #   swarming {
    43  #     builders {
    44  #       name: "b1"
    45  #       swarming_host: "chromium-swarm.appspot.com"
    46  #       recipe {
    47  #         name: "noop"
    48  #         cipd_package: "noop"
    49  #         cipd_version: "refs/heads/main"
    50  #       }
    51  #       service_account: "b1@example.com"
    52  #     }
    53  #     builders {
    54  #       name: "b2"
    55  #       swarming_host: "chromium-swarm.appspot.com"
    56  #       recipe {
    57  #         name: "noop"
    58  #         cipd_package: "noop"
    59  #         cipd_version: "refs/heads/main"
    60  #       }
    61  #       service_account: "b2@example.com"
    62  #     }
    63  #   }
    64  # }
    65  # buckets {
    66  #   name: "buck2"
    67  #   swarming {
    68  #     builders {
    69  #       name: "b2"
    70  #       swarming_host: "chromium-swarm.appspot.com"
    71  #       recipe {
    72  #         name: "noop"
    73  #         cipd_package: "noop"
    74  #         cipd_version: "refs/heads/main"
    75  #       }
    76  #       service_account: "b3@example.com"
    77  #     }
    78  #   }
    79  # }
    80  # ===
    81  #
    82  # === luci-scheduler.cfg
    83  # job {
    84  #   id: "b1"
    85  #   realm: "buck1"
    86  #   schedule: "triggered"
    87  #   acl_sets: "buck1"
    88  #   buildbucket {
    89  #     server: "cr-buildbucket.appspot.com"
    90  #     bucket: "buck1"
    91  #     builder: "b1"
    92  #   }
    93  # }
    94  # job {
    95  #   id: "buck1-b2"
    96  #   realm: "buck1"
    97  #   acls {
    98  #     role: TRIGGERER
    99  #     granted_to: "b1@example.com"
   100  #   }
   101  #   acl_sets: "buck1"
   102  #   buildbucket {
   103  #     server: "cr-buildbucket.appspot.com"
   104  #     bucket: "buck1"
   105  #     builder: "b2"
   106  #   }
   107  # }
   108  # job {
   109  #   id: "buck2-b2"
   110  #   realm: "buck2"
   111  #   acls {
   112  #     role: TRIGGERER
   113  #     granted_to: "b1@example.com"
   114  #   }
   115  #   acl_sets: "buck2"
   116  #   buildbucket {
   117  #     server: "cr-buildbucket.appspot.com"
   118  #     bucket: "buck2"
   119  #     builder: "b2"
   120  #   }
   121  # }
   122  # acl_sets {
   123  #   name: "buck1"
   124  # }
   125  # acl_sets {
   126  #   name: "buck2"
   127  # }
   128  # ===
   129  #
   130  # === project.cfg
   131  # name: "project"
   132  # ===
   133  #
   134  # === realms.cfg
   135  # realms {
   136  #   name: "@root"
   137  # }
   138  # realms {
   139  #   name: "buck1"
   140  #   bindings {
   141  #     role: "role/buildbucket.builderServiceAccount"
   142  #     principals: "user:b1@example.com"
   143  #     principals: "user:b2@example.com"
   144  #   }
   145  #   bindings {
   146  #     role: "role/scheduler.triggerer"
   147  #     principals: "user:b1@example.com"
   148  #     conditions {
   149  #       restrict {
   150  #         attribute: "scheduler.job.name"
   151  #         values: "buck1-b2"
   152  #       }
   153  #     }
   154  #   }
   155  # }
   156  # realms {
   157  #   name: "buck2"
   158  #   bindings {
   159  #     role: "role/buildbucket.builderServiceAccount"
   160  #     principals: "user:b3@example.com"
   161  #   }
   162  #   bindings {
   163  #     role: "role/scheduler.triggerer"
   164  #     principals: "user:b1@example.com"
   165  #     conditions {
   166  #       restrict {
   167  #         attribute: "scheduler.job.name"
   168  #         values: "buck2-b2"
   169  #       }
   170  #     }
   171  #   }
   172  # }
   173  # ===