Skip to content

[production][trigger_workflow#create] undefined method 'map' for an instance of String#19435

Draft
sujanyd wants to merge 2 commits intoopenSUSE:masterfrom
sujanyd:sujan
Draft

[production][trigger_workflow#create] undefined method 'map' for an instance of String#19435
sujanyd wants to merge 2 commits intoopenSUSE:masterfrom
sujanyd:sujan

Conversation

@sujanyd
Copy link
Copy Markdown

@sujanyd sujanyd commented Mar 15, 2026

Problem
The workflow trigger process would crash with a 500 Internal Server Error (NoMethodError: undefined method 'map' for String) if the .obs/workflows.yml file contained malformed structures. This happened when strings were used instead of expected arrays or hashes in filters or step definitions.

Solution
Model Hardening:
-> Updated Workflowto use Array.wrap for only and ignore branch filters, safely handling both single strings and arrays.
-> Added guards in Workflow#steps to skip non-Hash step definitions early.
-> Updated the ConfigureRepositories step to safely handle malformed repository lists.

Improved Validation:
-> Enhanced WorkflowFiltersValidator and WorkflowStepsValidator to detect incorrect data types and return user-friendly validation errors instead of crashing.

Regression Testing:
-> Added a new spec spec/models/workflow_crash_repro_spec.rb covering various malformed YAML scenarios to ensure the fix is robust.

Verification
-> Verified that malformed YAML now results in a clean error message (e.g., "filter definition is wrong: expected a YAML mapping, got String") instead of a server crash.
-> Confirmed that the fix correctly addresses the NoMethodError reported in the issue.

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend Things related to the OBS RoR app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant