Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
a3ed0d253d
commit
79347b42ae
|
@ -5,6 +5,7 @@ query getSecurityTrainingUrls($projectFullPath: ID!, $identifierExternalIds: [St
|
||||||
name
|
name
|
||||||
status
|
status
|
||||||
url
|
url
|
||||||
|
identifier
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@ module Routing
|
||||||
sortDesc
|
sortDesc
|
||||||
state
|
state
|
||||||
tab
|
tab
|
||||||
|
glm_source
|
||||||
|
glm_content
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
def initialize(request_object, group, project)
|
def initialize(request_object, group, project)
|
||||||
|
|
|
@ -198,7 +198,7 @@ module Ci
|
||||||
# Create a separate worker for each new operation
|
# Create a separate worker for each new operation
|
||||||
|
|
||||||
before_transition [:created, :waiting_for_resource, :preparing, :pending] => :running do |pipeline|
|
before_transition [:created, :waiting_for_resource, :preparing, :pending] => :running do |pipeline|
|
||||||
pipeline.started_at = Time.current
|
pipeline.started_at ||= Time.current
|
||||||
end
|
end
|
||||||
|
|
||||||
before_transition any => [:success, :failed, :canceled] do |pipeline|
|
before_transition any => [:success, :failed, :canceled] do |pipeline|
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
= form_for @application_setting, url: repository_admin_application_settings_path(anchor: 'js-repository-storage-settings'), html: { class: 'fieldset-form' } do |f|
|
= gitlab_ui_form_for @application_setting, url: repository_admin_application_settings_path(anchor: 'js-repository-storage-settings'), html: { class: 'fieldset-form' } do |f|
|
||||||
= form_errors(@application_setting)
|
= form_errors(@application_setting)
|
||||||
|
|
||||||
%fieldset
|
%fieldset
|
||||||
.sub-section
|
.sub-section
|
||||||
%h4= _('Hashed repository storage paths')
|
%h4= _('Hashed repository storage paths')
|
||||||
.form-group
|
.form-group
|
||||||
.form-check
|
- repository_storage_help_link_url = help_page_path('administration/repository_storage_types.md')
|
||||||
= f.check_box :hashed_storage_enabled, class: 'form-check-input qa-hashed-storage-checkbox', disabled: @application_setting.hashed_storage_enabled?
|
- repository_storage_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: repository_storage_help_link_url }
|
||||||
= f.label :hashed_storage_enabled, _('Use hashed storage'), class: 'label-bold form-check-label'
|
= f.gitlab_ui_checkbox_component :hashed_storage_enabled,
|
||||||
.form-text.text-muted
|
_('Use hashed storage'),
|
||||||
= _('Use hashed storage paths for newly created and renamed repositories. Always enabled since 13.0.')
|
checkbox_options: { disabled: @application_setting.hashed_storage_enabled? },
|
||||||
= link_to s_('Learn more.'), help_page_path('administration/repository_storage_types.md', anchor: 'hashed-storage'), target: '_blank', rel: 'noopener noreferrer'
|
help_text: _('Use hashed storage paths for newly created and renamed repositories. Always enabled since 13.0. %{link_start}Learn more.%{link_end}').html_safe % { link_start: repository_storage_help_link_start, link_end: '</a>'.html_safe }
|
||||||
|
|
||||||
.sub-section
|
.sub-section
|
||||||
%h4= _("Storage nodes for new repositories")
|
%h4= _("Storage nodes for new repositories")
|
||||||
|
|
|
@ -3,7 +3,7 @@ table_name: ci_sources_pipelines
|
||||||
classes:
|
classes:
|
||||||
- Ci::Sources::Pipeline
|
- Ci::Sources::Pipeline
|
||||||
feature_categories:
|
feature_categories:
|
||||||
- continuous_integration
|
- pipeline_authoring
|
||||||
description: TODO
|
description: It stores parent-child and cross-project pipeline relationships.
|
||||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/163983e0d7d1dab622846441bd0dd9086c78a69f
|
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/163983e0d7d1dab622846441bd0dd9086c78a69f
|
||||||
milestone: '9.3'
|
milestone: '9.3'
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class AddLastRepositoryUpdatedAtToProjectRepositoryState < Gitlab::Database::Migration[1.0]
|
||||||
|
def change
|
||||||
|
add_column :project_repository_states, :last_repository_updated_at, :datetime_with_timezone
|
||||||
|
add_column :project_repository_states, :last_wiki_updated_at, :datetime_with_timezone
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1 @@
|
||||||
|
eeb0e38915de7053811e36b0829a21472c041131d1399ebaf14811d407a43f1b
|
|
@ -19338,7 +19338,9 @@ CREATE TABLE project_repository_states (
|
||||||
repository_retry_count integer,
|
repository_retry_count integer,
|
||||||
wiki_retry_count integer,
|
wiki_retry_count integer,
|
||||||
last_repository_verification_ran_at timestamp with time zone,
|
last_repository_verification_ran_at timestamp with time zone,
|
||||||
last_wiki_verification_ran_at timestamp with time zone
|
last_wiki_verification_ran_at timestamp with time zone,
|
||||||
|
last_repository_updated_at timestamp with time zone,
|
||||||
|
last_wiki_updated_at timestamp with time zone
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE SEQUENCE project_repository_states_id_seq
|
CREATE SEQUENCE project_repository_states_id_seq
|
||||||
|
|
|
@ -70,7 +70,7 @@ The following API resources are available in the project context:
|
||||||
| [Project milestones](milestones.md) | `/projects/:id/milestones` |
|
| [Project milestones](milestones.md) | `/projects/:id/milestones` |
|
||||||
| [Project snippets](project_snippets.md) | `/projects/:id/snippets` |
|
| [Project snippets](project_snippets.md) | `/projects/:id/snippets` |
|
||||||
| [Project templates](project_templates.md) | `/projects/:id/templates` |
|
| [Project templates](project_templates.md) | `/projects/:id/templates` |
|
||||||
| [Project vulnerabilities](project_vulnerabilities.md) **(ULTIMATE)** | `/projects/:id/templates` |
|
| [Project vulnerabilities](project_vulnerabilities.md) **(ULTIMATE)** | `/projects/:id/vulnerabilities` |
|
||||||
| [Project wikis](wikis.md) | `/projects/:id/wikis` |
|
| [Project wikis](wikis.md) | `/projects/:id/wikis` |
|
||||||
| [Project-level variables](project_level_variables.md) | `/projects/:id/variables` |
|
| [Project-level variables](project_level_variables.md) | `/projects/:id/variables` |
|
||||||
| [Projects](projects.md) including setting Webhooks | `/projects`, `/projects/:id/hooks` (also available for users) |
|
| [Projects](projects.md) including setting Webhooks | `/projects`, `/projects/:id/hooks` (also available for users) |
|
||||||
|
|
|
@ -36,23 +36,25 @@ module API
|
||||||
requires :status, type: String, values: POSSIBLE_VALUES, desc: 'The migration step status'
|
requires :status, type: String, values: POSSIBLE_VALUES, desc: 'The migration step status'
|
||||||
end
|
end
|
||||||
put 'internal/registry/repositories/*repository_path/migration/status' do
|
put 'internal/registry/repositories/*repository_path/migration/status' do
|
||||||
repository = find_repository!(declared_params[:repository_path])
|
::Gitlab::Database::LoadBalancing::Session.current.use_primary do
|
||||||
|
repository = find_repository!(declared_params[:repository_path])
|
||||||
|
|
||||||
unless repository.migration_in_active_state?
|
unless repository.migration_in_active_state?
|
||||||
bad_request!("Wrong migration state (#{repository.migration_state})")
|
bad_request!("Wrong migration state (#{repository.migration_state})")
|
||||||
end
|
end
|
||||||
|
|
||||||
case declared_params[:status]
|
case declared_params[:status]
|
||||||
when STATUS_PRE_IMPORT_COMPLETE
|
when STATUS_PRE_IMPORT_COMPLETE
|
||||||
unless repository.finish_pre_import_and_start_import
|
unless repository.finish_pre_import_and_start_import
|
||||||
bad_request!("Couldn't transition from pre_importing to importing")
|
bad_request!("Couldn't transition from pre_importing to importing")
|
||||||
|
end
|
||||||
|
when STATUS_IMPORT_COMPLETE
|
||||||
|
unless repository.finish_import
|
||||||
|
bad_request!("Couldn't transition from importing to import_done")
|
||||||
|
end
|
||||||
|
when STATUS_IMPORT_FAILED, STATUS_PRE_IMPORT_FAILED
|
||||||
|
repository.abort_import
|
||||||
end
|
end
|
||||||
when STATUS_IMPORT_COMPLETE
|
|
||||||
unless repository.finish_import
|
|
||||||
bad_request!("Couldn't transition from importing to import_done")
|
|
||||||
end
|
|
||||||
when STATUS_IMPORT_FAILED, STATUS_PRE_IMPORT_FAILED
|
|
||||||
repository.abort_import
|
|
||||||
end
|
end
|
||||||
|
|
||||||
status 200
|
status 200
|
||||||
|
|
|
@ -40870,7 +40870,7 @@ msgstr ""
|
||||||
msgid "Use hashed storage"
|
msgid "Use hashed storage"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Use hashed storage paths for newly created and renamed repositories. Always enabled since 13.0."
|
msgid "Use hashed storage paths for newly created and renamed repositories. Always enabled since 13.0. %{link_start}Learn more.%{link_end}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Use issue count"
|
msgid "Use issue count"
|
||||||
|
|
|
@ -11,7 +11,7 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
|
||||||
let_it_be(:namespace) { create_default(:namespace).freeze }
|
let_it_be(:namespace) { create_default(:namespace).freeze }
|
||||||
let_it_be(:project) { create_default(:project, :repository).freeze }
|
let_it_be(:project) { create_default(:project, :repository).freeze }
|
||||||
|
|
||||||
it 'paginates 15 pipeleines per page' do
|
it 'paginates 15 pipelines per page' do
|
||||||
expect(described_class.default_per_page).to eq(15)
|
expect(described_class.default_per_page).to eq(15)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -552,7 +552,7 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
|
||||||
it { is_expected.to be_truthy }
|
it { is_expected.to be_truthy }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when both sha and source_sha do not matche' do
|
context 'when both sha and source_sha do not match' do
|
||||||
let(:pipeline) { build(:ci_pipeline, sha: 'test', source_sha: 'test') }
|
let(:pipeline) { build(:ci_pipeline, sha: 'test', source_sha: 'test') }
|
||||||
|
|
||||||
it { is_expected.to be_falsy }
|
it { is_expected.to be_falsy }
|
||||||
|
@ -1534,6 +1534,21 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
|
||||||
expect(pipeline.started_at).to be_nil
|
expect(pipeline.started_at).to be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'from success' do
|
||||||
|
let(:started_at) { 2.days.ago }
|
||||||
|
let(:from_status) { :success }
|
||||||
|
|
||||||
|
before do
|
||||||
|
pipeline.update!(started_at: started_at)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'does not update on transitioning to running' do
|
||||||
|
pipeline.run
|
||||||
|
|
||||||
|
expect(pipeline.started_at).to eq started_at
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#finished_at' do
|
describe '#finished_at' do
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
RSpec.describe API::Internal::ContainerRegistry::Migration do
|
RSpec.describe API::Internal::ContainerRegistry::Migration, :aggregate_failures do
|
||||||
let_it_be_with_reload(:repository) { create(:container_repository) }
|
let_it_be_with_reload(:repository) { create(:container_repository) }
|
||||||
|
|
||||||
let(:secret_token) { 'secret_token' }
|
let(:secret_token) { 'secret_token' }
|
||||||
|
@ -147,6 +147,17 @@ RSpec.describe API::Internal::ContainerRegistry::Migration do
|
||||||
|
|
||||||
it_behaves_like 'returning an error', returning_status: :not_found
|
it_behaves_like 'returning an error', returning_status: :not_found
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'query read location' do
|
||||||
|
it 'reads from the primary' do
|
||||||
|
expect(ContainerRepository).to receive(:find_by_path!).and_wrap_original do |m, *args|
|
||||||
|
expect(::Gitlab::Database::LoadBalancing::Session.current.use_primary?).to eq(true)
|
||||||
|
m.call(*args)
|
||||||
|
end
|
||||||
|
|
||||||
|
subject
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with an invalid sent token' do
|
context 'with an invalid sent token' do
|
||||||
|
|
|
@ -93,7 +93,7 @@ module NavbarStructureHelper
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def analytics_sub_nav_item
|
def project_analytics_sub_nav_item
|
||||||
[
|
[
|
||||||
_('Value stream'),
|
_('Value stream'),
|
||||||
_('CI/CD'),
|
_('CI/CD'),
|
||||||
|
@ -102,6 +102,12 @@ module NavbarStructureHelper
|
||||||
_('Repository')
|
_('Repository')
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def group_analytics_sub_nav_item
|
||||||
|
[
|
||||||
|
_('Contribution')
|
||||||
|
]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
NavbarStructureHelper.prepend_mod
|
NavbarStructureHelper.prepend_mod
|
||||||
|
|
|
@ -95,7 +95,7 @@ RSpec.shared_context 'project navbar structure' do
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
nav_item: _('Analytics'),
|
nav_item: _('Analytics'),
|
||||||
nav_sub_items: analytics_sub_nav_item
|
nav_sub_items: project_analytics_sub_nav_item
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
nav_item: _('Wiki'),
|
nav_item: _('Wiki'),
|
||||||
|
@ -126,9 +126,7 @@ RSpec.shared_context 'group navbar structure' do
|
||||||
let(:analytics_nav_item) do
|
let(:analytics_nav_item) do
|
||||||
{
|
{
|
||||||
nav_item: _('Analytics'),
|
nav_item: _('Analytics'),
|
||||||
nav_sub_items: [
|
nav_sub_items: group_analytics_sub_nav_item
|
||||||
_('Contribution')
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue