aboutsummaryrefslogtreecommitdiffstats
path: root/syz-cluster/workflow
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-01-22 15:11:49 +0100
committerAleksandr Nogikh <nogikh@google.com>2025-01-27 08:57:27 +0000
commit44a4bf20877715222e99bbf3aa82a6ec33857148 (patch)
treec67db0fb6e6373660231330a9d20849877276382 /syz-cluster/workflow
parent0d4dc8c3e85c8d0cd8c7a5b3d1079da2ef51cf48 (diff)
syz-cluster: explicitly set the skip reason
It lets immediately distinguish the series that were actually processed from the series that were skipped early on. By storing a string, we also make it apparent why exactly the series was skipped.
Diffstat (limited to 'syz-cluster/workflow')
-rw-r--r--syz-cluster/workflow/triage-step/main.go22
1 files changed, 16 insertions, 6 deletions
diff --git a/syz-cluster/workflow/triage-step/main.go b/syz-cluster/workflow/triage-step/main.go
index 6a45972ea..e992942e3 100644
--- a/syz-cluster/workflow/triage-step/main.go
+++ b/syz-cluster/workflow/triage-step/main.go
@@ -31,10 +31,17 @@ func main() {
if err != nil {
app.Fatalf("failed to initialize the repository: %v", err)
}
- verdict, err := getVerdict(*flagSession, client, repo)
+ ctx := context.Background()
+ verdict, err := getVerdict(ctx, client, repo)
if err != nil {
app.Fatalf("failed to get the verdict: %v", err)
}
+ if verdict.Skip != nil {
+ err := client.SkipSession(context.Background(), *flagSession, verdict.Skip)
+ if err != nil {
+ app.Fatalf("failed to upload the skip reason: %v", err)
+ }
+ }
if *flagVerdict != "" {
osutil.WriteJSON(*flagVerdict, verdict)
}
@@ -44,9 +51,8 @@ func main() {
// 2. What if controller does not reply? Let Argo just restart the step.
}
-func getVerdict(sessionID string, client *api.Client, ops triage.TreeOps) (*api.TriageResult, error) {
- ctx := context.Background()
- series, err := client.GetSessionSeries(ctx, sessionID)
+func getVerdict(ctx context.Context, client *api.Client, ops triage.TreeOps) (*api.TriageResult, error) {
+ series, err := client.GetSessionSeries(ctx, *flagSession)
if err != nil {
// TODO: the workflow step must be retried.
return nil, fmt.Errorf("failed to query series: %w", err)
@@ -54,7 +60,9 @@ func getVerdict(sessionID string, client *api.Client, ops triage.TreeOps) (*api.
tree := triage.SelectTree(series, client.GetTrees())
if tree == nil {
return &api.TriageResult{
- Skip: true,
+ Skip: &api.SkipRequest{
+ Reason: "no suitable kernel tree found",
+ },
}, nil
}
arch := "amd64"
@@ -75,7 +83,9 @@ func getVerdict(sessionID string, client *api.Client, ops triage.TreeOps) (*api.
}
if len(commits) == 0 {
return &api.TriageResult{
- Skip: true,
+ Skip: &api.SkipRequest{
+ Reason: "no suitable commits found",
+ },
}, nil
}
ret := &api.TriageResult{}