Consolidate workplan_score feature flag into workplan

What does this MR do and why?

Consolidates the workplan_score beta feature flag into the existing workplan flag for GraphQL, the work item callback, services, flows, MCP tools, and the frontend. The workplan_score flag definition is kept because the REST work item entity still uses it; a follow-up MR removes that check and the flag.

Actor change: workplan_score was checked against the user (Feature.enabled?(:workplan_score, current_user)). workplan is checked against the root namespace. Every former workplan_score check changed in this MR now uses :workplan with the root ancestor as actor, so rollout of the readiness score is consistent across a group hierarchy and is no longer per user. Enabling workplan only for a subgroup, a project, or a user does not enable the score.

  • GraphQL: the readinessScore, readinessScoreFeedback, and readinessScoreFeedbackHtml resolvers return null when workplan is disabled for the work item's root ancestor. Field and workItemGenerateReadinessScore mutation descriptions now name workplan.
  • WorkItems::Callbacks::AgentPlan: score and feedback writes are rejected when workplan is disabled for the work item's root ancestor, using the same check as the read path. The error strings in locale/gitlab.pot now name workplan. When workplan is fully disabled, the agent plan widget itself is unavailable, so GraphQL and the MCP save_work_item tool fail earlier with widget keys are not supported, and the REST API ignores the agent_plan feature.
  • GenerateReadinessScoreService: checks :workplan against project.root_ancestor, the same actor as GenerateWorkplanService.
  • Flows: readiness_score/v1 is gated by workplan. The workplan/v1 version resolver no longer checks workplan_score: it resolves 1.3.0 when Software Factory is enabled and 1.1.0 otherwise. The 1.0.0 fallback existed only for users without workplan_score, because the callback rejected the scoring write that 1.1.0 ends with. With both now gated by workplan, that case no longer exists.
  • Frontend: removed the workplanScore push from both work item controllers and the useScore / includeReadinessScore gating from the implementation widget, workplan, and sticky header components, the agent plan queries, mutations, subscription, and writeAgentPlanToCache. readinessScore is now always part of the agent plan fragment, and the cache write after a plan edit uses the score from the mutation response.
  • Docs and tooling: updated the workplan readiness score history, the MCP save_work_item tool description and docs, and the seeder. Regenerated the GraphQL reference and introspection schema. doc-locale/ and locale/*/gitlab.po are untouched.
  • Kept for follow-up: config/feature_flags/beta/workplan_score.yml and the workplan_score check in ee/lib/api/entities/work_items/features/agent_plan.rb, which still controls whether REST responses expose readiness_score.

Rollout note

Anyone who had workplan_score enabled for a user but workplan disabled for the root namespace no longer sees the score. Before merging, enable workplan for the root namespaces that should keep the score.

During the rolling deploy, a workplan/v1 flow can fail at its final readiness score write if that write lands on a node still running the old code and the user does not have workplan_score enabled. This failure window is accepted because the feature is experimental, and it ends when the deploy completes.

References

Screenshots or screen recordings

Not applicable. The UI is unchanged for users who had both flags enabled; only the flag that controls it changes.

How to set up and validate locally

  1. Enable workplan for a root group: Feature.enable(:workplan, group). Leave workplan_score disabled.
  2. Open a project work item in that group and confirm the Workplan widget and the readiness score render.
  3. Enable workplan only for a subgroup or project instead of the root group, and confirm the score is hidden and that setting readinessScore through workItemUpdate returns the requires the workplan feature flag error.
  4. Disable workplan and confirm the widget and score are hidden.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Naman Jagdish Gala

Merge request reports

Loading
Loading