Skip to content

Add "imports" field to frontmatter for importing workflow specifications#1249

Merged
pelikhan merged 5 commits intomainfrom
copilot/add-imports-field-to-front-matter
Oct 6, 2025
Merged

Add "imports" field to frontmatter for importing workflow specifications#1249
pelikhan merged 5 commits intomainfrom
copilot/add-imports-field-to-front-matter

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 6, 2025

  • Explore repository structure and understand how @include directives work
  • Review schema structure and frontmatter parsing
  • Review add/update command implementations
  • Add "imports" field to main_workflow_schema.json
  • Update parser to handle imports field in frontmatter (ProcessImportsFromFrontmatter)
  • Update compiler to process imports before @include directives
  • Update add command to process imports field with workflowspec
  • Update update command to process imports field
  • Add tests for imports field functionality
  • Run make agent-finish to validate all changes
  • Address code review feedback:
    • Use workflow.MarshalWithFieldOrder instead of yaml.Marshal
    • Add "imports" to PriorityWorkflowFields list for consistent field ordering
    • Refactor to use helper function for reconstructing workflow files

Changes Made

Code Review Feedback Addressed:

  1. YAML Marshal Helpers: Updated processImportsWithWorkflowSpec to use workflow.MarshalWithFieldOrder with constants.PriorityWorkflowFields for proper field ordering
  2. Field Priority List: Added "imports" to PriorityWorkflowFields in pkg/constants/constants.go (positioned after "network" and before "safe-outputs")
  3. Refactored Helper: Created reconstructWorkflowFileFromMap helper function that uses the proper YAML marshaling and workflow.UnquoteYAMLKey to handle the "on" key correctly

All tests pass and workflows compile successfully.

Original prompt

Add "imports" field to the front matter that takes an array of workflowspec to import (similar to @include)

  • add to schema
  • add to parser, store imports in workflow data
  • update "add", "update" command

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits October 6, 2025 09:22
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] Add imports field to front matter for workflow specifications Add "imports" field to frontmatter for importing workflow specifications Oct 6, 2025
Copilot AI requested a review from pelikhan October 6, 2025 09:28
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 6, 2025

@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 2ffe032a-32e3-4b8c-b66d-f70c81e33a9f

Sorry for the inconvenience!

…y list

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan October 6, 2025 14:54
@pelikhan pelikhan marked this pull request as ready for review October 6, 2025 15:31
@pelikhan pelikhan merged commit 1f27cc4 into main Oct 6, 2025
11 checks passed
@pelikhan pelikhan deleted the copilot/add-imports-field-to-front-matter branch October 6, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants