Commit c1bc2fcb authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '12498-jira-capitalization' into 'master'

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

Closes #12498

See merge request gitlab-org/gitlab-ee!14479
parents cada8c5b 9a3b9139
......@@ -5,7 +5,7 @@
/**
* This script is not going through Webpack bundling
* 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)
*/
......
---
title: Replace 'JIRA' with 'Jira' for EE-specific code comments
merge_request: 14479
author: Takuya Noguchi
type: other
......@@ -13,10 +13,10 @@ module API
NAMESPACE_ENDPOINT_REQUIREMENTS = { namespace: 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
# JIRA cloud user agent format: JIRA DVCS Connector Vertigo/version
# JIRA server user agent format: JIRA DVCS Connector/version
JIRA_DVCS_CLOUD_USER_AGENT = 'JIRA DVCS Connector Vertigo'.freeze
# Used to differentiate Jira Cloud requests from Jira Server requests
# Jira Cloud user agent format: Jira DVCS Connector Vertigo/version
# Jira Server user agent format: Jira DVCS Connector/version
JIRA_DVCS_CLOUD_USER_AGENT = 'Jira DVCS Connector Vertigo'.freeze
include PaginationParams
......
......@@ -30,7 +30,7 @@ describe Oauth::Jira::AuthorizationsController do
end
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
double(status: :ok, body: { 'access_token' => 'fake-123', 'scope' => 'foo', 'token_type' => 'bar' })
end
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe Gitlab::Jira::Middleware do
let(:app) { double(: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
it 'returns true when DVCS connector' do
......@@ -20,14 +20,14 @@ describe Gitlab::Jira::Middleware do
end
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,
'HTTP_AUTHORIZATION' => 'Bearer hash-123')
middleware.call('HTTP_USER_AGENT' => jira_user_agent, 'HTTP_AUTHORIZATION' => 'token hash-123')
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' }
expect(app).to receive(:call).with(env)
......
......@@ -4,14 +4,14 @@ require 'rails_helper'
describe ProjectFeatureUsage, type: :model 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
expect(described_class.with_jira_dvcs_integration_enabled.count).to eq(2)
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)
......@@ -24,7 +24,7 @@ describe ProjectFeatureUsage, type: :model do
subject { project.feature_usage }
it 'logs JIRA DVCS cloud last sync' do
it 'logs Jira DVCS Cloud last sync' do
Timecop.freeze do
subject.log_jira_dvcs_integration_usage
......@@ -33,7 +33,7 @@ describe ProjectFeatureUsage, type: :model do
end
end
it 'logs JIRA DVCS server last sync' do
it 'logs Jira DVCS Server last sync' do
Timecop.freeze do
subject.log_jira_dvcs_integration_usage(cloud: false)
......
......@@ -388,8 +388,8 @@ describe API::V3::Github do
end
context 'updating project feature usage' do
it 'counts JIRA cloud integration as enabled' do
user_agent = 'JIRA DVCS Connector Vertigo/4.42.0'
it 'counts Jira Cloud integration as enabled' do
user_agent = 'Jira DVCS Connector Vertigo/4.42.0'
Timecop.freeze do
jira_get v3_api("/repos/#{project.namespace.path}/#{project.path}/branches", user), user_agent
......@@ -398,8 +398,8 @@ describe API::V3::Github do
end
end
it 'counts JIRA server integration as enabled' do
user_agent = 'JIRA DVCS Connector/3.2.4'
it 'counts Jira Server integration as enabled' do
user_agent = 'Jira DVCS Connector/3.2.4'
Timecop.freeze do
jira_get v3_api("/repos/#{project.namespace.path}/#{project.path}/branches", user), user_agent
......@@ -528,7 +528,7 @@ describe API::V3::Github do
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 }
end
......
require 'spec_helper'
describe 'JIRA authorization requests' do
describe 'Jira authorization requests' do
let(:user) { create :user }
let(:application) { create :oauth_application, scopes: 'api' }
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