upstream MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86363/diffs
Please see detail in https://gitlab.com/gitlab-jh/gitlab-jh-enablement/-/issues/197#note_930650009