Extract extraction functions from compiler.go to frontmatter_extraction.go#2283
Merged
Extract extraction functions from compiler.go to frontmatter_extraction.go#2283
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Extract functions from compiler.go to frontmatter_extraction.go
Extract extraction functions from compiler.go to frontmatter_extraction.go
Oct 24, 2025
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Refactored frontmatter extraction logic by consolidating 13 extraction/parsing functions into a dedicated
frontmatter_extraction.gofile. This improves code organization and makes extraction logic easier to find, test, and maintain.Changes
File Reorganization
pkg/workflow/parse_utils.go→pkg/workflow/frontmatter_extraction.gopkg/workflow/compiler.goby 435 linespkg/workflow/network.goby 35 linesFunctions Moved to frontmatter_extraction.go
From compiler.go (12 functions):
extractTopLevelYAMLSection- Extracts top-level YAML sections with field orderingextractPermissions- Extracts permissions using the permission parserextractIfCondition- Extracts if conditions without prefixextractFeatures- Extracts feature flags mapextractDescription- Extracts description fieldextractSource- Extracts source fieldextractSafetyPromptSetting- Extracts safety-prompt setting from toolsextractToolsTimeout- Extracts timeout setting from toolsextractToolsStartupTimeout- Extracts startup-timeout setting from toolsextractExpressionFromIfString- Extracts expression from if stringextractCommandConfig- Extracts command configuration including name and eventsextractYAMLValue- Extracts scalar values from frontmatter (already existed in parse_utils.go)From network.go (1 function):
extractNetworkPermissions- Extracts network permissions (was misplaced in runtime file)Helper functions also moved:
commentOutProcessedFieldsInOnSection- Used by extractTopLevelYAMLSectionbuildSourceURL- Used by extractSource and safe output filesBenefits
Testing
Closes #2274 (part of #2273)
Original prompt
Fixes #2276
💡 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.