Skip to content

Commit

Permalink
Set keywords on appropriate lifecycle events.
Browse files Browse the repository at this point in the history
The docs for the PublishLifecycleEventRequest say that the notification_keywords field should be set if the build event is InvocationAttemptStarted or BuildEnqueued. However, Bazel did not conform to this spec.
  • Loading branch information
benjaminp committed Apr 5, 2022
1 parent c7c3fa1 commit b05653b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ public PublishLifecycleEventRequest.Builder lifecycleEvent(@Nullable String proj
if (projectId != null) {
builder.setProjectId(projectId);
}
switch (lifecycleEvent.getEventCase()) {
case BUILD_ENQUEUED:
case INVOCATION_ATTEMPT_STARTED:
builder.addAllNotificationKeywords(getKeywords());
break;
default:
break;
}
return builder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void testBuildEnqueued() {
PublishLifecycleEventRequest.newBuilder()
.setServiceLevel(ServiceLevel.INTERACTIVE)
.setProjectId(PROJECT_ID)
.addAllNotificationKeywords(EXPECTED_KEYWORDS)
.setBuildEvent(
OrderedBuildEvent.newBuilder()
.setStreamId(
Expand All @@ -92,6 +93,7 @@ public void testInvocationAttemptStarted() {
PublishLifecycleEventRequest.newBuilder()
.setServiceLevel(ServiceLevel.INTERACTIVE)
.setProjectId(PROJECT_ID)
.addAllNotificationKeywords(EXPECTED_KEYWORDS)
.setBuildEvent(
OrderedBuildEvent.newBuilder()
.setStreamId(
Expand Down

0 comments on commit b05653b

Please sign in to comment.