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

     1  luci.project(
     2      name = "project",
     3      buildbucket = "cr-buildbucket.appspot.com",
     4      notify = "luci-notify.appspot.com",
     5      scheduler = "luci-scheduler.appspot.com",
     6      swarming = "chromium-swarm.appspot.com",
     7  )
     8  luci.bucket(name = "bucket")
     9  luci.recipe(name = "noop", cipd_package = "noop")
    10  
    11  luci.notifier(
    12      name = "blamelist notifier",
    13      on_occurrence = ["FAILURE"],
    14      notify_blamelist = True,
    15      blamelist_repos_whitelist = ["https://repo.example.com"],
    16  )
    17  
    18  luci.notifier(
    19      name = "email notifier",
    20      on_occurrence = ["FAILURE"],
    21      notify_emails = ["a@example.com"],
    22  )
    23  
    24  luci.gitiles_poller(
    25      name = "p1",
    26      bucket = "bucket",
    27      repo = "https://polled.example.com",
    28  )
    29  
    30  luci.gitiles_poller(
    31      name = "p2",
    32      bucket = "bucket",
    33      repo = "https://polled.example.com",
    34  )
    35  
    36  luci.gitiles_poller(
    37      name = "p3",
    38      bucket = "bucket",
    39      repo = "https://another.example.com",
    40  )
    41  
    42  luci.builder(
    43      name = "explicit repo",
    44      bucket = "bucket",
    45      executable = "noop",
    46      repo = "https://repo.example.com",
    47      notifies = ["blamelist notifier", "email notifier"],
    48  )
    49  
    50  luci.builder(
    51      name = "derived through poller",
    52      bucket = "bucket",
    53      executable = "noop",
    54      triggered_by = ["p1", "p2"],
    55      notifies = ["blamelist notifier", "email notifier"],
    56  )
    57  
    58  luci.builder(
    59      name = "ambiguous pollers",
    60      bucket = "bucket",
    61      executable = "noop",
    62      triggered_by = ["p1", "p2", "p3"],
    63      notifies = ["blamelist notifier", "email notifier"],
    64  )
    65  
    66  luci.builder(
    67      name = "no repo at all",
    68      bucket = "bucket",
    69      executable = "noop",
    70      notifies = ["blamelist notifier", "email notifier"],
    71  )
    72  
    73  # Expect errors like:
    74  #
    75  # Traceback (most recent call last):
    76  #   //testdata/notifiable/notify_blamelist_no_repo.star: in <toplevel>
    77  #   ...
    78  # Error: cannot deduce a primary repo for luci.builder("bucket/ambiguous pollers"), which is observed by a luci.notifier with notify_blamelist=True; add repo=... field
    79  #
    80  # Traceback (most recent call last):
    81  #   //testdata/notifiable/notify_blamelist_no_repo.star: in <toplevel>
    82  #   ...
    83  # Error: cannot deduce a primary repo for luci.builder("bucket/no repo at all"), which is observed by a luci.notifier with notify_blamelist=True; add repo=... field