Skip to content

[Code Quality] Standardize safe-outputs naming: singular vs plural convention #13692

@github-actions

Description

@github-actions

Description

There's naming inconsistency between schema property names (singular) and compiler struct names (plural), with mixed YAML tags causing confusion. This was identified in Schema Consistency Analysis #13673.

Current Inconsistency

Schema uses SINGULAR:

  • create-issue
  • close-issue
  • create-pull-request

Compiler structs use MIXED naming:

// pkg/workflow/compiler_types.go:439-445
CreateIssues      *CreateIssuesConfig      `yaml:"create-issues,omitempty"`   // ✅ Both plural
CloseIssues       *CloseIssuesConfig       `yaml:"close-issue,omitempty"`     // ❌ Struct plural, tag SINGULAR
UpdateIssues      *UpdateIssuesConfig      `yaml:"update-issues,omitempty"`   // ✅ Both plural
CreateDiscussions *CreateDiscussionsConfig `yaml:"create-discussions,omitempty"` // ✅ Both plural

Impact

  • Maintainability confusion - Struct name doesn't match YAML tag
  • Documentation ambiguity - Not clear which convention to use
  • Developer experience - Mixed signals about correct naming

Suggested Changes

Option A: Standardize on SINGULAR (Recommended)

Pros:

  • Matches existing schema
  • Less breaking change
  • Aligns with field name pattern

Changes needed:

  1. Update struct field names to singular
  2. Keep YAML tags singular (some already are)
  3. Update all references in code
// After refactoring
CreateIssue      *CreateIssueConfig      `yaml:"create-issue,omitempty"`
CloseIssue       *CloseIssueConfig       `yaml:"close-issue,omitempty"`
UpdateIssue      *UpdateIssueConfig      `yaml:"update-issue,omitempty"`
CreateDiscussion *CreateDiscussionConfig `yaml:"create-discussion,omitempty"`

Option B: Standardize on PLURAL

Pros:

  • Matches some existing struct names
  • Semantically correct (creates multiple issues)

Cons:

  • Requires schema changes
  • Breaking change for existing workflows

Files Affected

  • pkg/workflow/compiler_types.go - Struct definitions
  • pkg/workflow/compiler_safe_outputs.go - Safe outputs compilation
  • pkg/parser/schemas/main_workflow_schema.json - Schema (if plural chosen)
  • All files referencing these structs

Success Criteria

  • Choose singular OR plural convention
  • Update all struct names to match convention
  • Update all YAML tags to match convention
  • Update schema if necessary
  • Update documentation
  • All tests pass
  • No breaking changes for existing workflows (if singular chosen)

Recommended Approach

Phase 1: Analysis (30 minutes)

  • Audit all safe-outputs struct references
  • Count breaking changes for each option
  • Verify workflow compatibility

Phase 2: Implementation (2-3 hours)

  • Rename structs consistently
  • Update YAML tags
  • Update all code references
  • Run tests

Phase 3: Documentation (1 hour)

  • Update API docs
  • Update examples
  • Add migration notes if breaking

Source

Extracted from Schema Consistency Analysis discussion #13673

Priority: Medium - Code consistency improvement

AI generated by Discussion Task Miner - Code Quality Improvement Agent

  • expires on Feb 18, 2026, 9:12 AM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions