From 8957e90dca38e0ac1497d9dca18b8f5064ef6d39 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 23:03:24 +0000 Subject: [PATCH 1/5] Initial plan From 9aab9ce01b4083f9b48dd0d0ac2b4f514d61a09b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 23:13:37 +0000 Subject: [PATCH 2/5] Include noop issue expiry in maintenance workflow scan Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/workflow/maintenance_workflow.go | 17 +++++++++++++- pkg/workflow/maintenance_workflow_test.go | 28 +++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/pkg/workflow/maintenance_workflow.go b/pkg/workflow/maintenance_workflow.go index 644ac7e955f..38fb8ba092b 100644 --- a/pkg/workflow/maintenance_workflow.go +++ b/pkg/workflow/maintenance_workflow.go @@ -122,8 +122,10 @@ type GenerateMaintenanceWorkflowOptions struct { RepoSlug string } +const noopRunsIssueExpiresHours = 24 * 30 + // GenerateMaintenanceWorkflow generates the agentics-maintenance.yml workflow -// if any workflows use the expires field for discussions or issues. +// if any workflows use expiring safe outputs or noop issue reporting. // When opts.RepoConfig is non-nil and opts.RepoConfig.MaintenanceDisabled is true the // maintenance workflow is deleted and the function returns immediately. // opts.RepoSlug is the owner/repo slug used to determine the default branch for the push @@ -343,6 +345,19 @@ func scanWorkflowsForExpires(workflowDataList []*WorkflowData) (bool, int) { } } } + // Check for no-op runs issue expiration (runtime defaults to 30 days) + if workflowData.SafeOutputs.NoOp != nil { + reportAsIssue := workflowData.SafeOutputs.NoOp.ReportAsIssue + noopReportAsIssueEnabled := reportAsIssue == nil || !strings.EqualFold(strings.TrimSpace(*reportAsIssue), "false") + if noopReportAsIssueEnabled { + hasExpires = true + expires := noopRunsIssueExpiresHours + maintenanceLog.Printf("Workflow %s has noop report-as-issue enabled, using %d-hour noop issue expiration", workflowData.Name, expires) + if minExpires == 0 || expires < minExpires { + minExpires = expires + } + } + } } return hasExpires, minExpires diff --git a/pkg/workflow/maintenance_workflow_test.go b/pkg/workflow/maintenance_workflow_test.go index 66de6989e39..2d8e294854c 100644 --- a/pkg/workflow/maintenance_workflow_test.go +++ b/pkg/workflow/maintenance_workflow_test.go @@ -145,6 +145,34 @@ func TestGenerateMaintenanceWorkflow_WithExpires(t *testing.T) { expectWorkflowGenerated: true, expectError: false, }, + { + name: "with noop report-as-issue default - should generate workflow", + workflowDataList: []*WorkflowData{ + { + Name: "noop-default-workflow", + SafeOutputs: &SafeOutputsConfig{ + NoOp: &NoOpConfig{}, + }, + }, + }, + expectWorkflowGenerated: true, + expectError: false, + }, + { + name: "with noop report-as-issue false - should NOT generate workflow", + workflowDataList: []*WorkflowData{ + { + Name: "noop-disabled-report-workflow", + SafeOutputs: &SafeOutputsConfig{ + NoOp: &NoOpConfig{ + ReportAsIssue: strPtr("false"), + }, + }, + }, + }, + expectWorkflowGenerated: false, + expectError: false, + }, } for _, tt := range tests { From 9d4b45068ae8582d481371a4c20cc0c9e9b5d8df Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 23:14:53 +0000 Subject: [PATCH 3/5] Refine noop report-as-issue expiry handling tests Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/workflow/maintenance_workflow.go | 8 +++++--- pkg/workflow/maintenance_workflow_test.go | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/pkg/workflow/maintenance_workflow.go b/pkg/workflow/maintenance_workflow.go index 38fb8ba092b..1f3f1bcb4b7 100644 --- a/pkg/workflow/maintenance_workflow.go +++ b/pkg/workflow/maintenance_workflow.go @@ -124,6 +124,10 @@ type GenerateMaintenanceWorkflowOptions struct { const noopRunsIssueExpiresHours = 24 * 30 +func isNoOpReportAsIssueEnabled(reportAsIssue *string) bool { + return reportAsIssue == nil || !strings.EqualFold(strings.TrimSpace(*reportAsIssue), "false") +} + // GenerateMaintenanceWorkflow generates the agentics-maintenance.yml workflow // if any workflows use expiring safe outputs or noop issue reporting. // When opts.RepoConfig is non-nil and opts.RepoConfig.MaintenanceDisabled is true the @@ -347,9 +351,7 @@ func scanWorkflowsForExpires(workflowDataList []*WorkflowData) (bool, int) { } // Check for no-op runs issue expiration (runtime defaults to 30 days) if workflowData.SafeOutputs.NoOp != nil { - reportAsIssue := workflowData.SafeOutputs.NoOp.ReportAsIssue - noopReportAsIssueEnabled := reportAsIssue == nil || !strings.EqualFold(strings.TrimSpace(*reportAsIssue), "false") - if noopReportAsIssueEnabled { + if isNoOpReportAsIssueEnabled(workflowData.SafeOutputs.NoOp.ReportAsIssue) { hasExpires = true expires := noopRunsIssueExpiresHours maintenanceLog.Printf("Workflow %s has noop report-as-issue enabled, using %d-hour noop issue expiration", workflowData.Name, expires) diff --git a/pkg/workflow/maintenance_workflow_test.go b/pkg/workflow/maintenance_workflow_test.go index 2d8e294854c..5c3beac7d44 100644 --- a/pkg/workflow/maintenance_workflow_test.go +++ b/pkg/workflow/maintenance_workflow_test.go @@ -173,6 +173,21 @@ func TestGenerateMaintenanceWorkflow_WithExpires(t *testing.T) { expectWorkflowGenerated: false, expectError: false, }, + { + name: "with noop report-as-issue true - should generate workflow", + workflowDataList: []*WorkflowData{ + { + Name: "noop-explicit-report-workflow", + SafeOutputs: &SafeOutputsConfig{ + NoOp: &NoOpConfig{ + ReportAsIssue: strPtr("true"), + }, + }, + }, + }, + expectWorkflowGenerated: true, + expectError: false, + }, } for _, tt := range tests { From ee1de4d372a12477450615ec2bab0079f7bae2fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 23:15:44 +0000 Subject: [PATCH 4/5] Polish no-op expiry constant naming and logging Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/workflow/maintenance_workflow.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/workflow/maintenance_workflow.go b/pkg/workflow/maintenance_workflow.go index 1f3f1bcb4b7..3a9848c6d7e 100644 --- a/pkg/workflow/maintenance_workflow.go +++ b/pkg/workflow/maintenance_workflow.go @@ -122,7 +122,7 @@ type GenerateMaintenanceWorkflowOptions struct { RepoSlug string } -const noopRunsIssueExpiresHours = 24 * 30 +const defaultNoOpIssueExpirationHours = 24 * 30 func isNoOpReportAsIssueEnabled(reportAsIssue *string) bool { return reportAsIssue == nil || !strings.EqualFold(strings.TrimSpace(*reportAsIssue), "false") @@ -353,8 +353,8 @@ func scanWorkflowsForExpires(workflowDataList []*WorkflowData) (bool, int) { if workflowData.SafeOutputs.NoOp != nil { if isNoOpReportAsIssueEnabled(workflowData.SafeOutputs.NoOp.ReportAsIssue) { hasExpires = true - expires := noopRunsIssueExpiresHours - maintenanceLog.Printf("Workflow %s has noop report-as-issue enabled, using %d-hour noop issue expiration", workflowData.Name, expires) + expires := defaultNoOpIssueExpirationHours + maintenanceLog.Printf("Workflow %s has no-op report-as-issue enabled, using %d-hour no-op issue expiration", workflowData.Name, expires) if minExpires == 0 || expires < minExpires { minExpires = expires } From 4d06484b356948bedaa01947f0fa06670ea96631 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Jun 2026 23:43:36 +0000 Subject: [PATCH 5/5] Fix compile maintenance test for noop default expiry behavior Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/compile_maintenance_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cli/compile_maintenance_test.go b/pkg/cli/compile_maintenance_test.go index 8da2f28931d..c49434d8ba3 100644 --- a/pkg/cli/compile_maintenance_test.go +++ b/pkg/cli/compile_maintenance_test.go @@ -141,6 +141,7 @@ engine: copilot safe-outputs: create-issue: max: 1 + noop: false --- Test workflow that creates issues without expiration.