Resolve project namespace in GlfMarkdown engine for FF check
What does this MR do and why?
This change fixes a bug in the markdown processing system that handles placeholder text (like %{variable_name}).
The issue was that when a project was referenced through a "project namespace" object instead of directly, the system couldn't properly check if placeholder features were enabled, causing placeholders to not work correctly.
The fix adds a helper method that detects when a project namespace is being used and automatically extracts the actual project from it. This ensures placeholder functionality works consistently regardless of how the project is referenced.
The tests were also updated to verify this fix works properly by testing both direct project references and project namespace references, ensuring both scenarios enable placeholder rendering as expected.
The issue surfaces when trying to mark an incident or Service Desk issue related to another item. Both WITs use the legacy issues view which doesn't use the GraphQL API to link items but a legacy implementation. However this implementation passes a ProjectNamespace instead of project.
Solves Linking to other issues doesn't work from Servi... (#556207 - closed)
Originally introduced with Add support for placeholder variables in markdown (!194934 - merged)
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Create an issue
- Create an incident (or Service Desk issue)
- Browse to the incident (it renders the legacy issue view)
- Add the issue as linked item of incident via the incident detail page
- See endpoint works now. On
masterit should error.
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.