Skip to content

Commit

Permalink
Fix 'bazel' status reported for each workflow (#6965)
Browse files Browse the repository at this point in the history
  • Loading branch information
bduffany authored Jul 1, 2024
1 parent 0e46543 commit 608a7ff
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions enterprise/server/cmd/ci_runner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,28 @@ func (ar *actionRunner) Run(ctx context.Context, ws *workspace) error {
// because that error is instead surfaced in the caller func when calling
// `buildEventPublisher.Wait()`

wfc := &bespb.WorkflowConfigured{
WorkflowId: *workflowID,
ActionName: getActionNameForWorkflowConfiguredEvent(),
ActionTriggerEvent: *triggerEvent,
PushedRepoUrl: *pushedRepoURL,
PushedBranch: *pushedBranch,
CommitSha: *commitSHA,
TargetRepoUrl: *targetRepoURL,
TargetBranch: *targetBranch,
Os: runtime.GOOS,
Arch: runtime.GOARCH,
}
wfcEvent := &bespb.BuildEvent{
Id: &bespb.BuildEventId{Id: &bespb.BuildEventId_WorkflowConfigured{WorkflowConfigured: &bespb.BuildEventId_WorkflowConfiguredId{}}},
Payload: &bespb.BuildEvent_WorkflowConfigured{WorkflowConfigured: wfc},
}
if ar.isWorkflow {
if err := ar.reporter.Publish(wfcEvent); err != nil {
return nil
}
}

buildMetadata := &bespb.BuildMetadata{
Metadata: map[string]string{},
}
Expand Down Expand Up @@ -903,28 +925,6 @@ func (ar *actionRunner) Run(ctx context.Context, ws *workspace) error {
// Only print this to the local logs -- it's mostly useful for development purposes.
log.Infof("Invocation URL: %s", invocationURL(ar.reporter.InvocationID()))

wfc := &bespb.WorkflowConfigured{
WorkflowId: *workflowID,
ActionName: getActionNameForWorkflowConfiguredEvent(),
ActionTriggerEvent: *triggerEvent,
PushedRepoUrl: *pushedRepoURL,
PushedBranch: *pushedBranch,
CommitSha: *commitSHA,
TargetRepoUrl: *targetRepoURL,
TargetBranch: *targetBranch,
Os: runtime.GOOS,
Arch: runtime.GOARCH,
}
wfcEvent := &bespb.BuildEvent{
Id: &bespb.BuildEventId{Id: &bespb.BuildEventId_WorkflowConfigured{WorkflowConfigured: &bespb.BuildEventId_WorkflowConfiguredId{}}},
Payload: &bespb.BuildEvent_WorkflowConfigured{WorkflowConfigured: wfc},
}
if ar.isWorkflow {
if err := ar.reporter.Publish(wfcEvent); err != nil {
return nil
}
}

if err := ws.setup(ctx); err != nil {
return status.WrapError(err, "failed to set up git repo")
}
Expand Down

0 comments on commit 608a7ff

Please sign in to comment.