Commit 98252e0d authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 2ee5991b
...@@ -32,12 +32,12 @@ export default { ...@@ -32,12 +32,12 @@ export default {
}, },
}, },
deployedTextMap: { deployedTextMap: {
[MANUAL_DEPLOY]: __('Can deploy manually to'), [MANUAL_DEPLOY]: __('Can be manually deployed to'),
[WILL_DEPLOY]: __('Will deploy to'), [WILL_DEPLOY]: __('Will deploy to'),
[RUNNING]: __('Deploying to'), [RUNNING]: __('Deploying to'),
[SUCCESS]: __('Deployed to'), [SUCCESS]: __('Deployed to'),
[FAILED]: __('Failed to deploy to'), [FAILED]: __('Failed to deploy to'),
[CANCELED]: __('Canceled deploy to'), [CANCELED]: __('Canceled deployment to'),
}, },
computed: { computed: {
deployTimeago() { deployTimeago() {
......
...@@ -124,7 +124,9 @@ export default { ...@@ -124,7 +124,9 @@ export default {
}, },
}, },
mounted() { mounted() {
this.draw(); if (!this.allValuesEmpty) {
this.draw();
}
}, },
methods: { methods: {
draw() { draw() {
...@@ -151,14 +153,7 @@ export default { ...@@ -151,14 +153,7 @@ export default {
this.yScale = d3.scaleLinear().rangeRound([this.vbHeight, 0]); this.yScale = d3.scaleLinear().rangeRound([this.vbHeight, 0]);
this.xScale.domain(this.graphData.map(d => d.name)); this.xScale.domain(this.graphData.map(d => d.name));
/* this.yScale.domain([0, d3.max(this.graphData.map(d => d.value))]);
If we have all-zero graph we want graph to center 0 on axis and not to draw
any kind of ticks on Y axis. Infinity allows us to do that.
See https://gitlab.com/gitlab-org/gitlab/merge_requests/20627#note_251484582
for detailed explanation
*/
this.yScale.domain([0, d3.max(this.graphData.map(d => d.value)) || Infinity]);
// Zoom/Panning Function // Zoom/Panning Function
this.zoom = d3 this.zoom = d3
......
...@@ -5,7 +5,7 @@ module SidekiqHelper ...@@ -5,7 +5,7 @@ module SidekiqHelper
(?<pid>\d+)\s+ (?<pid>\d+)\s+
(?<cpu>[\d\.,]+)\s+ (?<cpu>[\d\.,]+)\s+
(?<mem>[\d\.,]+)\s+ (?<mem>[\d\.,]+)\s+
(?<state>[DIEKNRSTVWXZNLpsl\+<>/\d]+)\s+ (?<state>[DIEKNRSTVWXZLpsl\+<>/\d]+)\s+
(?<start>.+?)\s+ (?<start>.+?)\s+
(?<command>(?:ruby\d+:\s+)?sidekiq.*\].*) (?<command>(?:ruby\d+:\s+)?sidekiq.*\].*)
\z}x.freeze \z}x.freeze
......
...@@ -2203,7 +2203,7 @@ class Project < ApplicationRecord ...@@ -2203,7 +2203,7 @@ class Project < ApplicationRecord
end end
def reference_counter(type: Gitlab::GlRepository::PROJECT) def reference_counter(type: Gitlab::GlRepository::PROJECT)
Gitlab::ReferenceCounter.new(type.identifier_for_subject(self)) Gitlab::ReferenceCounter.new(type.identifier_for_repositorable(self))
end end
def badges def badges
......
...@@ -100,6 +100,6 @@ class PipelinesEmailService < Service ...@@ -100,6 +100,6 @@ class PipelinesEmailService < Service
end end
def retrieve_recipients(data) def retrieve_recipients(data)
recipients.to_s.split(/[,(?:\r?\n) ]+/).reject(&:empty?) recipients.to_s.split(/[,\r\n ]+/).reject(&:empty?)
end end
end end
...@@ -65,7 +65,7 @@ class ProjectWiki ...@@ -65,7 +65,7 @@ class ProjectWiki
# Returns the Gitlab::Git::Wiki object. # Returns the Gitlab::Git::Wiki object.
def wiki def wiki
@wiki ||= begin @wiki ||= begin
gl_repository = Gitlab::GlRepository::WIKI.identifier_for_subject(project) gl_repository = Gitlab::GlRepository::WIKI.identifier_for_repositorable(project)
raw_repository = Gitlab::Git::Repository.new(project.repository_storage, disk_path + '.git', gl_repository, full_path) raw_repository = Gitlab::Git::Repository.new(project.repository_storage, disk_path + '.git', gl_repository, full_path)
create_repo!(raw_repository) unless raw_repository.exists? create_repo!(raw_repository) unless raw_repository.exists?
......
...@@ -1177,7 +1177,7 @@ class Repository ...@@ -1177,7 +1177,7 @@ class Repository
def initialize_raw_repository def initialize_raw_repository
Gitlab::Git::Repository.new(project.repository_storage, Gitlab::Git::Repository.new(project.repository_storage,
disk_path + '.git', disk_path + '.git',
repo_type.identifier_for_subject(project), repo_type.identifier_for_repositorable(project),
project.full_path) project.full_path)
end end
end end
......
---
title: Update pipeline status copy in deploy footer
merge_request: 23199
author:
type: changed
---
title: NPM dist tags will now be displayed on the package details page.
merge_request: 23061
author:
type: added
---
title: Fix Bitbucket Server importer error handler
merge_request: 23310
author:
type: fixed
...@@ -10,11 +10,8 @@ Rails.application.configure do ...@@ -10,11 +10,8 @@ Rails.application.configure do
# your test database is "scratch space" for the test suite and is wiped # your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there! # and recreated between test runs. Don't rely on the data there!
# Enabling caching of classes slows start-up time because all controllers # Code doesn't change in CI so we don't need code-reloading
# are loaded at initialization, but it reduces memory and load because files config.cache_classes = !!ENV['CI']
# are not reloaded with every request. For example, caching is not necessary
# for loading database migrations but useful for handling Knapsack specs.
config.cache_classes = ENV['CACHE_CLASSES'] == 'true'
# Configure static asset server for tests with Cache-Control for performance # Configure static asset server for tests with Cache-Control for performance
config.assets.compile = false if ENV['CI'] config.assets.compile = false if ENV['CI']
......
...@@ -238,32 +238,7 @@ Now, it's time to create the database: ...@@ -238,32 +238,7 @@ Now, it's time to create the database:
auto updates to minor versions. You may want to turn it off. auto updates to minor versions. You may want to turn it off.
1. When done, click **Create database**. 1. When done, click **Create database**.
### Installing the `pg_trgm` extension for PostgreSQL Now that the database is created, let's move on to setting up Redis with ElasticCache.
Once the database is created, connect to your new RDS instance to verify access
and to install a required extension.
You can find the host or endpoint by selecting the instance you just created and
after the details dropdown menu you'll find it labeled as 'Endpoint'. Do not to
include the colon and port number:
```sh
sudo /opt/gitlab/embedded/bin/psql -U gitlab -h <rds-endpoint> -d gitlabhq_production
```
At the psql prompt create the extension and then quit the session:
```sh
psql (9.4.7)
Type "help" for help.
gitlab=# CREATE EXTENSION pg_trgm;
gitlab=# \q
```
---
Now that the database is created, let's move on setting up Redis with ElasticCache.
## Redis with ElastiCache ## Redis with ElastiCache
...@@ -435,15 +410,32 @@ we intended. ...@@ -435,15 +410,32 @@ we intended.
After a few minutes, the instances should be up and accessible via the internet. After a few minutes, the instances should be up and accessible via the internet.
Let's connect to the primary and configure some things before logging in. Let's connect to the primary and configure some things before logging in.
### Configuring GitLab to connect with postgres and Redis ### Installing the `pg_trgm` extension for PostgreSQL
Connect to the RDS instance to verify access and to install the required `pg_trgm` extension.
To find the host or endpoint, naviagate to **Amazon RDS > Databases** and click on the database you created earlier. Look for the endpoint under the **Connectivity & security** tab.
While connected to your server, let's connect to the RDS instance to verify Do not to include the colon and port number:
access and to install a required extension:
```sh ```sh
sudo /opt/gitlab/embedded/bin/psql -U gitlab -h <rds-endpoint> -d gitlabhq_production sudo /opt/gitlab/embedded/bin/psql -U gitlab -h <rds-endpoint> -d gitlabhq_production
``` ```
At the psql prompt create the extension and then quit the session:
```sh
psql (10.9)
Type "help" for help.
gitlab=# CREATE EXTENSION pg_trgm;
gitlab=# \q
```
---
### Configuring GitLab to connect with postgres and Redis
Edit the `gitlab.rb` file at `/etc/gitlab/gitlab.rb` Edit the `gitlab.rb` file at `/etc/gitlab/gitlab.rb`
find the `external_url 'http://gitlab.example.com'` option and change it find the `external_url 'http://gitlab.example.com'` option and change it
to the domain you will be using or the public IP address of the current to the domain you will be using or the public IP address of the current
......
...@@ -118,7 +118,7 @@ module API ...@@ -118,7 +118,7 @@ module API
# Project id to pass between components that don't share/don't have # Project id to pass between components that don't share/don't have
# access to the same filesystem mounts # access to the same filesystem mounts
def gl_repository def gl_repository
repo_type.identifier_for_subject(project) repo_type.identifier_for_repositorable(project)
end end
def gl_project_path def gl_project_path
......
...@@ -172,6 +172,7 @@ module Gitlab ...@@ -172,6 +172,7 @@ module Gitlab
stage: 'import_pull_requests', iid: pull_request.iid, error: e.message stage: 'import_pull_requests', iid: pull_request.iid, error: e.message
) )
backtrace = Gitlab::BacktraceCleaner.clean_backtrace(e.backtrace)
errors << { type: :pull_request, iid: pull_request.iid, errors: e.message, backtrace: backtrace.join("\n"), raw_response: pull_request.raw } errors << { type: :pull_request, iid: pull_request.iid, errors: e.message, backtrace: backtrace.join("\n"), raw_response: pull_request.raw }
end end
end end
......
...@@ -13,8 +13,8 @@ module Gitlab ...@@ -13,8 +13,8 @@ module Gitlab
@repository_accessor = repository_accessor @repository_accessor = repository_accessor
end end
def identifier_for_subject(subject) def identifier_for_repositorable(repositorable)
"#{name}-#{subject.id}" "#{name}-#{repositorable.id}"
end end
def fetch_id(identifier) def fetch_id(identifier)
...@@ -34,8 +34,8 @@ module Gitlab ...@@ -34,8 +34,8 @@ module Gitlab
project? ? "" : ".#{name}" project? ? "" : ".#{name}"
end end
def repository_for(subject) def repository_for(repositorable)
repository_accessor.call(subject) repository_accessor.call(repositorable)
end end
end end
end end
......
...@@ -5,6 +5,9 @@ module Gitlab ...@@ -5,6 +5,9 @@ module Gitlab
extend self extend self
def project_name_regex def project_name_regex
# The character range \p{Alnum} overlaps with \u{00A9}-\u{1f9ff}
# hence the Ruby warning.
# https://gitlab.com/gitlab-org/gitlab/merge_requests/23165#not-easy-fixable
@project_name_regex ||= /\A[\p{Alnum}\u{00A9}-\u{1f9ff}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9ff}_\. ]*\z/.freeze @project_name_regex ||= /\A[\p{Alnum}\u{00A9}-\u{1f9ff}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9ff}_\. ]*\z/.freeze
end end
......
...@@ -24,7 +24,7 @@ module Gitlab ...@@ -24,7 +24,7 @@ module Gitlab
attrs = { attrs = {
GL_ID: Gitlab::GlId.gl_id(user), GL_ID: Gitlab::GlId.gl_id(user),
GL_REPOSITORY: repo_type.identifier_for_subject(repository.project), GL_REPOSITORY: repo_type.identifier_for_repositorable(repository.project),
GL_USERNAME: user&.username, GL_USERNAME: user&.username,
ShowAllRefs: show_all_refs, ShowAllRefs: show_all_refs,
Repository: repository.gitaly_repository.to_h, Repository: repository.gitaly_repository.to_h,
......
...@@ -173,6 +173,11 @@ msgid_plural "%d staged changes" ...@@ -173,6 +173,11 @@ msgid_plural "%d staged changes"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "%d tag"
msgid_plural "%d tags"
msgstr[0] ""
msgstr[1] ""
msgid "%d unstaged change" msgid "%d unstaged change"
msgid_plural "%d unstaged changes" msgid_plural "%d unstaged changes"
msgstr[0] "" msgstr[0] ""
...@@ -3081,7 +3086,7 @@ msgstr "" ...@@ -3081,7 +3086,7 @@ msgstr ""
msgid "Callback URL" msgid "Callback URL"
msgstr "" msgstr ""
msgid "Can deploy manually to" msgid "Can be manually deployed to"
msgstr "" msgstr ""
msgid "Can override approvers and approvals required per merge request" msgid "Can override approvers and approvals required per merge request"
...@@ -3114,7 +3119,7 @@ msgstr "" ...@@ -3114,7 +3119,7 @@ msgstr ""
msgid "Cancel this job" msgid "Cancel this job"
msgstr "" msgstr ""
msgid "Canceled deploy to" msgid "Canceled deployment to"
msgstr "" msgstr ""
msgid "Cancelling Preview" msgid "Cancelling Preview"
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
"core-js": "^3.2.1", "core-js": "^3.2.1",
"cropper": "^2.3.0", "cropper": "^2.3.0",
"css-loader": "^1.0.0", "css-loader": "^1.0.0",
"d3": "^5.12.0", "d3": "^4.13.0",
"d3-scale": "^1.0.7", "d3-scale": "^1.0.7",
"d3-selection": "^1.2.0", "d3-selection": "^1.2.0",
"dateformat": "^3.0.3", "dateformat": "^3.0.3",
......
...@@ -40,7 +40,6 @@ function rspec_simple_job() { ...@@ -40,7 +40,6 @@ function rspec_simple_job() {
local rspec_opts="${1}" local rspec_opts="${1}"
export NO_KNAPSACK="1" export NO_KNAPSACK="1"
export CACHE_CLASSES="true"
scripts/gitaly-test-spawn scripts/gitaly-test-spawn
...@@ -59,7 +58,6 @@ function rspec_paralellized_job() { ...@@ -59,7 +58,6 @@ function rspec_paralellized_job() {
spec_folder_prefix="ee/" spec_folder_prefix="ee/"
fi fi
export CACHE_CLASSES="true"
export KNAPSACK_LOG_LEVEL="debug" export KNAPSACK_LOG_LEVEL="debug"
export KNAPSACK_REPORT_PATH="knapsack/${test_tool}_${test_level}_${database}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json" export KNAPSACK_REPORT_PATH="knapsack/${test_tool}_${test_level}_${database}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json"
......
...@@ -96,7 +96,7 @@ describe 'Merge request > User sees deployment widget', :js do ...@@ -96,7 +96,7 @@ describe 'Merge request > User sees deployment widget', :js do
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
wait_for_requests wait_for_requests
expect(page).to have_content("Canceled deploy to #{environment.name}") expect(page).to have_content("Canceled deployment to #{environment.name}")
expect(page).not_to have_css('.js-deploy-time') expect(page).not_to have_css('.js-deploy-time')
end end
end end
......
...@@ -56,27 +56,27 @@ describe('Deployment component', () => { ...@@ -56,27 +56,27 @@ describe('Deployment component', () => {
const deployGroup = [DeploymentViewButton, DeploymentStopButton]; const deployGroup = [DeploymentViewButton, DeploymentStopButton];
describe.each` describe.each`
status | previous | deploymentDetails | text | actionButtons status | previous | deploymentDetails | text | actionButtons
${CREATED} | ${true} | ${deployDetail} | ${'Can deploy manually to'} | ${deployGroup} ${CREATED} | ${true} | ${deployDetail} | ${'Can be manually deployed to'} | ${deployGroup}
${CREATED} | ${true} | ${noDetails} | ${'Will deploy to'} | ${deployGroup} ${CREATED} | ${true} | ${noDetails} | ${'Will deploy to'} | ${deployGroup}
${CREATED} | ${false} | ${deployDetail} | ${'Can deploy manually to'} | ${noActions} ${CREATED} | ${false} | ${deployDetail} | ${'Can be manually deployed to'} | ${noActions}
${CREATED} | ${false} | ${noDetails} | ${'Will deploy to'} | ${noActions} ${CREATED} | ${false} | ${noDetails} | ${'Will deploy to'} | ${noActions}
${RUNNING} | ${true} | ${deployDetail} | ${'Deploying to'} | ${deployGroup} ${RUNNING} | ${true} | ${deployDetail} | ${'Deploying to'} | ${deployGroup}
${RUNNING} | ${true} | ${noDetails} | ${'Deploying to'} | ${deployGroup} ${RUNNING} | ${true} | ${noDetails} | ${'Deploying to'} | ${deployGroup}
${RUNNING} | ${false} | ${deployDetail} | ${'Deploying to'} | ${noActions} ${RUNNING} | ${false} | ${deployDetail} | ${'Deploying to'} | ${noActions}
${RUNNING} | ${false} | ${noDetails} | ${'Deploying to'} | ${noActions} ${RUNNING} | ${false} | ${noDetails} | ${'Deploying to'} | ${noActions}
${SUCCESS} | ${true} | ${deployDetail} | ${'Deployed to'} | ${deployGroup} ${SUCCESS} | ${true} | ${deployDetail} | ${'Deployed to'} | ${deployGroup}
${SUCCESS} | ${true} | ${noDetails} | ${'Deployed to'} | ${deployGroup} ${SUCCESS} | ${true} | ${noDetails} | ${'Deployed to'} | ${deployGroup}
${SUCCESS} | ${false} | ${deployDetail} | ${'Deployed to'} | ${deployGroup} ${SUCCESS} | ${false} | ${deployDetail} | ${'Deployed to'} | ${deployGroup}
${SUCCESS} | ${false} | ${noDetails} | ${'Deployed to'} | ${deployGroup} ${SUCCESS} | ${false} | ${noDetails} | ${'Deployed to'} | ${deployGroup}
${FAILED} | ${true} | ${deployDetail} | ${'Failed to deploy to'} | ${deployGroup} ${FAILED} | ${true} | ${deployDetail} | ${'Failed to deploy to'} | ${deployGroup}
${FAILED} | ${true} | ${noDetails} | ${'Failed to deploy to'} | ${deployGroup} ${FAILED} | ${true} | ${noDetails} | ${'Failed to deploy to'} | ${deployGroup}
${FAILED} | ${false} | ${deployDetail} | ${'Failed to deploy to'} | ${noActions} ${FAILED} | ${false} | ${deployDetail} | ${'Failed to deploy to'} | ${noActions}
${FAILED} | ${false} | ${noDetails} | ${'Failed to deploy to'} | ${noActions} ${FAILED} | ${false} | ${noDetails} | ${'Failed to deploy to'} | ${noActions}
${CANCELED} | ${true} | ${deployDetail} | ${'Canceled deploy to'} | ${deployGroup} ${CANCELED} | ${true} | ${deployDetail} | ${'Canceled deployment to'} | ${deployGroup}
${CANCELED} | ${true} | ${noDetails} | ${'Canceled deploy to'} | ${deployGroup} ${CANCELED} | ${true} | ${noDetails} | ${'Canceled deployment to'} | ${deployGroup}
${CANCELED} | ${false} | ${deployDetail} | ${'Canceled deploy to'} | ${noActions} ${CANCELED} | ${false} | ${deployDetail} | ${'Canceled deployment to'} | ${noActions}
${CANCELED} | ${false} | ${noDetails} | ${'Canceled deploy to'} | ${noActions} ${CANCELED} | ${false} | ${noDetails} | ${'Canceled deployment to'} | ${noActions}
`( `(
'$status + previous: $previous + manual: $deploymentDetails.isManual', '$status + previous: $previous + manual: $deploymentDetails.isManual',
({ status, previous, deploymentDetails, text, actionButtons }) => { ({ status, previous, deploymentDetails, text, actionButtons }) => {
......
...@@ -67,6 +67,7 @@ describe Gitlab::BitbucketServerImport::Importer do ...@@ -67,6 +67,7 @@ describe Gitlab::BitbucketServerImport::Importer do
author_email: project.owner.email, author_email: project.owner.email,
created_at: Time.now, created_at: Time.now,
updated_at: Time.now, updated_at: Time.now,
raw: {},
merged?: true) merged?: true)
allow(subject.client).to receive(:pull_requests).and_return([pull_request]) allow(subject.client).to receive(:pull_requests).and_return([pull_request])
...@@ -239,6 +240,13 @@ describe Gitlab::BitbucketServerImport::Importer do ...@@ -239,6 +240,13 @@ describe Gitlab::BitbucketServerImport::Importer do
expect(notes.first.note).to start_with('*Comment on .gitmodules') expect(notes.first.note).to start_with('*Comment on .gitmodules')
expect(notes.second.note).to start_with('*Comment on .gitmodules') expect(notes.second.note).to start_with('*Comment on .gitmodules')
end end
it 'reports an error if an exception is raised' do
allow(subject).to receive(:import_bitbucket_pull_request).and_raise(RuntimeError)
expect(Gitlab::ErrorTracking).to receive(:log_exception)
subject.execute
end
end end
describe 'inaccessible branches' do describe 'inaccessible branches' do
......
...@@ -305,8 +305,8 @@ describe PipelinesEmailService, :mailer do ...@@ -305,8 +305,8 @@ describe PipelinesEmailService, :mailer do
end end
context 'with recipients list separating with newlines' do context 'with recipients list separating with newlines' do
let(:recipients) { "\ntest@gitlab.com, \r\nexample@gitlab.com" } let(:recipients) { "\ntest@gitlab.com, \r\nexample@gitlab.com\rother@gitlab.com" }
let(:receivers) { %w[test@gitlab.com example@gitlab.com] } let(:receivers) { %w[test@gitlab.com example@gitlab.com other@gitlab.com] }
context 'with failed pipeline' do context 'with failed pipeline' do
before do before do
......
...@@ -3992,7 +3992,7 @@ describe Project do ...@@ -3992,7 +3992,7 @@ describe Project do
end end
it 'schedules HashedStorage::ProjectMigrateWorker with delayed start when the project repo is in use' do it 'schedules HashedStorage::ProjectMigrateWorker with delayed start when the project repo is in use' do
Gitlab::ReferenceCounter.new(Gitlab::GlRepository::PROJECT.identifier_for_subject(project)).increase Gitlab::ReferenceCounter.new(Gitlab::GlRepository::PROJECT.identifier_for_repositorable(project)).increase
expect(HashedStorage::ProjectMigrateWorker).to receive(:perform_in) expect(HashedStorage::ProjectMigrateWorker).to receive(:perform_in)
...@@ -4000,7 +4000,7 @@ describe Project do ...@@ -4000,7 +4000,7 @@ describe Project do
end end
it 'schedules HashedStorage::ProjectMigrateWorker with delayed start when the wiki repo is in use' do it 'schedules HashedStorage::ProjectMigrateWorker with delayed start when the wiki repo is in use' do
Gitlab::ReferenceCounter.new(Gitlab::GlRepository::WIKI.identifier_for_subject(project)).increase Gitlab::ReferenceCounter.new(Gitlab::GlRepository::WIKI.identifier_for_repositorable(project)).increase
expect(HashedStorage::ProjectMigrateWorker).to receive(:perform_in) expect(HashedStorage::ProjectMigrateWorker).to receive(:perform_in)
......
...@@ -268,7 +268,7 @@ describe API::Internal::Base do ...@@ -268,7 +268,7 @@ describe API::Internal::Base do
end end
context 'with env passed as a JSON' do context 'with env passed as a JSON' do
let(:gl_repository) { Gitlab::GlRepository::WIKI.identifier_for_subject(project) } let(:gl_repository) { Gitlab::GlRepository::WIKI.identifier_for_repositorable(project) }
it 'sets env in RequestStore' do it 'sets env in RequestStore' do
obj_dir_relative = './objects' obj_dir_relative = './objects'
...@@ -1054,9 +1054,9 @@ describe API::Internal::Base do ...@@ -1054,9 +1054,9 @@ describe API::Internal::Base do
def gl_repository_for(project_or_wiki) def gl_repository_for(project_or_wiki)
case project_or_wiki case project_or_wiki
when ProjectWiki when ProjectWiki
Gitlab::GlRepository::WIKI.identifier_for_subject(project_or_wiki.project) Gitlab::GlRepository::WIKI.identifier_for_repositorable(project_or_wiki.project)
when Project when Project
Gitlab::GlRepository::PROJECT.identifier_for_subject(project_or_wiki) Gitlab::GlRepository::PROJECT.identifier_for_repositorable(project_or_wiki)
else else
nil nil
end end
......
# frozen_string_literal: true # frozen_string_literal: true
shared_examples 'a repo type' do shared_examples 'a repo type' do
describe "#identifier_for_subject" do describe "#identifier_for_repositorable" do
subject { described_class.identifier_for_subject(project) } subject { described_class.identifier_for_repositorable(project) }
it { is_expected.to eq(expected_identifier) } it { is_expected.to eq(expected_identifier) }
end end
......
This diff is collapsed.
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