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, andreadinessScoreFeedbackHtmlresolvers return null whenworkplanis disabled for the work item's root ancestor. Field andworkItemGenerateReadinessScoremutation descriptions now nameworkplan. WorkItems::Callbacks::AgentPlan: score and feedback writes are rejected whenworkplanis disabled for the work item's root ancestor, using the same check as the read path. The error strings inlocale/gitlab.potnow nameworkplan. Whenworkplanis fully disabled, the agent plan widget itself is unavailable, so GraphQL and the MCPsave_work_itemtool fail earlier withwidget keys are not supported, and the REST API ignores theagent_planfeature.GenerateReadinessScoreService: checks:workplanagainstproject.root_ancestor, the same actor asGenerateWorkplanService.- Flows:
readiness_score/v1is gated byworkplan. Theworkplan/v1version resolver no longer checksworkplan_score: it resolves1.3.0when Software Factory is enabled and1.1.0otherwise. The1.0.0fallback existed only for users withoutworkplan_score, because the callback rejected the scoring write that1.1.0ends with. With both now gated byworkplan, that case no longer exists. - Frontend: removed the
workplanScorepush from both work item controllers and theuseScore/includeReadinessScoregating from the implementation widget, workplan, and sticky header components, the agent plan queries, mutations, subscription, andwriteAgentPlanToCache.readinessScoreis 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_itemtool description and docs, and the seeder. Regenerated the GraphQL reference and introspection schema.doc-locale/andlocale/*/gitlab.poare untouched. - Kept for follow-up:
config/feature_flags/beta/workplan_score.ymland theworkplan_scorecheck inee/lib/api/entities/work_items/features/agent_plan.rb, which still controls whether REST responses exposereadiness_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
- Original flag: !248374 (merged)
- Rollout issue of the flag: #607899 (closed)
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
- Enable
workplanfor a root group:Feature.enable(:workplan, group). Leaveworkplan_scoredisabled. - Open a project work item in that group and confirm the Workplan widget and the readiness score render.
- Enable
workplanonly for a subgroup or project instead of the root group, and confirm the score is hidden and that settingreadinessScorethroughworkItemUpdatereturns therequires the workplan feature flagerror. - Disable
workplanand 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.