Commit a68e9d33 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 7bc0aff0
......@@ -196,7 +196,7 @@ export default {
/>
</th>
<th>{{ s__('ContainerRegistry|Tag') }}</th>
<th>{{ s__('ContainerRegistry|Tag ID') }}</th>
<th ref="imageId">{{ s__('ContainerRegistry|Image ID') }}</th>
<th>{{ s__('ContainerRegistry|Size') }}</th>
<th>{{ s__('ContainerRegistry|Last Updated') }}</th>
<th>
......
......@@ -53,7 +53,7 @@ module Boards
service = Boards::Lists::GenerateService.new(board_parent, current_user)
if service.execute(board)
lists = board.lists.movable.preload_associations
lists = board.lists.movable.preload_associated_models
List.preload_preferences_for_user(lists, current_user)
......
......@@ -53,7 +53,7 @@ module Milestoneish
end
def sorted_issues(user)
issues_visible_to_user(user).preload_associations.sort_by_attribute('label_priority')
issues_visible_to_user(user).preload_associated_models.sort_by_attribute('label_priority')
end
def sorted_merge_requests(user)
......
......@@ -60,7 +60,7 @@ class Issue < ApplicationRecord
scope :order_closest_future_date, -> { reorder(Arel.sql('CASE WHEN issues.due_date >= CURRENT_DATE THEN 0 ELSE 1 END ASC, ABS(CURRENT_DATE - issues.due_date) ASC')) }
scope :order_relative_position_asc, -> { reorder(::Gitlab::Database.nulls_last_order('relative_position', 'ASC')) }
scope :preload_associations, -> { preload(:labels, project: :namespace) }
scope :preload_associated_models, -> { preload(:labels, project: :namespace) }
scope :with_api_entity_associations, -> { preload(:timelogs, :assignees, :author, :notes, :labels, project: [:route, { namespace: :route }] ) }
scope :public_only, -> { where(confidential: false) }
......
......@@ -21,7 +21,7 @@ class List < ApplicationRecord
scope :destroyable, -> { where(list_type: list_types.slice(*destroyable_types).values) }
scope :movable, -> { where(list_type: list_types.slice(*movable_types).values) }
scope :preload_associations, -> { preload(:board, label: :priorities) }
scope :preload_associated_models, -> { preload(:board, label: :priorities) }
scope :ordered, -> { order(:list_type, :position) }
......
......@@ -1066,7 +1066,7 @@ class MergeRequest < ApplicationRecord
# Returns the oldest multi-line commit message, or the MR title if none found
def default_squash_commit_message
strong_memoize(:default_squash_commit_message) do
commits.without_merge_commits.reverse.find(&:description?)&.safe_message || title
recent_commits.without_merge_commits.reverse_each.find(&:description?)&.safe_message || title
end
end
......
......@@ -15,7 +15,7 @@ class MergeRequestPollCachedWidgetEntity < IssuableEntity
expose :target_project_id
expose :squash
expose :rebase_in_progress?, as: :rebase_in_progress
expose :default_squash_commit_message
expose :default_squash_commit_message, if: -> (merge_request, _) { merge_request.mergeable? }
expose :commits_count
expose :merge_ongoing?, as: :merge_ongoing
expose :work_in_progress?, as: :work_in_progress
......@@ -25,8 +25,9 @@ class MergeRequestPollCachedWidgetEntity < IssuableEntity
expose :source_branch_exists?, as: :source_branch_exists
expose :branch_missing?, as: :branch_missing
expose :commits_without_merge_commits, using: MergeRequestWidgetCommitEntity do |merge_request|
merge_request.commits.without_merge_commits
expose :commits_without_merge_commits, using: MergeRequestWidgetCommitEntity,
if: -> (merge_request, _) { merge_request.mergeable? } do |merge_request|
merge_request.recent_commits.without_merge_commits
end
expose :diff_head_sha do |merge_request|
merge_request.diff_head_sha.presence
......
......@@ -6,7 +6,7 @@ module Boards
def execute(board)
board.lists.create(list_type: :backlog) unless board.lists.backlog.exists?
board.lists.preload_associations
board.lists.preload_associated_models
end
end
end
......
---
title: Change container registry column name from Tag ID to Image ID
merge_request: 20349
author:
type: fixed
---
title: Replace index on environments table project_id and state with project_id, state, and environment_type
merge_request: 19902
author:
type: performance
---
title: Upgrade to Gitaly v1.73.0
merge_request: 20443
author:
type: changed
---
title: Suggest squash commit messages based on recent commits
merge_request: 20231
author:
type: performance
......@@ -5,7 +5,6 @@ class Gitlab::Seeder::Users
RANDOM_USERS_COUNT = 20
MASS_USERS_COUNT = ENV['CI'] ? 10 : 1_000_000
MASS_INSERT_USERNAME_START = 'mass_insert_user_'
attr_reader :opts
......@@ -29,7 +28,7 @@ class Gitlab::Seeder::Users
ActiveRecord::Base.connection.execute <<~SQL
INSERT INTO users (username, name, email, confirmed_at, projects_limit, encrypted_password)
SELECT
'#{MASS_INSERT_USERNAME_START}' || seq,
'#{Gitlab::Seeder::MASS_INSERT_USER_START}' || seq,
'Seed user ' || seq,
'seed_user' || seq || '@example.com',
to_timestamp(seq),
......
......@@ -52,7 +52,6 @@ class Gitlab::Seeder::Projects
internal: 1, # 1m projects +
public: 1 # 1m projects = 5m total
}
MASS_INSERT_NAME_START = 'mass_insert_project_'
def seed!
Sidekiq::Testing.inline! do
......@@ -167,7 +166,7 @@ class Gitlab::Seeder::Projects
INSERT INTO projects (name, path, creator_id, namespace_id, visibility_level, created_at, updated_at)
SELECT
'Seed project ' || seq || ' ' || ('{#{visibility_per_user}}'::text[])[seq] AS project_name,
'mass_insert_project_' || ('{#{visibility_per_user}}'::text[])[seq] || '_' || seq AS project_path,
'#{Gitlab::Seeder::MASS_INSERT_PROJECT_START}' || ('{#{visibility_per_user}}'::text[])[seq] || '_' || seq AS project_path,
u.id AS user_id,
n.id AS namespace_id,
('{#{visibility_level_per_user}}'::int[])[seq] AS visibility_level,
......
# frozen_string_literal: true
class AddIndexToEnvironmentsOnProjectIdStateEnvironmentType < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
OLD_INDEX_NAME = 'index_environments_on_project_id_and_state'.freeze
NEW_INDEX_NAME = 'index_environments_on_project_id_state_environment_type'.freeze
disable_ddl_transaction!
def up
add_concurrent_index(:environments, [:project_id, :state, :environment_type], name: NEW_INDEX_NAME)
remove_concurrent_index_by_name(:environments, OLD_INDEX_NAME)
end
def down
add_concurrent_index(:environments, [:project_id, :state], name: OLD_INDEX_NAME)
remove_concurrent_index_by_name(:environments, NEW_INDEX_NAME)
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_11_15_091425) do
ActiveRecord::Schema.define(version: 2019_11_18_182722) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
......@@ -1435,7 +1435,7 @@ ActiveRecord::Schema.define(version: 2019_11_15_091425) do
t.index ["name"], name: "index_environments_on_name_varchar_pattern_ops", opclass: :varchar_pattern_ops
t.index ["project_id", "name"], name: "index_environments_on_project_id_and_name", unique: true
t.index ["project_id", "slug"], name: "index_environments_on_project_id_and_slug", unique: true
t.index ["project_id", "state"], name: "index_environments_on_project_id_and_state"
t.index ["project_id", "state", "environment_type"], name: "index_environments_on_project_id_state_environment_type"
end
create_table "epic_issues", id: :serial, force: :cascade do |t|
......
......@@ -20,11 +20,10 @@ for updates and roadmap.
### Architecture
For this document, the following network topology is assumed:
The most common architecture for Praefect is simplified in the diagram below:
```mermaid
graph TB
GitLab --> Gitaly;
GitLab --> Praefect;
Praefect --> Gitaly-1;
Praefect --> Gitaly-2;
......@@ -32,9 +31,8 @@ graph TB
```
Where `GitLab` is the collection of clients that can request Git operations.
`Gitaly` is a Gitaly server before using Praefect. The Praefect node has three
storage nodes attached. Praefect itself doesn't store data, but connects to
three Gitaly nodes, `Praefect-Gitaly-1`, `Praefect-Gitaly-2`, and `Praefect-Gitaly-3`.
The Praefect node has threestorage nodes attached. Praefect itself doesn't
store data, but connects to three Gitaly nodes, `Gitaly-1`, `Gitaly-2`, and `Gitaly-3`.
Praefect may be enabled on its own node or can be run on the GitLab server.
In the example below we will use a separate server, but the optimal configuration
......
......@@ -71,7 +71,7 @@ Once you're on the dashboard, at the top you should see a series of filters for:
- Report type
- Project
To the right of the filters, you should see a **Hide dismissed** toggle button ([available in GitLab Ultimate 12.5](https://gitlab.com/gitlab-org/gitlab/issues/9102)).
To the right of the filters, you should see a **Hide dismissed** toggle button ([available for GitLab.com Gold, planned for GitLab Ultimate 12.6](https://gitlab.com/gitlab-org/gitlab/issues/9102)).
NOTE: **Note:**
The dashboard only shows projects with [security reports](#supported-reports) enabled in a group.
......
......@@ -90,7 +90,7 @@ It makes use of [new markdown features](#new-GFM-markdown-extensions),
not found in standard markdown:
- [Color "chips" written in HEX, RGB or HSL](#colors)
- [Diagrams and flowcharts using Mermaid](#diagrams-and-flowcharts-using-mermaid)
- [Diagrams and flowcharts](#diagrams-and-flowcharts)
- [Emoji](#emoji)
- [Front matter](#front-matter)
- [Inline diffs](#inline-diff)
......@@ -151,13 +151,16 @@ Color written inside backticks will be followed by a color "chip":
`HSL(540,70%,50%)`
`HSLA(540,70%,50%,0.3)`
### Diagrams and flowcharts using Mermaid
### Diagrams and flowcharts
It is possible to generate diagrams and flowcharts from text in GitLab using [Mermaid](https://mermaidjs.github.io/) or [PlantUML](http://plantuml.com).
#### Mermaid
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/15107) in
GitLab 10.3.
It is possible to generate diagrams and flowcharts from text using [Mermaid](https://mermaidjs.github.io/).
Visit the official page for more details.
Visit the [official page](https://mermaidjs.github.io/) for more details.
In order to generate a diagram or flowchart, you should write your text inside the `mermaid` block:
......@@ -179,8 +182,6 @@ graph TD;
C-->D;
```
#### Subgraphs
Subgraphs can also be included:
~~~
......@@ -219,6 +220,10 @@ graph TB
end
```
#### PlantUML
To make PlantUML available in GitLab, a GitLab administrator needs to enable it first. Read more in [PlantUML & GitLab](../administration/integration/plantuml.md).
### Emoji
> If this is not rendered correctly, [view it in GitLab itself](https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#emoji).
......
......@@ -9,6 +9,7 @@ class Feature
%w[
inforef_uploadpack_cache
get_all_lfs_pointers_go
get_tag_messages_go
].freeze
DEFAULT_ON_FLAGS = Set.new([]).freeze
......
......@@ -16,6 +16,8 @@ module Gitlab
class Seeder
extend ActionView::Helpers::NumberHelper
MASS_INSERT_PROJECT_START = 'mass_insert_project_'
MASS_INSERT_USER_START = 'mass_insert_user_'
ESTIMATED_INSERT_PER_MINUTE = 2_000_000
MASS_INSERT_ENV = 'MASS_INSERT'
......@@ -24,7 +26,7 @@ module Gitlab
included do
scope :not_mass_generated, -> do
where.not("path LIKE '#{Gitlab::Seeder::Projects::MASS_INSERT_NAME_START}%'")
where.not("path LIKE '#{MASS_INSERT_PROJECT_START}%'")
end
end
end
......@@ -34,7 +36,7 @@ module Gitlab
included do
scope :not_mass_generated, -> do
where.not("username LIKE '#{Gitlab::Seeder::Users::MASS_INSERT_USERNAME_START}%'")
where.not("username LIKE '#{MASS_INSERT_USER_START}%'")
end
end
end
......
......@@ -4560,6 +4560,9 @@ msgstr ""
msgid "ContainerRegistry|If you are not already logged in, you need to authenticate to the Container Registry by using your GitLab username and password. If you have %{twofaDocLinkStart}Two-Factor Authentication%{twofaDocLinkEnd} enabled, use a %{personalAccessTokensDocLinkStart}Personal Access Token%{personalAccessTokensDocLinkEnd} instead of a password."
msgstr ""
msgid "ContainerRegistry|Image ID"
msgstr ""
msgid "ContainerRegistry|Last Updated"
msgstr ""
......@@ -4583,9 +4586,6 @@ msgstr ""
msgid "ContainerRegistry|Tag"
msgstr ""
msgid "ContainerRegistry|Tag ID"
msgstr ""
msgid "ContainerRegistry|The last tag related to this image was recently removed. This empty image and any associated data will be automatically removed as part of the regular Garbage Collection process. If you have any questions, contact your administrator."
msgstr ""
......@@ -15546,6 +15546,9 @@ msgstr ""
msgid "Service Desk"
msgstr ""
msgid "Service Desk is enabled but not yet active"
msgstr ""
msgid "Service Templates"
msgstr ""
......@@ -19941,6 +19944,9 @@ msgstr ""
msgid "You must select a stack for configuring your cloud provider. Learn more about"
msgstr ""
msgid "You must set up incoming email before it becomes active."
msgstr ""
msgid "You need a different license to enable FileLocks feature"
msgstr ""
......
......@@ -25,6 +25,7 @@ describe('table registry', () => {
const findDeleteButtonsRow = (w = wrapper) => w.findAll('.js-delete-registry-row');
const findPagination = (w = wrapper) => w.find('.js-registry-pagination');
const findDeleteModal = (w = wrapper) => w.find({ ref: 'deleteModal' });
const findImageId = (w = wrapper) => w.find({ ref: 'imageId' });
const bulkDeletePath = 'path';
const mountWithStore = config => mount(tableRegistry, { ...config, store, localVue });
......@@ -68,6 +69,15 @@ describe('table registry', () => {
expect(tds.at(3).html()).toContain(repoPropsData.list[0].size);
expect(tds.at(4).html()).toContain(wrapper.vm.timeFormated(repoPropsData.list[0].createdAt));
});
it('should have a label called Image ID', () => {
const label = findImageId();
expect(label.element).toMatchInlineSnapshot(`
<th>
Image ID
</th>
`);
});
});
describe('multi select', () => {
......
......@@ -115,8 +115,24 @@ describe MergeRequest do
let(:multiline_commits) { subject.commits.select(&is_multiline) }
let(:singleline_commits) { subject.commits.reject(&is_multiline) }
it 'returns the oldest multiline commit message' do
expect(subject.default_squash_commit_message).to eq(multiline_commits.last.message)
context 'when the total number of commits is safe' do
it 'returns the oldest multiline commit message' do
expect(subject.default_squash_commit_message).to eq(multiline_commits.last.message)
end
end
context 'when the total number of commits is big' do
let(:safe_number) { 20 }
before do
stub_const('MergeRequestDiff::COMMITS_SAFE_SIZE', safe_number)
end
it 'returns the oldest multiline commit message from safe number of commits' do
expect(subject.default_squash_commit_message).to eq(
"remove emtpy file.(beacase git ignore empty file)\nadd whitespace test file.\n"
)
end
end
it 'returns the merge request title if there are no multiline commits' do
......
......@@ -318,7 +318,7 @@ describe API::Internal::Base do
expect(json_response["gitaly"]["repository"]["relative_path"]).to eq(project.repository.gitaly_repository.relative_path)
expect(json_response["gitaly"]["address"]).to eq(Gitlab::GitalyClient.address(project.repository_storage))
expect(json_response["gitaly"]["token"]).to eq(Gitlab::GitalyClient.token(project.repository_storage))
expect(json_response["gitaly"]["features"]).to eq('gitaly-feature-get-all-lfs-pointers-go' => 'true', 'gitaly-feature-inforef-uploadpack-cache' => 'true')
expect(json_response["gitaly"]["features"]).to eq('gitaly-feature-get-all-lfs-pointers-go' => 'true', 'gitaly-feature-inforef-uploadpack-cache' => 'true', 'gitaly-feature-get-tag-messages-go' => 'true')
expect(user.reload.last_activity_on).to eql(Date.today)
end
end
......@@ -338,7 +338,7 @@ describe API::Internal::Base do
expect(json_response["gitaly"]["repository"]["relative_path"]).to eq(project.repository.gitaly_repository.relative_path)
expect(json_response["gitaly"]["address"]).to eq(Gitlab::GitalyClient.address(project.repository_storage))
expect(json_response["gitaly"]["token"]).to eq(Gitlab::GitalyClient.token(project.repository_storage))
expect(json_response["gitaly"]["features"]).to eq('gitaly-feature-get-all-lfs-pointers-go' => 'true', 'gitaly-feature-inforef-uploadpack-cache' => 'true')
expect(json_response["gitaly"]["features"]).to eq('gitaly-feature-get-all-lfs-pointers-go' => 'true', 'gitaly-feature-inforef-uploadpack-cache' => 'true', 'gitaly-feature-get-tag-messages-go' => 'true')
expect(user.reload.last_activity_on).to be_nil
end
end
......@@ -580,7 +580,7 @@ describe API::Internal::Base do
expect(json_response["gitaly"]["repository"]["relative_path"]).to eq(project.repository.gitaly_repository.relative_path)
expect(json_response["gitaly"]["address"]).to eq(Gitlab::GitalyClient.address(project.repository_storage))
expect(json_response["gitaly"]["token"]).to eq(Gitlab::GitalyClient.token(project.repository_storage))
expect(json_response["gitaly"]["features"]).to eq('gitaly-feature-get-all-lfs-pointers-go' => 'true', 'gitaly-feature-inforef-uploadpack-cache' => 'true')
expect(json_response["gitaly"]["features"]).to eq('gitaly-feature-get-all-lfs-pointers-go' => 'true', 'gitaly-feature-inforef-uploadpack-cache' => 'true', 'gitaly-feature-get-tag-messages-go' => 'true')
end
end
......
......@@ -212,9 +212,29 @@ describe MergeRequestWidgetEntity do
.to eq(resource.default_merge_commit_message(include_description: true))
end
it 'has default_squash_commit_message' do
expect(subject[:default_squash_commit_message])
.to eq(resource.default_squash_commit_message)
describe 'attributes for squash commit message' do
context 'when merge request is mergeable' do
before do
stub_const('MergeRequestDiff::COMMITS_SAFE_SIZE', 20)
end
it 'has default_squash_commit_message and commits_without_merge_commits' do
expect(subject[:default_squash_commit_message])
.to eq(resource.default_squash_commit_message)
expect(subject[:commits_without_merge_commits].size).to eq(12)
end
end
context 'when merge request is not mergeable' do
before do
allow(resource).to receive(:mergeable?).and_return(false)
end
it 'does not have default_squash_commit_message and commits_without_merge_commits' do
expect(subject[:default_squash_commit_message]).to eq(nil)
expect(subject[:commits_without_merge_commits]).to eq(nil)
end
end
end
describe 'new_blob_path' do
......
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