Commit 9a3b9139 authored by Takuya Noguchi's avatar Takuya Noguchi

Replace 'JIRA' with 'Jira' for EE-specific code comments

Signed-off-by: default avatarTakuya Noguchi <takninnovationresearch@gmail.com>
parent 6e3c2f2c
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
/** /**
* This script is not going through Webpack bundling * This script is not going through Webpack bundling
* as it is only included in `ee/app/views/jira_connect/subscriptions/index.html.haml` * as it is only included in `ee/app/views/jira_connect/subscriptions/index.html.haml`
* which is going to be rendered within iframe on JIRA app dashboard * which is going to be rendered within iframe on Jira app dashboard
* hence any code written here needs to be IE11+ compatible (no fully ES6) * hence any code written here needs to be IE11+ compatible (no fully ES6)
*/ */
......
---
title: Replace 'JIRA' with 'Jira' for EE-specific code comments
merge_request: 14479
author: Takuya Noguchi
type: other
...@@ -13,10 +13,10 @@ module API ...@@ -13,10 +13,10 @@ module API
NAMESPACE_ENDPOINT_REQUIREMENTS = { namespace: NO_SLASH_URL_PART_REGEX }.freeze NAMESPACE_ENDPOINT_REQUIREMENTS = { namespace: NO_SLASH_URL_PART_REGEX }.freeze
PROJECT_ENDPOINT_REQUIREMENTS = NAMESPACE_ENDPOINT_REQUIREMENTS.merge(project: NO_SLASH_URL_PART_REGEX).freeze PROJECT_ENDPOINT_REQUIREMENTS = NAMESPACE_ENDPOINT_REQUIREMENTS.merge(project: NO_SLASH_URL_PART_REGEX).freeze
# Used to differentiate JIRA cloud requests from JIRA server requests # Used to differentiate Jira Cloud requests from Jira Server requests
# JIRA cloud user agent format: JIRA DVCS Connector Vertigo/version # Jira Cloud user agent format: Jira DVCS Connector Vertigo/version
# JIRA server user agent format: JIRA DVCS Connector/version # Jira Server user agent format: Jira DVCS Connector/version
JIRA_DVCS_CLOUD_USER_AGENT = 'JIRA DVCS Connector Vertigo'.freeze JIRA_DVCS_CLOUD_USER_AGENT = 'Jira DVCS Connector Vertigo'.freeze
include PaginationParams include PaginationParams
......
...@@ -30,7 +30,7 @@ describe Oauth::Jira::AuthorizationsController do ...@@ -30,7 +30,7 @@ describe Oauth::Jira::AuthorizationsController do
end end
describe 'POST access_token' do describe 'POST access_token' do
it 'returns oauth params in a format JIRA expects' do it 'returns oauth params in a format Jira expects' do
expect_any_instance_of(Doorkeeper::Request::AuthorizationCode).to receive(:authorize) do expect_any_instance_of(Doorkeeper::Request::AuthorizationCode).to receive(:authorize) do
double(status: :ok, body: { 'access_token' => 'fake-123', 'scope' => 'foo', 'token_type' => 'bar' }) double(status: :ok, body: { 'access_token' => 'fake-123', 'scope' => 'foo', 'token_type' => 'bar' })
end end
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe Gitlab::Jira::Middleware do describe Gitlab::Jira::Middleware do
let(:app) { double(:app) } let(:app) { double(:app) }
let(:middleware) { described_class.new(app) } let(:middleware) { described_class.new(app) }
let(:jira_user_agent) { 'JIRA DVCS Connector Vertigo/5.0.0-D20170810T012915' } let(:jira_user_agent) { 'Jira DVCS Connector Vertigo/5.0.0-D20170810T012915' }
describe '.jira_dvcs_connector?' do describe '.jira_dvcs_connector?' do
it 'returns true when DVCS connector' do it 'returns true when DVCS connector' do
...@@ -20,14 +20,14 @@ describe Gitlab::Jira::Middleware do ...@@ -20,14 +20,14 @@ describe Gitlab::Jira::Middleware do
end end
describe '#call' do describe '#call' do
it 'adjusts HTTP_AUTHORIZATION env when request from JIRA DVCS user agent' do it 'adjusts HTTP_AUTHORIZATION env when request from Jira DVCS user agent' do
expect(app).to receive(:call).with('HTTP_USER_AGENT' => jira_user_agent, expect(app).to receive(:call).with('HTTP_USER_AGENT' => jira_user_agent,
'HTTP_AUTHORIZATION' => 'Bearer hash-123') 'HTTP_AUTHORIZATION' => 'Bearer hash-123')
middleware.call('HTTP_USER_AGENT' => jira_user_agent, 'HTTP_AUTHORIZATION' => 'token hash-123') middleware.call('HTTP_USER_AGENT' => jira_user_agent, 'HTTP_AUTHORIZATION' => 'token hash-123')
end end
it 'does not change HTTP_AUTHORIZATION env when request is not from JIRA DVCS user agent' do it 'does not change HTTP_AUTHORIZATION env when request is not from Jira DVCS user agent' do
env = { 'HTTP_USER_AGENT' => 'Mozilla/5.0', 'HTTP_AUTHORIZATION' => 'token hash-123' } env = { 'HTTP_USER_AGENT' => 'Mozilla/5.0', 'HTTP_AUTHORIZATION' => 'token hash-123' }
expect(app).to receive(:call).with(env) expect(app).to receive(:call).with(env)
......
...@@ -4,14 +4,14 @@ require 'rails_helper' ...@@ -4,14 +4,14 @@ require 'rails_helper'
describe ProjectFeatureUsage, type: :model do describe ProjectFeatureUsage, type: :model do
describe '.jira_dvcs_integrations_enabled_count' do describe '.jira_dvcs_integrations_enabled_count' do
it 'returns count of projects with JIRA DVCS cloud enabled' do it 'returns count of projects with Jira DVCS Cloud enabled' do
create(:project).feature_usage.log_jira_dvcs_integration_usage create(:project).feature_usage.log_jira_dvcs_integration_usage
create(:project).feature_usage.log_jira_dvcs_integration_usage create(:project).feature_usage.log_jira_dvcs_integration_usage
expect(described_class.with_jira_dvcs_integration_enabled.count).to eq(2) expect(described_class.with_jira_dvcs_integration_enabled.count).to eq(2)
end end
it 'returns count of projects with JIRA DVCS server enabled' do it 'returns count of projects with Jira DVCS Server enabled' do
create(:project).feature_usage.log_jira_dvcs_integration_usage(cloud: false) create(:project).feature_usage.log_jira_dvcs_integration_usage(cloud: false)
create(:project).feature_usage.log_jira_dvcs_integration_usage(cloud: false) create(:project).feature_usage.log_jira_dvcs_integration_usage(cloud: false)
...@@ -24,7 +24,7 @@ describe ProjectFeatureUsage, type: :model do ...@@ -24,7 +24,7 @@ describe ProjectFeatureUsage, type: :model do
subject { project.feature_usage } subject { project.feature_usage }
it 'logs JIRA DVCS cloud last sync' do it 'logs Jira DVCS Cloud last sync' do
Timecop.freeze do Timecop.freeze do
subject.log_jira_dvcs_integration_usage subject.log_jira_dvcs_integration_usage
...@@ -33,7 +33,7 @@ describe ProjectFeatureUsage, type: :model do ...@@ -33,7 +33,7 @@ describe ProjectFeatureUsage, type: :model do
end end
end end
it 'logs JIRA DVCS server last sync' do it 'logs Jira DVCS Server last sync' do
Timecop.freeze do Timecop.freeze do
subject.log_jira_dvcs_integration_usage(cloud: false) subject.log_jira_dvcs_integration_usage(cloud: false)
......
...@@ -388,8 +388,8 @@ describe API::V3::Github do ...@@ -388,8 +388,8 @@ describe API::V3::Github do
end end
context 'updating project feature usage' do context 'updating project feature usage' do
it 'counts JIRA cloud integration as enabled' do it 'counts Jira Cloud integration as enabled' do
user_agent = 'JIRA DVCS Connector Vertigo/4.42.0' user_agent = 'Jira DVCS Connector Vertigo/4.42.0'
Timecop.freeze do Timecop.freeze do
jira_get v3_api("/repos/#{project.namespace.path}/#{project.path}/branches", user), user_agent jira_get v3_api("/repos/#{project.namespace.path}/#{project.path}/branches", user), user_agent
...@@ -398,8 +398,8 @@ describe API::V3::Github do ...@@ -398,8 +398,8 @@ describe API::V3::Github do
end end
end end
it 'counts JIRA server integration as enabled' do it 'counts Jira Server integration as enabled' do
user_agent = 'JIRA DVCS Connector/3.2.4' user_agent = 'Jira DVCS Connector/3.2.4'
Timecop.freeze do Timecop.freeze do
jira_get v3_api("/repos/#{project.namespace.path}/#{project.path}/branches", user), user_agent jira_get v3_api("/repos/#{project.namespace.path}/#{project.path}/branches", user), user_agent
...@@ -528,7 +528,7 @@ describe API::V3::Github do ...@@ -528,7 +528,7 @@ describe API::V3::Github do
end end
end end
def jira_get(path, user_agent = 'JIRA DVCS Connector/3.2.4') def jira_get(path, user_agent = 'Jira DVCS Connector/3.2.4')
get path, headers: { 'User-Agent' => user_agent } get path, headers: { 'User-Agent' => user_agent }
end end
......
require 'spec_helper' require 'spec_helper'
describe 'JIRA authorization requests' do describe 'Jira authorization requests' do
let(:user) { create :user } let(:user) { create :user }
let(:application) { create :oauth_application, scopes: 'api' } let(:application) { create :oauth_application, scopes: 'api' }
let(:redirect_uri) { oauth_jira_callback_url(host: "http://www.example.com") } let(:redirect_uri) { oauth_jira_callback_url(host: "http://www.example.com") }
......
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