Gate wiki pages in recently viewed items behind a feature flag
What does this MR do and why?
Introduces the recently_viewed_wiki_pages feature flag (gitlab_com_derisk, default disabled) to control whether wiki pages are returned by Resolvers::Users::RecentlyViewedItemsResolver.
UI issue being addressed
In the Recently Viewed panel, wiki page entries render as ? instead of the wiki page title/text. Until the frontend correctly handles WikiPage::Meta entries, the backend hides them from the response.
Approach
- Wraps the inclusion of
::Gitlab::Search::RecentWikiPagesinavailable_typesbehindFeature.enabled?(:recently_viewed_wiki_pages, current_user). - Also gates the
WikiPage::Metabranch inauthorized_to_read_item?with the same flag for defense in depth. - Default state is disabled, so wiki pages are hidden from the UI out of the box.
- Once the UI bug is fixed, the flag can be enabled via ChatOps without a code change or deploy.
Wiki page view tracking (via log_wiki_page_view in WikiActions) and the search autocomplete integration are intentionally untouched, so no history is lost.
Files changed
app/graphql/resolvers/users/recently_viewed_items_resolver.rb— flag-gated wiki inclusion.config/feature_flags/gitlab_com_derisk/recently_viewed_wiki_pages.yml— new flag definition.spec/graphql/resolvers/users/recently_viewed_items_resolver_spec.rb— added enabled/disabled contexts.
Related
- Original feature MR: !227581 (merged)
- Related issue: #592834
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