[FF] rspack_production_assets_opt_in -- opt individual users in to Rspack-built assets in production
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Rollout of the rspack_production_assets_opt_in feature flag, introduced in !258354 (merged). The flag is gitlab_com_derisk type and defaults off.
It lets an individual user opt in to Rspack-built frontend assets in production. It's a companion to rspack_production_assets (rollout issue #606363, feature issue #604382 (closed)). That flag is checked against a per-request actor, so it can't target a single person. This flag is checked against the current user instead, so enable it only with --user or --feature-group=gitlab_team_members. A --group actor never matches, because the check passes a user, not a group. Never enable it without an actor: a bare true turns on Rspack assets for all traffic, including anonymous visitors, the same as rspack_production_assets at 100%. Use the rspack_production_assets flag (#606363) for a percentage rollout.
- DRI: @slashmanov
- Team Slack channel:
#g_foundations
Prerequisite: the production assets image must contain manifest.rspack.json.
What could go wrong?
An opted-in user gets pages built from manifest.rspack.json instead of Webpack's manifest. If a Rspack chunk is bad or missing, page JS breaks, but only for that user. Anonymous requests are never affected.
This is instantly reversible: disabling the flag for the user falls back to Webpack.
Rollout
Run in #production, cross-post to #g_foundations:
/chatops gitlab run feature set rspack_production_assets_opt_in true --user=<handle> --staging
/chatops gitlab run feature set rspack_production_assets_opt_in true --user=<handle>
/chatops gitlab run feature set --feature-group=gitlab_team_members rspack_production_assets_opt_in trueTo opt a user back out:
/chatops gitlab run feature set rspack_production_assets_opt_in false --user=<handle>Cleanup
Remove this flag together with rspack_production_assets once Rspack assets are the default:
- Remove the flag, its YAML definition, and the check in
WebpackHelper#rspack_enabled?. - Delete the flag everywhere:
/chatops gitlab run feature delete rspack_production_assets_opt_in --dev --pre --staging --staging-ref --production