• Stan Hu's avatar
    Fix attachments using the wrong URLs in e-mails · 0e341a6e
    Stan Hu authored
    Prior to https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/29889,
    only the project context were set for the Markdown renderer. For a note
    on an issuable, the group context was set to `nil` because
    `note.noteable.try(:group)` attempted to get the issuable's group, which
    doesn't exist.
    
    To make group notifications work, now both the project and group context
    are set. The context gets passed to `RelativeLinkFilter`, which
    previously assumed that it wasn't possible to have both a group and a
    project in the Markdown context. However, if a group were defined, it
    would take precedence, and the URL rendered for uploads would be
    `/group/-/uploads` instead of `/group/project/uploads/`. This led to
    404s in e-mails.
    
    However, now that we have both project and group in the context, we
    render the Markdown giving priority to the project context if is set.
    
    Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63910
    0e341a6e
sh-fix-issue-63910.yml 100 Bytes