Read the enablement check result by reader or key

Cause

just lab enablement-check indexed the service result with result[:enabled] and stopped with undefined method '[]' for EnablementCheckService::Result on GitLab 19.5.3. At the v19.5.3-ee tag execute returns a Result object with one reader per field (enabled, create_duo_workflow_for_ci_allowed, checks, remote_flows_enabled, foundational_flows_enabled, enabled_foundational_flows) and neither #[] nor #to_h: https://gitlab.com/gitlab-org/gitlab/-/blob/v19.5.3-ee/ee/app/services/ai/duo_workflows/enablement_check_service.rb#L9-L73. execute returns nil when the user cannot read the project (line 81 of the same file). Master carries the same file.

Fix

The snippet moves from simulation.sh to gce/ruby/enablement_check.rb, like the other primitives. Each field is read through its reader when the result responds to it, else by key, so a GitLab that still returns a Hash works. A nil result now fails with a message.

The engine self-test runs the primitive against a stubbed service that returns each shape. The object case fails against the old indexing and passes now.

No skill Markdown changes, so word-budget moves by zero words.

Merge request reports

Loading
Loading