GitLab OpenProject Integration Rebase Conflict Resolve

Abstract: GitLab OpenProject Integration Rebase Conflict Resolve

2019-08-30 22:09:43

jira_service.rb

https://gitlab.com/gitlab-org/gitlab-ce/commits/master/app/models/project_services/jira_service.rb200832::

Fix DNS rebind vulnerability for JIRA integration

https://gitlab.com/gitlab-org/gitlab-ce/commit/492a7e753d0ef06458163aecc5ca43892a5acc73

1
2
3
4
5
6
7
8
def client
@client ||= begin
JIRA::Client.new(options).tap do |client|
# Replaces JIRA default http client with our implementation
client.request_client = Gitlab::Jira::HttpClient.new(client.options)
end
end
end

Regex

https://gitlab.com/gitlab-org/gitlab-ce/commit/d19717cba65ef3ae6f76ec25140ab5c255b27d42

1
2
3
4
# {PROJECT-KEY}-{NUMBER} Examples: JIRA-1, PROJECT-1
def self.reference_pattern(only_long: true)
@reference_pattern ||= /(?<issue>\b#{Gitlab::Regex.jira_issue_key_regex})/
end

Actually, we use self.reference_pattern(only_long: true) as super method to get this pattern. do we need to override it in Jira service? For compatible, override it currently to keep this update.

new Reg is

1
2
3
4
5
# Based on Jira's project key format
# https://confluence.atlassian.com/adminjiraserver073/changing-the-project-key-format-861253229.html
def jira_issue_key_regex
@jira_issue_key_regex ||= /[A-Z][A-Z_0-9]+-\d+/
end

my current code:

1
2
3
4
5
6
GENERAL_ISSUE_FORMAT_REGEXP = /(?<issue>\b([A-Z][A-Z0-9_]+-)\d+)/
# {PROJECT-KEY}-{NUMBER} Examples: JIRA-1, PROJECT-1
override :reference_pattern
def self.reference_pattern(only_long: true)
@reference_pattern ||= GENERAL_ISSUE_FORMAT_REGEXP
end

so keep the updated override method to make sure jira service is right.

Handle trailing slashes when generating Jira URLs

https://gitlab.com/gitlab-org/gitlab-ce/commit/589d1797d8dfdced2c6257597264bce0e2072c35

Fix message for successful jira test

1
"SUCCESS: Successfully posted to #{client_url}."

https://gitlab.com/gitlab-org/gitlab-ce/commit/0132d4efa56db3e6ee37eccc58acd24373dd1613

JIRA -> Jira

https://gitlab.com/gitlab-org/gitlab-ce/commit/af5da7564edab1d3f2457e13e3157f2806b0b9a0

service.rb

https://gitlab.com/gitlab-org/gitlab-ce/commits/master/app/models/service.rb

Final removal of KubernetesService

https://gitlab.com/gitlab-org/gitlab-ce/commit/e3696bf20e4d646f46f847237da828eaee00253a

56737 Expose currently supported events properly on services API

1
2
3
def self.event_names
self.supported_events.map { |event| ServicesHelper.service_event_field_name(event) }
end

Use title and description fields for issue trackers

https://gitlab.com/gitlab-org/gitlab-ce/commit/ddbbf453c76144ac60c67e783424faf843c8efa1

Create models for issue trackers data

1
include DataFields

https://gitlab.com/gitlab-org/gitlab-ce/commit/1f332ae8da994509232c7601074b25514ad23c52