提交 497b7315 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/gitlab@master

上级 c8489a14
......@@ -35,6 +35,6 @@ class Profiles::NotificationsController < Profiles::ApplicationController
private
def user_groups
GroupsFinder.new(current_user).execute.order_name_asc.page(params[:page]).per(NOTIFICATIONS_PER_PAGE)
GroupsFinder.new(current_user, all_available: false).execute.order_name_asc.page(params[:page]).per(NOTIFICATIONS_PER_PAGE)
end
end
......@@ -22,10 +22,7 @@ module DesignManagement
items = by_visible_at_version(items)
items = by_filename(items)
items = by_id(items)
# TODO: We don't need to pass the project anymore after the feature flag is removed
# https://gitlab.com/gitlab-org/gitlab/-/issues/34382
items.ordered(issue.project)
items.ordered
end
private
......
......@@ -20,10 +20,6 @@ module Mutations
null: true,
description: "The current state of the collection"
def ready(*)
raise ::Gitlab::Graphql::Errors::ResourceNotAvailable unless ::Feature.enabled?(:reorder_designs, default_enabled: true)
end
def resolve(**args)
service = ::DesignManagement::MoveDesignsService.new(current_user, parameters(args))
......
......@@ -79,16 +79,10 @@ module DesignManagement
joins(join.join_sources).where(actions[:event].not_eq(deletion))
end
scope :ordered, -> (project) do
# TODO: Always order by relative position after the feature flag is removed
# https://gitlab.com/gitlab-org/gitlab/-/issues/34382
if Feature.enabled?(:reorder_designs, project, default_enabled: true)
# We need to additionally sort by `id` to support keyset pagination.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17788/diffs#note_230875678
order(:relative_position, :id)
else
in_creation_order
end
scope :ordered, -> do
# We need to additionally sort by `id` to support keyset pagination.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17788/diffs#note_230875678
order(:relative_position, :id)
end
scope :in_creation_order, -> { reorder(:id) }
......
......@@ -23,7 +23,6 @@ class ProjectStatistics < ApplicationRecord
scope :for_project_ids, ->(project_ids) { where(project_id: project_ids) }
scope :for_namespaces, -> (namespaces) { where(namespace: namespaces) }
scope :with_any_ci_minutes_used, -> { where.not(shared_runners_seconds: 0) }
def total_repository_size
repository_size + lfs_objects_size
......
......@@ -101,11 +101,6 @@ class ProjectPolicy < BasePolicy
!@subject.design_management_enabled?
end
with_scope :subject
condition(:moving_designs_disabled) do
!::Feature.enabled?(:reorder_designs, @subject, default_enabled: true)
end
with_scope :subject
condition(:service_desk_enabled) { @subject.service_desk_enabled? }
......@@ -557,10 +552,6 @@ class ProjectPolicy < BasePolicy
prevent :move_design
end
rule { moving_designs_disabled }.policy do
prevent :move_design
end
rule { read_package_registry_deploy_token }.policy do
enable :read_package
enable :read_project
......
......@@ -13,7 +13,6 @@ module DesignManagement
def execute
return error(:no_focus) unless current_design.present?
return error(:cannot_move) unless ::Feature.enabled?(:reorder_designs, project, default_enabled: true)
return error(:cannot_move) unless current_user.can?(:move_design, current_design)
return error(:no_neighbors) unless neighbors.present?
return error(:not_distinct) unless all_distinct?
......
---
title: Do not show all public groups in global notification settings page
merge_request: 40879
author:
type: fixed
---
name: reorder_designs
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37835
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/232992
group: group::knowledge
type: development
default_enabled: true
......@@ -271,7 +271,7 @@ https://gitlab.example.com/<namespace>/<project>/badges/<branch>/pipeline.svg
If you want the pipeline status badge to only display the last non-skipped status, you can use the `?ignore_skipped=true` query parameter:
```plaintext
https://example.gitlab.com/<namespace>/<project>/badges/<branch>/pipeline.svg?ignore_skipped=true
https://gitlab.example.com/<namespace>/<project>/badges/<branch>/pipeline.svg?ignore_skipped=true
```
### Test coverage report badge
......
......@@ -88,20 +88,20 @@ The fair usage algorithm assigns jobs in this order:
If these jobs are in the queue:
- Job 1 for project 1
- Job 2 for project 1
- Job 3 for project 1
- Job 4 for project 2
- Job 5 for project 2
- Job 6 for project 3
- Job 1 for Project 1
- Job 2 for Project 1
- Job 3 for Project 1
- Job 4 for Project 2
- Job 5 for Project 2
- Job 6 for Project 3
The fair usage algorithm assigns jobs in this order:
1. Job 1 is chosen first, because it has the lowest job number from projects with no running jobs (that is, all projects).
1. We finish job 1.
1. We finish Job 1.
1. Job 2 is next, because, having finished Job 1, all projects have 0 jobs running again, and 2 is the lowest available job number.
1. Job 4 is next, because with Project 1 running a job, 4 is the lowest number from projects running no jobs (Projects 2 and 3).
1. We finish job 4.
1. Job 4 is next, because with Project 1 running a Job, 4 is the lowest number from projects running no jobs (Projects 2 and 3).
1. We finish Job 4.
1. Job 5 is next, because having finished Job 4, Project 2 has no jobs running again.
1. Job 6 is next, because Project 3 is the only project left with no running jobs.
1. Lastly we choose Job 3... because, again, it's the only job left.
......
......@@ -1528,7 +1528,7 @@ same rule.
In the following example:
- If the dockerfile or any file in `/docker/scripts` has changed, and var=blah,
- If the `Dockerfile` file or any file in `/docker/scripts` has changed, and var=blah,
then the job runs manually
- Otherwise, the job isn't included in the pipeline.
......@@ -1773,7 +1773,7 @@ This means the keys are treated as if joined by an OR. This relationship could b
In the example below, the `test` job will **not** be created when **any** of the following are true:
- The pipeline runs for the `master`.
- The pipeline runs for the `master` branch.
- There are changes to the `README.md` file in the root directory of the repository.
```yaml
......@@ -3221,7 +3221,7 @@ Send all untracked files but [exclude](#artifactsexclude) `*.txt`:
artifacts:
untracked: true
exclude:
- *.txt
- "*.txt"
```
#### `artifacts:when`
......
......@@ -7,8 +7,8 @@ type: howto
# Create and add your SSH key pair
It is best practice to use [Git over SSH instead of Git over HTTP](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols).
In order to use SSH, you will need to:
It's best practice to use [Git over SSH instead of Git over HTTP](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols).
In order to use SSH, you need to:
1. Create an SSH key pair
1. Add your SSH public key to GitLab
......@@ -25,6 +25,6 @@ To add the SSH public key to GitLab, see
[Adding an SSH key to your GitLab account](../ssh/README.md#adding-an-ssh-key-to-your-gitlab-account).
NOTE: **Note:**
Once you add a key, you cannot edit it. If it didn't paste properly, it
Once you add a key, you can't edit it. If it did not paste properly, it
[will not work](../ssh/README.md#testing-that-everything-is-set-up-correctly), and
you will need to remove the key from GitLab and try adding it again.
you need to remove the key from GitLab and try adding it again.
......@@ -68,10 +68,6 @@ module Gitlab
::Feature.enabled?(:ci_lint_creates_pipeline_with_dry_run, project, default_enabled: true)
end
def self.reset_ci_minutes_for_all_namespaces?
::Feature.enabled?(:reset_ci_minutes_for_all_namespaces, default_enabled: false)
end
def self.project_transactionless_destroy?(project)
Feature.enabled?(:project_transactionless_destroy, project, default_enabled: false)
end
......
......@@ -82,7 +82,7 @@ module Gitlab
endpointSelector: selector,
ingress: ingress,
egress: egress
}
}.compact!
end
override :kind
......
......@@ -10684,9 +10684,6 @@ msgstr ""
msgid "FeatureFlags|User List"
msgstr ""
msgid "FeatureFlag|Delete strategy"
msgstr ""
msgid "FeatureFlag|List"
msgstr ""
......
......@@ -54,19 +54,36 @@ RSpec.describe Profiles::NotificationsController do
end
context 'with group notifications' do
let(:notifications_per_page) { 5 }
let_it_be(:group) { create(:group) }
let_it_be(:subgroups) { create_list(:group, 10, parent: group) }
before do
group.add_developer(user)
sign_in(user)
stub_const('Profiles::NotificationsController::NOTIFICATIONS_PER_PAGE', 5)
get :show
stub_const('Profiles::NotificationsController::NOTIFICATIONS_PER_PAGE', notifications_per_page)
end
it 'paginates the groups' do
get :show
expect(assigns(:group_notifications).count).to eq(5)
end
context 'when the user is not a member' do
let(:notifications_per_page) { 20 }
let_it_be(:public_group) { create(:group, :public) }
it 'does not show public groups', :aggregate_failures do
get :show
# Let's make sure we're grabbing all groups in one page, just in case
expect(assigns(:user_groups).count).to eq(11)
expect(assigns(:user_groups)).not_to include(public_group)
end
end
end
context 'with project notifications' do
......
......@@ -42,26 +42,6 @@ RSpec.describe DesignManagement::DesignsFinder do
is_expected.to eq([design3, design2, design1])
end
context 'when the :reorder_designs feature is enabled for the project' do
before do
stub_feature_flags(reorder_designs: project)
end
it 'returns the designs sorted by their relative position' do
is_expected.to eq([design3, design2, design1])
end
end
context 'when the :reorder_designs feature is disabled' do
before do
stub_feature_flags(reorder_designs: false)
end
it 'returns the designs sorted by ID' do
is_expected.to eq([design1, design2, design3])
end
end
context 'when argument is the ids of designs' do
let(:params) { { ids: [design1.id] } }
......
......@@ -20,7 +20,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do
kind: partial_class_name,
apiVersion: "cilium.io/v2",
metadata: { name: name, namespace: namespace, resourceVersion: resource_version },
spec: { endpointSelector: endpoint_selector, ingress: ingress, egress: nil }
spec: { endpointSelector: endpoint_selector, ingress: ingress }
)
end
......@@ -61,7 +61,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do
)
end
let(:spec) { { endpointSelector: selector, ingress: ingress, egress: nil } }
let(:spec) { { endpointSelector: selector, ingress: ingress } }
let(:metadata) { { name: name, namespace: namespace, resourceVersion: resource_version } }
end
......@@ -180,7 +180,7 @@ RSpec.describe Gitlab::Kubernetes::CiliumNetworkPolicy do
kind: partial_class_name,
apiVersion: "cilium.io/v2",
metadata: { name: name, namespace: namespace, resourceVersion: resource_version, labels: { app: 'foo' } },
spec: { endpointSelector: endpoint_selector, ingress: ingress, egress: nil }
spec: { endpointSelector: endpoint_selector, ingress: ingress }
)
end
......
......@@ -41,7 +41,7 @@ RSpec.describe DesignManagement::DesignCollection do
design2 = collection.find_or_create_design!(filename: 'design2.jpg')
expect(collection.designs.ordered(issue.project)).to eq([design1, design2])
expect(collection.designs.ordered).to eq([design1, design2])
end
end
......
......@@ -161,27 +161,7 @@ RSpec.describe DesignManagement::Design do
end
it 'sorts by relative position and ID in ascending order' do
expect(described_class.ordered(issue.project)).to eq([design2, design1, design3, deleted_design])
end
context 'when the :reorder_designs feature is enabled for the project' do
before do
stub_feature_flags(reorder_designs: issue.project)
end
it 'sorts by relative position and ID in ascending order' do
expect(described_class.ordered(issue.project)).to eq([design2, design1, design3, deleted_design])
end
end
context 'when the :reorder_designs feature is disabled' do
before do
stub_feature_flags(reorder_designs: false)
end
it 'sorts by ID in ascending order' do
expect(described_class.ordered(issue.project)).to eq([design1, design2, design3, deleted_design])
end
expect(described_class.ordered).to eq([design2, design1, design3, deleted_design])
end
end
......
......@@ -131,17 +131,6 @@ RSpec.describe DesignManagement::DesignPolicy do
it_behaves_like "design abilities available for members"
context 'when reorder_designs is not enabled' do
before do
stub_feature_flags(reorder_designs: false)
end
let(:current_user) { developer }
it { is_expected.to be_allowed(*(developer_design_abilities - [:move_design])) }
it { is_expected.to be_disallowed(:move_design) }
end
context "for guests in private projects" do
let_it_be(:project) { create(:project, :private) }
let(:current_user) { guest }
......
......@@ -32,30 +32,6 @@ RSpec.describe DesignManagement::MoveDesignsService do
describe '#execute' do
subject { service.execute }
context 'the feature is unavailable' do
let(:current_design) { designs.first }
let(:previous_design) { designs.second }
let(:next_design) { designs.third }
before do
stub_feature_flags(reorder_designs: false)
end
it 'raises cannot_move' do
expect(subject).to be_error.and(have_attributes(message: :cannot_move))
end
context 'but it is available on the current project' do
before do
stub_feature_flags(reorder_designs: issue.project)
end
it 'is successful' do
expect(subject).to be_success
end
end
end
context 'the user cannot move designs' do
let(:current_design) { designs.first }
let(:current_user) { build_stubbed(:user) }
......@@ -124,7 +100,7 @@ RSpec.describe DesignManagement::MoveDesignsService do
expect(subject).to be_success
expect(issue.designs.ordered(issue.project)).to eq([
expect(issue.designs.ordered).to eq([
# Existing designs which already had a relative_position set.
# These should stay at the beginning, in the same order.
other_design1,
......
......@@ -10,9 +10,8 @@ RSpec.describe Metrics::Dashboard::GitlabAlertEmbedService do
let_it_be(:user) { create(:user) }
let(:alert_id) { alert.id }
before do
before_all do
project.add_maintainer(user)
project.clear_memoization(:licensed_feature_available)
end
describe '.valid_params?' do
......
......@@ -6,8 +6,6 @@ RSpec.describe Projects::Alerting::NotifyService do
let_it_be(:project, reload: true) { create(:project, :repository) }
before do
# We use `let_it_be(:project)` so we make sure to clear caches
project.clear_memoization(:licensed_feature_available)
allow(ProjectServiceWorker).to receive(:perform_async)
end
......
......@@ -16,11 +16,6 @@ RSpec.describe Projects::Prometheus::Alerts::NotifyService do
let(:subject) { service.execute(token_input) }
before do
# We use `let_it_be(:project)` so we make sure to clear caches
project.clear_memoization(:licensed_feature_available)
end
context 'with valid payload' do
let_it_be(:alert_firing) { create(:prometheus_alert, project: project) }
let_it_be(:alert_resolved) { create(:prometheus_alert, project: project) }
......
文件模式从 100644 更改为 100755
文件模式从 100644 更改为 100755
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册