Skip to content

Fix bug when creating MR with a ONES integration

Baodong请求将fix/create-mr-with-ones合并到main-jh

Related issue: #2554 (closed)

What does this MR do and why?

Fix bug when creating MR with a ONES integration.

Related Upstream MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4362/diffs#diff-content-7b6375270d22f880bdcb085e47b519b426a5c6c7

The MR that introduced the bug: !876 (diffs)

Related source code

app/services/merge_requests/build_service.rb

    def issue_iid
      strong_memoize(:issue_iid) do
        @params_issue_iid || begin
          id = if target_project.external_issue_tracker
                 source_branch.match(target_project.external_issue_reference_pattern).try(:[], 0)
               end

          id || source_branch.match(/\A(\d+)-/).try(:[], 1)
        end
      end
    end

jh/app/models/concerns/integrations/issue_tracker_limitation.rb

def reference_pattern(*_args)
  nil
end
Baodong 编辑于

合并请求报告

加载中