Rename NEVER_SUGGEST annotation to LAST_RESORT_SUGGESTION

With change Id71314cbd the behavior of the NEVER_SUGGEST annotation was
changed, so that code owners the are annotated with NEVER_SUGGEST are
suggested if otherwise the suggestion result would be empty. This is a
bit confusing since this behavior doesn't match the name of the
NEVER_SUGGEST annotation which implies that code owners with this
annotation would never be suggested. To remove this confusion the
NEVER_SUGGEST annotation is renamed to LAST_RESORT_SUGGESTION which
describes the behavior much better. Code owners with this annotation are
suggested as a last resort if no other code owners are available.

Renaming the annotation is a backwards incompatible change and code
owner config files that already use the NEVER_SUGGEST annotation need to
be adapted manually. This is fine, since as far as we know this is only
used at a single place so far.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I74726784ee7138f40aeb9d783e5ee52c917f2ce7
diff --git a/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerAnnotations.java b/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerAnnotations.java
index a9d3edb..ea1417d 100644
--- a/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerAnnotations.java
+++ b/java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerAnnotations.java
@@ -23,14 +23,14 @@
    * Code owners with this annotation are omitted when suggesting code owners (see {@link
    * com.google.gerrit.plugins.codeowners.restapi.GetCodeOwnersForPathInChange}).
    */
-  public static final CodeOwnerAnnotation NEVER_SUGGEST_ANNOTATION =
-      CodeOwnerAnnotation.create("NEVER_SUGGEST");
+  public static final CodeOwnerAnnotation LAST_RESORT_SUGGESTION_ANNOTATION =
+      CodeOwnerAnnotation.create("LAST_RESORT_SUGGESTION");
 
   private static final List<String> KEYS_ALL;
 
   static {
     KEYS_ALL = new ArrayList<>();
-    KEYS_ALL.add(NEVER_SUGGEST_ANNOTATION.key());
+    KEYS_ALL.add(LAST_RESORT_SUGGESTION_ANNOTATION.key());
   }
 
   /** Whether the given annotation is known and supported. */
diff --git a/java/com/google/gerrit/plugins/codeowners/restapi/GetCodeOwnersForPathInChange.java b/java/com/google/gerrit/plugins/codeowners/restapi/GetCodeOwnersForPathInChange.java
index 1a3c79e..7ecfd11 100644
--- a/java/com/google/gerrit/plugins/codeowners/restapi/GetCodeOwnersForPathInChange.java
+++ b/java/com/google/gerrit/plugins/codeowners/restapi/GetCodeOwnersForPathInChange.java
@@ -138,19 +138,22 @@
             .filter(filterOutServiceUsers(debugLogs))
             .collect(toImmutableList());
 
-    // Code owners that are annotated with #{NEVER_SUGGEST} should be dropped from the suggestion,
-    // but only if it doesn't make the result empty. This means despite what the name of the
-    // annotation suggests those code owners should be suggested if there are no other code owners.
-    ImmutableList<CodeOwner> filteredCodeOwnersWithoutCodeOwnersThatAreAnnotatedWithNeverSuggest =
-        filteredCodeOwners.stream()
-            .filter(filterOutCodeOwnersThatAreAnnotatedWithNeverSuggest(annotations, debugLogs))
-            .collect(toImmutableList());
-    if (filteredCodeOwnersWithoutCodeOwnersThatAreAnnotatedWithNeverSuggest.isEmpty()) {
-      // The result would be empty, hence return code owners even if they are annotated with
-      // #{NEVER_SUGGEST}.
+    // Code owners that are annotated with #{LAST_RESORT_SUGGESTION} should be dropped from the
+    // suggestion, but only if it doesn't make the result empty. In other words this means that
+    // those code owners should be suggested if there are no other code owners.
+    ImmutableList<CodeOwner>
+        filteredCodeOwnersWithoutCodeOwnersThatAreAnnotatedWithLastResortSuggestion =
+            filteredCodeOwners.stream()
+                .filter(
+                    filterOutCodeOwnersThatAreAnnotatedWithLastResortSuggestion(
+                        annotations, debugLogs))
+                .collect(toImmutableList());
+    if (filteredCodeOwnersWithoutCodeOwnersThatAreAnnotatedWithLastResortSuggestion.isEmpty()) {
+      // The result would be empty, hence return code owners that are annotated with
+      // #{LAST_RESORT_SUGGESTION}.
       return filteredCodeOwners.stream();
     }
-    return filteredCodeOwnersWithoutCodeOwnersThatAreAnnotatedWithNeverSuggest.stream();
+    return filteredCodeOwnersWithoutCodeOwnersThatAreAnnotatedWithLastResortSuggestion.stream();
   }
 
   private Predicate<CodeOwner> filterOutChangeOwner(
@@ -167,20 +170,21 @@
     };
   }
 
-  private Predicate<CodeOwner> filterOutCodeOwnersThatAreAnnotatedWithNeverSuggest(
+  private Predicate<CodeOwner> filterOutCodeOwnersThatAreAnnotatedWithLastResortSuggestion(
       ImmutableMultimap<CodeOwner, CodeOwnerAnnotation> annotations,
       ImmutableList.Builder<String> debugLogs) {
     return codeOwner -> {
-      boolean neverSuggest =
-          annotations.containsEntry(codeOwner, CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION);
-      if (!neverSuggest) {
+      boolean lastResortSuggestion =
+          annotations.containsEntry(
+              codeOwner, CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION);
+      if (!lastResortSuggestion) {
         // Returning true from the Predicate here means that the code owner should be kept.
         return true;
       }
       debugLogs.add(
           String.format(
               "filtering out %s because this code owner is annotated with %s",
-              codeOwner, CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION.key()));
+              codeOwner, CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION.key()));
       // Returning false from the Predicate here means that the code owner should be filtered out.
       return false;
     };
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java
index 4baef37..878b65d 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java
@@ -1483,7 +1483,8 @@
         .addCodeOwnerSet(
             CodeOwnerSet.builder()
                 .addCodeOwnerEmail(codeOwner.email())
-                .addAnnotation(codeOwner.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    codeOwner.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .build())
         .create();
 
@@ -1508,7 +1509,8 @@
         .addCodeOwnerSet(
             CodeOwnerSet.builder()
                 .addCodeOwnerEmail(codeOwner.email())
-                .addAnnotation(codeOwner.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    codeOwner.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addAnnotation(codeOwner.email(), CodeOwnerAnnotation.create("OTHER_ANNOTATION"))
                 .build())
         .create();
@@ -1518,7 +1520,7 @@
     assertThat(checkCodeOwnerInfo).isCodeOwner();
     assertThat(checkCodeOwnerInfo)
         .hasAnnotationsThat()
-        .containsExactly(CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION.key())
+        .containsExactly(CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION.key())
         .inOrder();
     assertThat(checkCodeOwnerInfo)
         .hasDebugLogsThatContainAllOf(
@@ -1529,7 +1531,8 @@
                 "email %s is annotated with %s",
                 codeOwner.email(),
                 ImmutableSet.of(
-                    CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION.key(), "OTHER_ANNOTATION")),
+                    CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION.key(),
+                    "OTHER_ANNOTATION")),
             String.format(
                 "found the all users wildcard ('%s') as a code owner in %s which makes %s a code"
                     + " owner",
@@ -1547,7 +1550,7 @@
             String.format(
                 "email %s is annotated with %s",
                 codeOwner.email(),
-                ImmutableSet.of(CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION.key())),
+                ImmutableSet.of(CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION.key())),
             String.format(
                 "dropping unsupported annotations for %s: %s",
                 codeOwner.email(), ImmutableSet.of("ANNOTATION", "OTHER_ANNOTATION")));
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnersForPathInBranchIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnersForPathInBranchIT.java
index 82ca271..dfd97d4 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnersForPathInBranchIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnersForPathInBranchIT.java
@@ -247,7 +247,7 @@
   }
 
   @Test
-  public void codeOwnersWithNeverSuggestAnnotationAreIncluded() throws Exception {
+  public void codeOwnersWithLastResortSuggestionAnnotationAreIncluded() throws Exception {
     skipTestIfAnnotationsNotSupportedByCodeOwnersBackend();
 
     TestAccount user2 = accountCreator.user2();
@@ -260,14 +260,17 @@
         .addCodeOwnerSet(
             CodeOwnerSet.builder()
                 .addCodeOwnerEmail(admin.email())
-                .addAnnotation(admin.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    admin.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addCodeOwnerEmail(user.email())
                 .addCodeOwnerEmail(user2.email())
                 .build())
         .create();
 
-    // Expectation: admin is included because GetCodeOwnersForPathInBranch ignores the NEVER_SUGGEST
-    // suggestion.
+    // Expectation: admin is included because GetCodeOwnersForPathInBranch ignores the
+    // LAST_RESORT_SUGGESTION annotation (GetCodeOwnersForPathInBranch is for listing code owners,
+    // but this annotation is only relevant for GetCodeOwnersForPathInChange which is for suggesting
+    // code owners)
     CodeOwnersInfo codeOwnersInfo = queryCodeOwners("foo/bar/baz.md");
     assertThat(codeOwnersInfo)
         .hasCodeOwnersThat()
@@ -276,7 +279,7 @@
   }
 
   @Test
-  public void perFileCodeOwnersWithNeverSuggestAnnotationAreIncluded() throws Exception {
+  public void perFileCodeOwnersWithLastResortSuggestionAnnotationAreIncluded() throws Exception {
     skipTestIfAnnotationsNotSupportedByCodeOwnersBackend();
 
     TestAccount user2 = accountCreator.user2();
@@ -290,14 +293,17 @@
             CodeOwnerSet.builder()
                 .addPathExpression(testPathExpressions.matchFileType("md"))
                 .addCodeOwnerEmail(admin.email())
-                .addAnnotation(admin.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    admin.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addCodeOwnerEmail(user.email())
                 .addCodeOwnerEmail(user2.email())
                 .build())
         .create();
 
-    // Expectation: admin is included because GetCodeOwnersForPathInBranch ignores the NEVER_SUGGEST
-    // suggestion.
+    // Expectation: admin is included because GetCodeOwnersForPathInBranch ignores the
+    // LAST_RESORT_SUGGESTION annotation (GetCodeOwnersForPathInBranch is for listing code owners,
+    // but this annotation is only relevant for GetCodeOwnersForPathInChange which is for suggesting
+    // code owners)
     CodeOwnersInfo codeOwnersInfo = queryCodeOwners("foo/bar/baz.md");
     assertThat(codeOwnersInfo)
         .hasCodeOwnersThat()
diff --git a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnersForPathInChangeIT.java b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnersForPathInChangeIT.java
index 16395ba..1f09ce1 100644
--- a/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnersForPathInChangeIT.java
+++ b/javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnersForPathInChangeIT.java
@@ -330,7 +330,7 @@
   }
 
   @Test
-  public void codeOwnersWithNeverSuggestAnnotationAreFilteredOut() throws Exception {
+  public void codeOwnersWithLastResortSuggestionAnnotationAreFilteredOut() throws Exception {
     skipTestIfAnnotationsNotSupportedByCodeOwnersBackend();
 
     TestAccount user2 = accountCreator.user2();
@@ -343,13 +343,14 @@
         .addCodeOwnerSet(
             CodeOwnerSet.builder()
                 .addCodeOwnerEmail(admin.email())
-                .addAnnotation(admin.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    admin.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addCodeOwnerEmail(user.email())
                 .addCodeOwnerEmail(user2.email())
                 .build())
         .create();
 
-    // Expectation: admin is filtered out because it is annotated with NEVER_SUGGEST.
+    // Expectation: admin is filtered out because it is annotated with LAST_RESORT_SUGGESTION.
     CodeOwnersInfo codeOwnersInfo = queryCodeOwners("foo/bar/baz.md");
     assertThat(codeOwnersInfo)
         .hasCodeOwnersThat()
@@ -358,7 +359,7 @@
   }
 
   @Test
-  public void codeOwnersWithNeverSuggestAnnotation_annotationIgnoredIfResultWouldBeEmpty()
+  public void codeOwnersWithLastResortSuggestionAnnotation_annotationIgnoredIfResultWouldBeEmpty()
       throws Exception {
     skipTestIfAnnotationsNotSupportedByCodeOwnersBackend();
 
@@ -382,15 +383,16 @@
                 .addCodeOwnerEmail(serviceUser.email())
                 .addCodeOwnerEmail(changeOwner.email())
                 .addCodeOwnerEmail(admin.email())
-                .addAnnotation(admin.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    admin.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addCodeOwnerEmail(user.email())
-                .addAnnotation(user.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(user.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .build())
         .create();
 
     // Expectation: The service user and the change owner are filtered out. admin and user get
-    // suggested despite of the NEVER_SUGGEST annotation since ignoring them would make the result
-    // empty. This is a special case in which the NEVER_SUGGEST annotation is ignored.
+    // suggested despite of the LAST_RESORT_SUGGESTION annotation since ignoring them would make
+    // the result empty.
     CodeOwnersInfo codeOwnersInfo = queryCodeOwners("foo/bar/baz.md");
     assertThat(codeOwnersInfo)
         .hasCodeOwnersThat()
@@ -399,7 +401,7 @@
   }
 
   @Test
-  public void codeOwnersWithNeverSuggestAnnotation_annotationSetForAllUsersWildcard()
+  public void codeOwnersWithLastResortSuggestionAnnotation_annotationSetForAllUsersWildcard()
       throws Exception {
     skipTestIfAnnotationsNotSupportedByCodeOwnersBackend();
 
@@ -413,15 +415,16 @@
                 .addCodeOwnerEmail(CodeOwnerResolver.ALL_USERS_WILDCARD)
                 .addAnnotation(
                     CodeOwnerResolver.ALL_USERS_WILDCARD,
-                    CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                    CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addCodeOwnerEmail(admin.email())
                 .addCodeOwnerEmail(user.email())
                 .build())
         .create();
 
-    // Expectation: Since all code owners are annotated with NEVER_SUGGEST (via the annotation on
-    // the all users wildcard) the result would be empty. This is a special case in which the
-    // NEVER_SUGGEST annotation is ignored, hence we expect admin and user to be suggested.
+    // Expectation: Since all code owners are annotated with LAST_RESORT_SUGGESTION (via the
+    // annotation on the all users wildcard) the result would be empty if code owners with the
+    // LAST_RESORT_SUGGESTION annotation are omitted. Hence in this case the LAST_RESORT_SUGGESTION
+    // annotation is ignored and we expect admin and user to be suggested.
     CodeOwnersInfo codeOwnersInfo = queryCodeOwners("foo/bar/baz.md");
     assertThat(codeOwnersInfo)
         .hasCodeOwnersThat()
@@ -430,7 +433,7 @@
   }
 
   @Test
-  public void perFileCodeOwnersWithNeverSuggestAnnotationAreFilteredOut() throws Exception {
+  public void perFileCodeOwnersWithLastResortSuggestionAnnotationAreFilteredOut() throws Exception {
     skipTestIfAnnotationsNotSupportedByCodeOwnersBackend();
 
     TestAccount user2 = accountCreator.user2();
@@ -444,13 +447,14 @@
             CodeOwnerSet.builder()
                 .addPathExpression(testPathExpressions.matchFileType("md"))
                 .addCodeOwnerEmail(admin.email())
-                .addAnnotation(admin.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    admin.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addCodeOwnerEmail(user.email())
                 .addCodeOwnerEmail(user2.email())
                 .build())
         .create();
 
-    // Expectation: admin is filtered out because it is annotated with NEVER_SUGGEST.
+    // Expectation: admin is filtered out because it is annotated with LAST_RESORT_SUGGESTION.
     CodeOwnersInfo codeOwnersInfo = queryCodeOwners("foo/bar/baz.md");
     assertThat(codeOwnersInfo)
         .hasCodeOwnersThat()
@@ -459,8 +463,9 @@
   }
 
   @Test
-  public void perFileCodeOwnersWithNeverSuggestAnnotation_annotationIgnoredIfResultWouldBeEmpty()
-      throws Exception {
+  public void
+      perFileCodeOwnersWithLastResortSuggestionAnnotation_annotationIgnoredIfResultWouldBeEmpty()
+          throws Exception {
     skipTestIfAnnotationsNotSupportedByCodeOwnersBackend();
 
     TestAccount serviceUser =
@@ -484,15 +489,16 @@
                 .addCodeOwnerEmail(serviceUser.email())
                 .addCodeOwnerEmail(changeOwner.email())
                 .addCodeOwnerEmail(admin.email())
-                .addAnnotation(admin.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    admin.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addCodeOwnerEmail(user.email())
-                .addAnnotation(user.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(user.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .build())
         .create();
 
     // Expectation: The service user and the change owner are filtered out. admin and user get
-    // suggested despite of the NEVER_SUGGEST annotation since ignoring them would make the result
-    // empty. This is a special case in which the NEVER_SUGGEST annotation is ignored.
+    // suggested despite of the LAST_RESORT_SUGGESTION annotation since ignoring them would make
+    // the result empty.
     CodeOwnersInfo codeOwnersInfo = queryCodeOwners("foo/bar/baz.md");
     assertThat(codeOwnersInfo)
         .hasCodeOwnersThat()
@@ -501,7 +507,7 @@
   }
 
   @Test
-  public void perFileCodeOwnersWithNeverSuggestAnnotation_annotationSetForAllUsersWildcard()
+  public void perFileCodeOwnersWithLastResortSuggestionAnnotation_annotationSetForAllUsersWildcard()
       throws Exception {
     skipTestIfAnnotationsNotSupportedByCodeOwnersBackend();
 
@@ -516,15 +522,16 @@
                 .addCodeOwnerEmail(CodeOwnerResolver.ALL_USERS_WILDCARD)
                 .addAnnotation(
                     CodeOwnerResolver.ALL_USERS_WILDCARD,
-                    CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                    CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addCodeOwnerEmail(admin.email())
                 .addCodeOwnerEmail(user.email())
                 .build())
         .create();
 
-    // Expectation: Since all code owners are annotated with NEVER_SUGGEST (via the annotation on
-    // the all users wildcard) the result would be empty. This is a special case in which the
-    // NEVER_SUGGEST annotation is ignored, hence we expect admin and user to be suggested.
+    // Expectation: Since all code owners are annotated with LAST_RESORT_SUGGESTION (via the
+    // annotation on the all users wildcard) the result would be empty if code owners with the
+    // LAST_RESORT_SUGGESTION annotation are omitted. Hence in this case the LAST_RESORT_SUGGESTION
+    // annotation is ignored and we expect admin and user to be suggested.
     CodeOwnersInfo codeOwnersInfo = queryCodeOwners("foo/bar/baz.md");
     assertThat(codeOwnersInfo)
         .hasCodeOwnersThat()
@@ -533,7 +540,7 @@
   }
 
   @Test
-  public void neverSuggestTakesEffectEvenIfCodeOwnerIsAlsoSpecifiedWithoutThisAnnotation()
+  public void lastResortSuggestionTakesEffectEvenIfCodeOwnerIsAlsoSpecifiedWithoutThisAnnotation()
       throws Exception {
     skipTestIfAnnotationsNotSupportedByCodeOwnersBackend();
 
@@ -549,7 +556,7 @@
         .create();
 
     // Code owner config that specifies admin multiple times as code owner, but only once with the
-    // NEVER_SUGGEST annotation.
+    // LAST_RESORT_SUGGESTION annotation.
     codeOwnerConfigOperations
         .newCodeOwnerConfig()
         .project(project)
@@ -558,7 +565,8 @@
         .addCodeOwnerSet(
             CodeOwnerSet.builder()
                 .addCodeOwnerEmail(admin.email())
-                .addAnnotation(admin.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    admin.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addCodeOwnerEmail(user.email())
                 .addCodeOwnerEmail(user2.email())
                 .build())
@@ -581,7 +589,8 @@
         .addCodeOwnerEmail(admin.email())
         .create();
 
-    // Expectation: admin is filtered out because at once place it is annotated with NEVER_SUGGEST.
+    // Expectation: admin is filtered out because at one place it is annotated with
+    // LAST_RESORT_SUGGESTION.
     CodeOwnersInfo codeOwnersInfo = queryCodeOwners("foo/bar/baz.md");
     assertThat(codeOwnersInfo)
         .hasCodeOwnersThat()
@@ -590,7 +599,7 @@
   }
 
   @Test
-  public void neverSuggestOnNonMatchingPerFileRuleDoesntHaveAnyEffect() throws Exception {
+  public void lastResortSuggestionOnNonMatchingPerFileRuleDoesntHaveAnyEffect() throws Exception {
     skipTestIfAnnotationsNotSupportedByCodeOwnersBackend();
 
     TestAccount user2 = accountCreator.user2();
@@ -606,17 +615,18 @@
                 .addCodeOwnerEmail(user.email())
                 .addCodeOwnerEmail(user2.email())
                 .build())
-        // Non-matching per-file code owner with NEVER_SUGGEST annotation.
+        // Non-matching per-file code owner with LAST_RESORT_SUGGESTION annotation.
         .addCodeOwnerSet(
             CodeOwnerSet.builder()
                 .addPathExpression(testPathExpressions.matchFileType("txt"))
                 .addCodeOwnerEmail(admin.email())
-                .addAnnotation(admin.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    admin.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .build())
         .create();
 
-    // Expectation: admin is suggested since the NEVER_SUGGEST annotation is set on the per-file
-    // rule which doesn't match.
+    // Expectation: admin is suggested since the LAST_RESORT_SUGGESTION annotation is set on the
+    // per-file rule which doesn't match.
     CodeOwnersInfo codeOwnersInfo = queryCodeOwners("foo/bar/baz.md");
     assertThat(codeOwnersInfo)
         .hasCodeOwnersThat()
@@ -751,7 +761,8 @@
                 .addCodeOwnerEmail(changeOwner.email())
                 .addCodeOwnerEmail(serviceUser.email())
                 .addCodeOwnerEmail(admin.email())
-                .addAnnotation(admin.email(), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION)
+                .addAnnotation(
+                    admin.email(), CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION)
                 .addCodeOwnerEmail(user.email())
                 .build())
         .create();
@@ -773,6 +784,7 @@
                 CodeOwner.create(serviceUser.id())),
             String.format(
                 "filtering out %s because this code owner is annotated with %s",
-                CodeOwner.create(admin.id()), CodeOwnerAnnotations.NEVER_SUGGEST_ANNOTATION.key()));
+                CodeOwner.create(admin.id()),
+                CodeOwnerAnnotations.LAST_RESORT_SUGGESTION_ANNOTATION.key()));
   }
 }
diff --git a/resources/Documentation/backend-find-owners.md b/resources/Documentation/backend-find-owners.md
index 17a267c..c6d2d79 100644
--- a/resources/Documentation/backend-find-owners.md
+++ b/resources/Documentation/backend-find-owners.md
@@ -298,28 +298,28 @@
 E.g.:
 
 ```
-  john.doe@example.com #{NEVER_SUGGEST}
-  per-file docs.config,*.md=richard.roe@example.com #{NEVER_SUGGEST}
+  john.doe@example.com #{LAST_RESORT_SUGGESTION}
+  per-file docs.config,*.md=richard.roe@example.com #{LAST_RESORT_SUGGESTION}
 ```
 \
 Annotations can be mixed with [comments](#comments) that can appear before and
 after annotations, E.g.:
 
 ```
-  jane.roe@example.com # foo bar #{NEVER_SUGGEST} baz
+  jane.roe@example.com # foo bar #{LAST_RESORT_SUGGESTION} baz
 ```
 \
 The following annotations are supported:
 
-#### <a id="neverSuggest">
-* `NEVER_SUGGEST`:
+#### <a id="lastResortSuggestion">
+* `LAST_RESORT_SUGGESTION`:
   Code owners with this annotation are omitted when [suggesting code
   owners](rest-api.html#list-code-owners-for-path-in-change), except if dropping
   these code owners would make the suggestion result empty. If code ownership is
   assigned to the same code owner through multiple relevant access grants in the
   same code owner config file or in other relevant code owner config files the
-  code owner gets omitted from the suggestion if it has the `NEVER_SUGGEST` set
-  on any of the access grants.
+  code owner gets omitted from the suggestion if it has the
+  `LAST_RESORT_SUGGESTION` set on any of the access grants.
 
 Unknown annotations are silently ignored.
 
diff --git a/resources/Documentation/rest-api.md b/resources/Documentation/rest-api.md
index 554babf..20bc94a 100644
--- a/resources/Documentation/rest-api.md
+++ b/resources/Documentation/rest-api.md
@@ -699,8 +699,8 @@
 * [service users](#serviceUsers) (members of the `Service Users` group)
 * the change owner (since the change owner cannot be added as reviewer)
 * code owners that are annotated with
-  [NEVER_SUGGEST](backend-find-owners.html#neverSuggest), except if dropping
-  these code owners would make the suggestion result empty
+  [LAST_RESORT_SUGGESTION](backend-find-owners.html#lastResortSuggestion),
+  except if dropping these code owners would make the suggestion result empty
 
 In addition, by default the change number is used as seed if none was specified.
 This way the sort order on a change is always the same for files that have the