Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
c77ce73fa8
commit
5e13b3a9e5
8 changed files with 76 additions and 45 deletions
|
@ -160,7 +160,7 @@ module IssuableActions
|
|||
|
||||
if issuable.is_a?(MergeRequest)
|
||||
render_cached(discussions, with: discussion_serializer, cache_context: -> (_) { discussion_cache_context }, context: self)
|
||||
elsif issuable.is_a?(Issue) && Feature.enabled?(:issue_discussions_http_cache, default_enabled: :yaml)
|
||||
elsif issuable.is_a?(Issue)
|
||||
render json: discussion_serializer.represent(discussions, context: self) if stale?(etag: [discussion_cache_context, discussions])
|
||||
else
|
||||
render json: discussion_serializer.represent(discussions, context: self)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
name: issue_discussions_http_cache
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72589
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/343309
|
||||
name: between_commits_via_list_commits
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74273
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/345458
|
||||
milestone: '14.5'
|
||||
type: development
|
||||
group: group::project management
|
||||
group: group::gitaly
|
||||
default_enabled: false
|
|
@ -0,0 +1,14 @@
|
|||
- name: "defaultMergeCommitMessageWithDescription GraphQL API field will be removed in GitLab 15.0" # The name of the feature to be deprecated
|
||||
announcement_milestone: "14.5" # The milestone when this feature was first announced as deprecated.
|
||||
announcement_date: "2021-11-22" # The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post.
|
||||
removal_milestone: "15.0" # The milestone when this feature is planned to be removed
|
||||
body: | # Do not modify this line, instead modify the lines below.
|
||||
The GraphQL API field `defaultMergeCommitMessageWithDescription` has been deprecated and will be removed in GitLab 15.0. For projects with a commit message template set, it will ignore the template.
|
||||
# The following items are not published on the docs page, but may be used in the future.
|
||||
stage: # (optional - may be required in the future) String value of the stage that the feature was created in. e.g., Growth
|
||||
tiers: # (optional - may be required in the future) An array of tiers that the feature is available in currently. e.g., [Free, Silver, Gold, Core, Premium, Ultimate]
|
||||
issue_url: # (optional) This is a link to the deprecation issue in GitLab
|
||||
documentation_url: # (optional) This is a link to the current documentation page
|
||||
image_url: # (optional) This is a link to a thumbnail image depicting the feature
|
||||
video_url: # (optional) Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg
|
||||
removal_date: # (optional - may be required in the future) YYYY-MM-DD format. This should almost always be the 22nd of a month (YYYY-MM-22), the date of the milestone release when this feature is planned to be removed
|
|
@ -8,6 +8,8 @@ class UpdateVulnerabilityOccurrencesLocation < Gitlab::Database::Migration[1.0]
|
|||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
return unless Gitlab.ee?
|
||||
|
||||
relation = Gitlab::BackgroundMigration::UpdateVulnerabilityOccurrencesLocation::Occurrence.where(location: nil)
|
||||
queue_background_migration_jobs_by_range_at_intervals(relation,
|
||||
MIGRATION_NAME,
|
||||
|
|
|
@ -157,6 +157,12 @@ Prior to 14.5, if you did not define the `AuthenticationType`, GitLab Runner cho
|
|||
|
||||
Announced: 2021-11-22
|
||||
|
||||
### defaultMergeCommitMessageWithDescription GraphQL API field will be removed in GitLab 15.0
|
||||
|
||||
The GraphQL API field `defaultMergeCommitMessageWithDescription` has been deprecated and will be removed in GitLab 15.0. For projects with a commit message template set, it will ignore the template.
|
||||
|
||||
Announced: 2021-11-22
|
||||
|
||||
## 15.2
|
||||
|
||||
### NFS for Git repository storage deprecated
|
||||
|
|
|
@ -205,6 +205,8 @@ module Gitlab
|
|||
end
|
||||
|
||||
def between(from, to)
|
||||
return list_commits(["^" + from, to], reverse: true) if Feature.enabled?(:between_commits_via_list_commits)
|
||||
|
||||
request = Gitaly::CommitsBetweenRequest.new(
|
||||
repository: @gitaly_repo,
|
||||
from: from,
|
||||
|
|
|
@ -112,6 +112,28 @@ RSpec.describe Gitlab::GitalyClient::CommitService do
|
|||
let(:from) { 'master' }
|
||||
let(:to) { Gitlab::Git::EMPTY_TREE_ID }
|
||||
|
||||
context 'with between_commits_via_list_commits enabled' do
|
||||
before do
|
||||
stub_feature_flags(between_commits_via_list_commits: true)
|
||||
end
|
||||
|
||||
it 'sends an RPC request' do
|
||||
request = Gitaly::ListCommitsRequest.new(
|
||||
repository: repository_message, revisions: ["^" + from, to], reverse: true
|
||||
)
|
||||
|
||||
expect_any_instance_of(Gitaly::CommitService::Stub).to receive(:list_commits)
|
||||
.with(request, kind_of(Hash)).and_return([])
|
||||
|
||||
described_class.new(repository).between(from, to)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with between_commits_via_list_commits disabled' do
|
||||
before do
|
||||
stub_feature_flags(between_commits_via_list_commits: false)
|
||||
end
|
||||
|
||||
it 'sends an RPC request' do
|
||||
request = Gitaly::CommitsBetweenRequest.new(
|
||||
repository: repository_message, from: from, to: to
|
||||
|
@ -123,6 +145,7 @@ RSpec.describe Gitlab::GitalyClient::CommitService do
|
|||
described_class.new(repository).between(from, to)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#diff_stats' do
|
||||
let(:left_commit_id) { 'master' }
|
||||
|
|
|
@ -14,6 +14,7 @@ RSpec.describe 'issue discussions' do
|
|||
project.add_maintainer(user)
|
||||
end
|
||||
|
||||
context 'HTTP caching' do
|
||||
def get_discussions
|
||||
get discussions_namespace_project_issue_path(namespace_id: project.namespace, project_id: project, id: issue.iid), headers: {
|
||||
'If-None-Match' => @etag
|
||||
|
@ -28,6 +29,14 @@ RSpec.describe 'issue discussions' do
|
|||
get_discussions
|
||||
end
|
||||
|
||||
it 'returns 304 without serializing JSON' do
|
||||
expect(DiscussionSerializer).not_to receive(:new)
|
||||
|
||||
get_discussions
|
||||
|
||||
expect(response).to have_gitlab_http_status(:not_modified)
|
||||
end
|
||||
|
||||
shared_examples 'cache miss' do
|
||||
it 'returns 200 and serializes JSON' do
|
||||
expect(DiscussionSerializer).to receive(:new).and_call_original
|
||||
|
@ -38,31 +47,6 @@ RSpec.describe 'issue discussions' do
|
|||
end
|
||||
end
|
||||
|
||||
shared_examples 'cache hit' do
|
||||
it 'returns 304 without serializing JSON' do
|
||||
expect(DiscussionSerializer).not_to receive(:new)
|
||||
|
||||
get_discussions
|
||||
|
||||
expect(response).to have_gitlab_http_status(:not_modified)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when issue_discussions_http_cache is disabled' do
|
||||
before do
|
||||
stub_feature_flags(issue_discussions_http_cache: false)
|
||||
end
|
||||
|
||||
it_behaves_like 'cache miss'
|
||||
end
|
||||
|
||||
context 'when issue_discussions_http_cache is enabled' do
|
||||
before do
|
||||
stub_feature_flags(issue_discussions_http_cache: true)
|
||||
end
|
||||
|
||||
it_behaves_like 'cache hit'
|
||||
|
||||
context 'when user role changes' do
|
||||
before do
|
||||
project.add_guest(user)
|
||||
|
|
Loading…
Reference in a new issue