Fix a bug with the event-based result collection.

For null incremental builds, CompletionFunctions won't be called at all. By moving the built status events to ExecutionProgressReceiver, we can make sure that the appropriate event is collected every build.

PiperOrigin-RevId: 449725542
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java b/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java
index d2193c8..ef40f22 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java
@@ -29,18 +29,21 @@
   private final TestType testType;
   private final boolean strictActionConflictCheck;
   private final boolean explicitlyRequested;
+  private final boolean isTopLevelAspectDriver;
 
   private BuildDriverKey(
       ActionLookupKey actionLookupKey,
       TopLevelArtifactContext topLevelArtifactContext,
       boolean strictActionConflictCheck,
       boolean explicitlyRequested,
+      boolean isTopLevelAspectDriver,
       TestType testType) {
     this.actionLookupKey = actionLookupKey;
     this.topLevelArtifactContext = topLevelArtifactContext;
     this.strictActionConflictCheck = strictActionConflictCheck;
-    this.testType = testType;
     this.explicitlyRequested = explicitlyRequested;
+    this.isTopLevelAspectDriver = isTopLevelAspectDriver;
+    this.testType = testType;
   }
 
   public static BuildDriverKey ofTopLevelAspect(
@@ -53,6 +56,7 @@
         topLevelArtifactContext,
         strictActionConflictCheck,
         explicitlyRequested,
+        /*isTopLevelAspectDriver=*/ true,
         TestType.NOT_TEST);
   }
 
@@ -67,6 +71,7 @@
         topLevelArtifactContext,
         strictActionConflictCheck,
         explicitlyRequested,
+        /*isTopLevelAspectDriver=*/ false,
         testType);
   }
 
@@ -94,6 +99,10 @@
     return explicitlyRequested;
   }
 
+  public boolean isTopLevelAspectDriver() {
+    return isTopLevelAspectDriver;
+  }
+
   @Override
   public SkyFunctionName functionName() {
     return SkyFunctions.BUILD_DRIVER;