Commit d02b139c authored by Chris Rohr's avatar Chris Rohr

Adding in ability to check status of automatic branch jobs in jenkins

Added change to change log
parent 33dce2df
......@@ -2,9 +2,10 @@ v 7.12 (Unreleased)
- Fix error when viewing merge request with a commit that includes "Closes #<issue id>".
- Enhance LDAP group synchronization to check also for member attributes that only contain "uid=<username>"
- Enhance LDAP group synchronization to check also for submember attributes
- Prevent LDAP group sync from removing a group's last owner
- Prevent LDAP group sync from removing a group's last owner
- Add Git hook to validate maximum file size.
- Project setting: approve merge request by N users before accept
- Support automatic branch jobs created by Jenkins in CI Status
v 7.11.4
- no changes specific to EE
......
......@@ -51,16 +51,17 @@ class JenkinsService < CiService
end
def build_page(sha, ref = nil)
project_url + "/scm/bySHA1/#{sha}"
base_url = ref.nil? || ref == 'master' ? project_url : "#{project_url}_#{ref}"
base_url + "/scm/bySHA1/#{sha}"
end
def commit_status(sha, ref = nil)
parsed_url = URI.parse(build_page(sha))
parsed_url = URI.parse(build_page(sha, ref))
if parsed_url.userinfo.blank?
response = HTTParty.get(build_page(sha), verify: false)
response = HTTParty.get(build_page(sha, ref), verify: false)
else
get_url = build_page(sha).gsub("#{parsed_url.userinfo}@", "")
get_url = build_page(sha, ref).gsub("#{parsed_url.userinfo}@", "")
auth = {
username: URI.decode(parsed_url.user),
password: URI.decode(parsed_url.password),
......
......@@ -51,5 +51,9 @@ eos
describe :build_page do
it { expect(@service.build_page("2ab7834c", 'master')).to eq("http://jenkins.gitlab.org/projects/2/scm/bySHA1/2ab7834c") }
end
describe :build_page_with_branch do
it { expect(@service.build_page("2ab7834c", 'test_branch')).to eq("http://jenkins.gitlab.org/projects/2_test_branch/scm/bySHA1/2ab7834c") }
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment