Conversation
…modules Split the 1,368-line compiler_safe_outputs_consolidated.go file into 6 focused modules: - compiler_safe_outputs_core.go (674 lines): Main orchestrator, step builder, and helper functions - compiler_safe_outputs_issues.go (94 lines): Issue operations (create, update, close, link sub-issue) - compiler_safe_outputs_discussions.go (79 lines): Discussion operations (create, update, close) - compiler_safe_outputs_prs.go (304 lines): Pull request operations with pre-steps - compiler_safe_outputs_shared.go (115 lines): Shared operations (comments, labels, hide, upload) - compiler_safe_outputs_specialized.go (145 lines): Specialized operations (code scanning, milestones, agents, releases, projects) Benefits: - Improved code organization and navigation - Easier parallel development - Better separation of concerns - All files now under 700 lines (well below 800-line threshold) - All tests pass - All linting passes - No breaking changes Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰 |
|
🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS. |
|
✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️ |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Overall Status: PASS
|
|
PRs: #7260 Prefer precise version numbers in action pin algorithm; #7263 Increase skip-if-match limit to 9 in issue-monster workflow
|
Smoke Test Results✅ File Writing: Created Overall Status: ✅ PASS
|
Claude Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Overall Status: FAIL (5/6 tests passed)
|
|
Copilot Smoke Test Results (No Firewall)Last 2 Merged PRs:
Test Results:
Overall Status: PASS
|
… 6 domain-focused modules (#7262)
Problem
The
compiler_safe_outputs_consolidated.gofile grew to 1,368 lines (71% over the 800-line threshold) with 30 functions handling safe output operations for issues, PRs, discussions, and specialized operations. This made the code difficult to navigate and increased merge conflict risk.Changes
Split the monolithic file into 6 modules organized by functional domain:
Core Orchestration
compiler_safe_outputs_core.go(674 lines)buildConsolidatedSafeOutputsJobbuildConsolidatedSafeOutputStepEntity-Specific Operations
compiler_safe_outputs_issues.go(94 lines)compiler_safe_outputs_discussions.go(79 lines)compiler_safe_outputs_prs.go(304 lines)Cross-Entity Operations
compiler_safe_outputs_shared.go(115 lines)compiler_safe_outputs_specialized.go(145 lines)Result
copilot_engine.go,claude_engine.go, etc.)Original prompt
This section details on the original issue you should resolve
<issue_title>[file-diet] Refactor Large Go File: pkg/workflow/compiler_safe_outputs_consolidated.go</issue_title>
<issue_description>## Overview
The file
pkg/workflow/compiler_safe_outputs_consolidated.gohas grown to 1,368 lines, making it difficult to maintain and test effectively. This file orchestrates the consolidated safe outputs job compilation and contains 30 functions, primarily consisting of step configuration builders for different safe output operations (issues, PRs, discussions, etc.).Current State
pkg/workflow/compiler_safe_outputs_consolidated.gocompiler_safe_outputs_consolidated_test.godoes not exist)Architecture Analysis
The file follows a clear but repetitive pattern:
SafeOutputStepConfigstruct definitionbuildConsolidatedSafeOutputsJob- main orchestrator (499 lines)Current Groupings Identified
GitHub Issues Operations (5 functions):
buildCreateIssueStepConfigbuildUpdateIssueStepConfigbuildCloseIssueStepConfigbuildLinkSubIssueStepConfigPull Request Operations (6 functions):
buildCreatePullRequestStepConfigbuildUpdatePullRequestStepConfigbuildClosePullRequestStepConfigbuildCreatePRReviewCommentStepConfigbuildPushToPullRequestBranchStepConfigbuildAddReviewerStepConfigDiscussion Operations (3 functions):
buildCreateDiscussionStepConfigbuildUpdateDiscussionStepConfigbuildCloseDiscussionStepConfigShared Operations (4 functions):
buildAddCommentStepConfig(works with issues, PRs, discussions)buildAddLabelsStepConfigbuildHideCommentStepConfigbuildUploadAssetsStepConfigSpecialized Operations (7 functions):
buildCreateCodeScanningAlertStepConfigbuildAssignMilestoneStepConfigbuildAssignToAgentStepConfigbuildAssignToUserStepConfigbuildUpdateReleaseStepConfigbuildCreateAgentTaskStepConfigbuildUpdateProjectStepConfigRefactoring Strategy
Proposed File Splits
Split the monolithic file into 6 focused modules based on functional domains:
1.
compiler_safe_outputs_core.go(~200 lines)Responsibility: Core orchestration and shared utilities
Contents:
SafeOutputStepConfigstruct definitionbuildConsolidatedSafeOutputsJobmain orchestratorbuildConsolidatedSafeOutputStephelperbuildJobLevelSafeOutputEnvVarshelperbuildDetectionSuccessConditionhelperRationale: Central coordination logic used by all step builders
2.
compiler_safe_outputs_issues.go(~200 lines)Responsibility: Issue-related safe output operations
Contents:
buildCreateIssueStepConfigbuildUpdateIssueStepConfigbuildCloseIssueStepConfigbuildLinkSubIssueStepConfigEstimated LOC: ~200 lines
3.
compiler_safe_outputs_prs.go(~300 lines)Responsibility: Pull request operations
Contents:
buildCreatePullRequestStepConfigbuildUpdatePullRequestStepConfigbuildClosePullRequestStepConfigbuildCreatePRReviewCommentStepConfigbuildPushToPullRequestBranchStepConfigbuildAddReviewerStepConfigbuildCreatePullRequestPreStepsConsolidatedbuildPushToPullRequestBranchPreStepsConsolidatedEstimated LOC: ~300 lines (includes pre-steps logic)
4.
compiler_safe_outputs_discussions.go(~150 lines)Responsibility: Discussion operations
Contents:
buildCreateDiscussionStepConfigbuildUpdateDiscussionStepConfigbuildCloseDiscussionStepConfigEstimated LOC: ~150 lines
5.
compiler_safe_outputs_shared.go(~200 lines)Responsibility: Operations that work across multiple entity types
Contents:
buildAddCommentStepConfig(issues, PRs, discussions)buildAddLabelsStepConfigbuildHideCommentStepConfigbuildUploadAssetsStepConfigEstimated LOC: ~200 lines
6.
compiler_safe_outputs_specialized.go(~318 lines)Responsibility: Specialized/less common operations
Contents:
buildCreateCodeScanningAlertStepConfigbuildAssignMilestoneStepConfigbuildAssignToAgentStepConfigbuildAssignToUserStepConfigbuildUpdateReleaseStepConfigbuildCreateAgentTaskStepConfigbuildUpdateProjectStepConfigEstimated LOC: ~318 lines
Benefits of This Split
✅ **Im...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.