Skip to content

Add support for silently ignoring description and applyTo fields in frontmatter#2266

Merged
pelikhan merged 6 commits intomainfrom
copilot/add-support-ignore-fields-silently
Oct 24, 2025
Merged

Add support for silently ignoring description and applyTo fields in frontmatter#2266
pelikhan merged 6 commits intomainfrom
copilot/add-support-ignore-fields-silently

Conversation

Copy link
Contributor

Copilot AI commented Oct 24, 2025

Task: Add support for silently ignoring specific fields in frontmatter

Plan ✅ Complete

  • Explore repository structure and understand frontmatter parsing
  • Identify where schema validation happens
  • Understand that description is already in schema but should be silently ignored
  • Understand that applyTo is not in schema and will cause validation errors
  • Add helper function to filter ignored fields from frontmatter before validation
  • Update validation calls to filter out ignored fields (description, applyTo)
  • Create tests to verify fields are silently ignored
  • Run tests to ensure no regressions
  • Verify manually that ignored fields don't cause errors
  • Run linter and fix formatting
  • Run make agent-finish for complete validation
  • Move ignoredFields to constants.IgnoredFrontmatterFields (feedback addressed)

Implementation Summary

Successfully added support for silently ignoring description and applyTo fields in frontmatter during validation.

Changes Made:

  1. pkg/constants/constants.go:

    • Added IgnoredFrontmatterFields variable listing fields to ignore: ["description", "applyTo"]
  2. pkg/parser/schema.go:

    • Removed local ignoredFields variable
    • Added import for constants package
    • Created filterIgnoredFields() helper function that uses constants.IgnoredFrontmatterFields
    • Updated 4 validation functions to filter ignored fields:
      • ValidateMainWorkflowFrontmatterWithSchema()
      • ValidateMainWorkflowFrontmatterWithSchemaAndLocation()
      • ValidateIncludedFileFrontmatterWithSchema()
      • ValidateIncludedFileFrontmatterWithSchemaAndLocation()
  3. pkg/parser/schema_test.go:

    • Added import for constants package
    • Updated test to reference constants.IgnoredFrontmatterFields
    • Added TestFilterIgnoredFields() - 6 test cases for the filtering function
    • Added TestValidateMainWorkflowWithIgnoredFields() - 4 test cases for main workflow validation
    • Added TestValidateIncludedFileWithIgnoredFields() - 3 test cases for included file validation

Test Results:

  • ✅ All 13 new tests pass
  • ✅ All existing unit tests pass (no regressions)
  • ✅ All quality checks pass:
    • Code linting: PASS
    • Code formatting: PASS

Manual Verification:

  • ✅ Workflow with description field compiles successfully (no errors/warnings)
  • ✅ Workflow with applyTo field compiles successfully (no errors/warnings)
  • ✅ Workflow with both fields compiles successfully (no errors/warnings)
  • ✅ Invalid fields still trigger validation errors correctly

Key Features:

  • Fields are silently ignored (no warnings or errors)
  • Original frontmatter is not modified (filtered copy used)
  • Other schema validation still works correctly
  • Minimal and surgical implementation
  • Constants are now centralized in pkg/constants/constants.go
Original prompt

Add support for ignoring specific fields silently in the front matter:

  • description
  • applyTo

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Oct 24, 2025
…rontmatter

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 support for ignoring specific fields silently in front matter Add support for silently ignoring description and applyTo fields in frontmatter Oct 24, 2025
Copilot AI requested a review from pelikhan October 24, 2025 04:41
Copilot AI and others added 2 commits October 24, 2025 04:49
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review October 24, 2025 04:55
@github-actions
Copy link
Contributor

Agentic Changeset Generator triggered by this pull request.

@pelikhan pelikhan merged commit 4fcfdc4 into main Oct 24, 2025
3 checks passed
@pelikhan pelikhan deleted the copilot/add-support-ignore-fields-silently branch October 24, 2025 04:59
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