Skip to content
Snippets Groups Projects
Commit 0d6fa033 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 0eb3d2f7
No related branches found
No related tags found
No related merge requests found
Showing
with 83 additions and 71 deletions
# frozen_string_literal: true
class AddDissmisedAtToUserCallouts < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :user_callouts, :dismissed_at, :datetime_with_timezone
end
end
Loading
Loading
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
 
ActiveRecord::Schema.define(version: 2020_02_04_131054) do
ActiveRecord::Schema.define(version: 2020_02_05_143231) do
 
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
Loading
Loading
@@ -4101,6 +4101,7 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do
create_table "user_callouts", id: :serial, force: :cascade do |t|
t.integer "feature_name", null: false
t.integer "user_id", null: false
t.datetime_with_timezone "dismissed_at"
t.index ["user_id", "feature_name"], name: "index_user_callouts_on_user_id_and_feature_name", unique: true
t.index ["user_id"], name: "index_user_callouts_on_user_id"
end
Loading
Loading
Loading
Loading
@@ -727,7 +727,7 @@ For example:
Geo database has an outdated FDW remote schema. It contains 229 of 236 expected tables. Please refer to Geo Troubleshooting.
```
 
To resolve this, run the following command:
To resolve this, run the following command on the **secondary**:
 
```shell
sudo gitlab-rake geo:db:refresh_foreign_tables
Loading
Loading
Loading
Loading
@@ -5831,6 +5831,11 @@ type ProjectPermissions {
"""
readDesign: Boolean!
 
"""
Indicates the user can perform `read_merge_request` on this resource
"""
readMergeRequest: Boolean!
"""
Indicates the user can perform `read_pages_content` on this resource
"""
Loading
Loading
Loading
Loading
@@ -2253,6 +2253,24 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "readMergeRequest",
"description": "Indicates the user can perform `read_merge_request` on this resource",
"args": [
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "readPagesContent",
"description": "Indicates the user can perform `read_pages_content` on this resource",
Loading
Loading
Loading
Loading
@@ -867,6 +867,7 @@ Information about pagination in a connection.
| `readCommitStatus` | Boolean! | Indicates the user can perform `read_commit_status` on this resource |
| `readCycleAnalytics` | Boolean! | Indicates the user can perform `read_cycle_analytics` on this resource |
| `readDesign` | Boolean! | Indicates the user can perform `read_design` on this resource |
| `readMergeRequest` | Boolean! | Indicates the user can perform `read_merge_request` on this resource |
| `readPagesContent` | Boolean! | Indicates the user can perform `read_pages_content` on this resource |
| `readProject` | Boolean! | Indicates the user can perform `read_project` on this resource |
| `readProjectMember` | Boolean! | Indicates the user can perform `read_project_member` on this resource |
Loading
Loading
Loading
Loading
@@ -26,7 +26,7 @@ Note the following:
and are deleted every 24 hours by a specific worker.
- Group members are exported as project members, as long as the user has
maintainer or admin access to the group where the exported project lives. An admin
in the import side is required to map the users, based on email or username.
in the import side is required to map the users, based on email.
Otherwise, a supplementary comment is left to mention the original author and
the MRs, notes, or issues will be owned by the importer.
- Project members with owner access will be imported as maintainers.
Loading
Loading
Loading
Loading
@@ -636,10 +636,9 @@ module Gitlab
end
 
# Delete the specified branch from the repository
# Note: No Git hooks are executed for this action
def delete_branch(branch_name)
wrapped_gitaly_errors do
gitaly_ref_client.delete_branch(branch_name)
end
write_ref(branch_name, Gitlab::Git::BLANK_SHA)
rescue CommandError => e
raise DeleteBranchError, e
end
Loading
Loading
@@ -651,14 +650,13 @@ module Gitlab
end
 
# Create a new branch named **ref+ based on **stat_point+, HEAD by default
# Note: No Git hooks are executed for this action
#
# Examples:
# create_branch("feature")
# create_branch("other-feature", "master")
def create_branch(ref, start_point = "HEAD")
wrapped_gitaly_errors do
gitaly_ref_client.create_branch(ref, start_point)
end
write_ref(ref, start_point)
end
 
# If `mirror_refmap` is present the remote is set as mirror with that mapping
Loading
Loading
Loading
Loading
@@ -151,40 +151,6 @@ module Gitlab
Gitlab::Git::Branch.new(@repository, encode!(branch.name.dup), branch.target_commit.id, target_commit)
end
 
def create_branch(ref, start_point)
request = Gitaly::CreateBranchRequest.new(
repository: @gitaly_repo,
name: encode_binary(ref),
start_point: encode_binary(start_point)
)
response = GitalyClient.call(@repository.storage, :ref_service, :create_branch, request, timeout: GitalyClient.medium_timeout)
case response.status
when :OK
branch = response.branch
target_commit = Gitlab::Git::Commit.decorate(@repository, branch.target_commit)
Gitlab::Git::Branch.new(@repository, branch.name, branch.target_commit.id, target_commit)
when :ERR_INVALID
invalid_ref!("Invalid ref name")
when :ERR_EXISTS
invalid_ref!("Branch #{ref} already exists")
when :ERR_INVALID_START_POINT
invalid_ref!("Invalid reference #{start_point}")
else
raise "Unknown response status: #{response.status}"
end
end
def delete_branch(branch_name)
request = Gitaly::DeleteBranchRequest.new(
repository: @gitaly_repo,
name: encode_binary(branch_name)
)
GitalyClient.call(@repository.storage, :ref_service, :delete_branch, request, timeout: GitalyClient.medium_timeout)
end
def delete_refs(refs: [], except_with_prefixes: [])
request = Gitaly::DeleteRefsRequest.new(
repository: @gitaly_repo,
Loading
Loading
Loading
Loading
@@ -82,7 +82,7 @@ module Gitlab
end
 
def find_user_query(member)
user_arel[:email].eq(member['user']['email']).or(user_arel[:username].eq(member['user']['username']))
user_arel[:email].eq(member['user']['email'])
end
 
def user_arel
Loading
Loading
Loading
Loading
@@ -8,15 +8,19 @@ module Gitlab
AmbiguousProcessError = Class.new(IdentificationError)
UnknownProcessError = Class.new(IdentificationError)
 
AVAILABLE_RUNTIMES = [
:console,
:geo_log_cursor,
:puma,
:rake,
:sidekiq,
:test_suite,
:unicorn
].freeze
class << self
def identify
matches = []
matches << :puma if puma?
matches << :unicorn if unicorn?
matches << :console if console?
matches << :sidekiq if sidekiq?
matches << :rake if rake?
matches << :test_suite if test_suite?
matches = AVAILABLE_RUNTIMES.select { |runtime| public_send("#{runtime}?") } # rubocop:disable GitlabSecurity/PublicSend
 
if matches.one?
matches.first
Loading
Loading
@@ -56,6 +60,10 @@ module Gitlab
!!defined?(::Rails::Console)
end
 
def geo_log_cursor?
!!defined?(::GeoLogCursorOptionParser)
end
def web_server?
puma? || unicorn?
end
Loading
Loading
Loading
Loading
@@ -3974,6 +3974,9 @@ msgstr ""
msgid "ClusterIntegration|Cloud Run"
msgstr ""
 
msgid "ClusterIntegration|Cluster being created"
msgstr ""
msgid "ClusterIntegration|Cluster health"
msgstr ""
 
Loading
Loading
@@ -13858,6 +13861,9 @@ msgstr ""
msgid "Please enable and migrate to hashed storage to avoid security issues and ensure data integrity. %{migrate_link}"
msgstr ""
 
msgid "Please ensure your account's %{account_link_start}recovery settings%{account_link_end} are up to date."
msgstr ""
msgid "Please enter a non-negative number"
msgstr ""
 
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ describe Admin::ApplicationsController do
it 'renders the application form' do
get :index
 
expect(response).to have_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
Loading
Loading
@@ -36,7 +36,7 @@ describe Admin::Clusters::ApplicationsController do
expect(ClusterInstallAppWorker).to receive(:perform_async).with(application, anything).once
 
expect { subject }.to change { current_application.count }
expect(response).to have_http_status(:no_content)
expect(response).to have_gitlab_http_status(:no_content)
expect(cluster.application_helm).to be_scheduled
end
 
Loading
Loading
@@ -47,7 +47,7 @@ describe Admin::Clusters::ApplicationsController do
 
it 'return 404' do
expect { subject }.not_to change { current_application.count }
expect(response).to have_http_status(:not_found)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -55,7 +55,7 @@ describe Admin::Clusters::ApplicationsController do
let(:application) { 'unkwnown-app' }
 
it 'return 404' do
is_expected.to have_http_status(:not_found)
is_expected.to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -65,7 +65,7 @@ describe Admin::Clusters::ApplicationsController do
end
 
it 'returns 400' do
is_expected.to have_http_status(:bad_request)
is_expected.to have_gitlab_http_status(:bad_request)
end
end
end
Loading
Loading
@@ -99,7 +99,7 @@ describe Admin::Clusters::ApplicationsController do
it "schedules an application update" do
expect(ClusterPatchAppWorker).to receive(:perform_async).with(application.name, anything).once
 
is_expected.to have_http_status(:no_content)
is_expected.to have_gitlab_http_status(:no_content)
 
expect(cluster.application_cert_manager).to be_scheduled
end
Loading
Loading
@@ -110,13 +110,13 @@ describe Admin::Clusters::ApplicationsController do
cluster.destroy!
end
 
it { is_expected.to have_http_status(:not_found) }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
 
context 'when application is unknown' do
let(:application_name) { 'unkwnown-app' }
 
it { is_expected.to have_http_status(:not_found) }
it { is_expected.to have_gitlab_http_status(:not_found) }
end
 
context 'when application is already scheduled' do
Loading
Loading
@@ -124,7 +124,7 @@ describe Admin::Clusters::ApplicationsController do
application.make_scheduled!
end
 
it { is_expected.to have_http_status(:bad_request) }
it { is_expected.to have_gitlab_http_status(:bad_request) }
end
end
 
Loading
Loading
Loading
Loading
@@ -567,7 +567,7 @@ describe Admin::ClustersController do
put_update(format: :json)
 
cluster.reload
expect(response).to have_http_status(:no_content)
expect(response).to have_gitlab_http_status(:no_content)
expect(cluster.enabled).to be_falsey
expect(cluster.name).to eq('my-new-cluster-name')
expect(cluster).not_to be_managed
Loading
Loading
@@ -587,7 +587,7 @@ describe Admin::ClustersController do
it 'rejects changes' do
put_update(format: :json)
 
expect(response).to have_http_status(:bad_request)
expect(response).to have_gitlab_http_status(:bad_request)
end
end
end
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ describe Admin::GitalyServersController do
it 'shows the gitaly servers page' do
get :index
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
end
Loading
Loading
@@ -24,7 +24,7 @@ describe Admin::HooksController do
 
post :create, params: { hook: hook_params }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
expect(SystemHook.all.size).to eq(1)
expect(SystemHook.first).to have_attributes(hook_params)
end
Loading
Loading
Loading
Loading
@@ -24,7 +24,7 @@ describe Admin::ImpersonationsController do
it "responds with status 404" do
delete :destroy
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it "doesn't sign us in" do
Loading
Loading
@@ -48,7 +48,7 @@ describe Admin::ImpersonationsController do
it "responds with status 404" do
delete :destroy
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it "doesn't sign us in as the impersonator" do
Loading
Loading
@@ -67,7 +67,7 @@ describe Admin::ImpersonationsController do
it "responds with status 404" do
delete :destroy
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it "doesn't sign us in as the impersonator" do
Loading
Loading
Loading
Loading
@@ -29,7 +29,7 @@ describe Admin::ProjectsController do
 
get :index
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response.body).not_to match(pending_delete_project.name)
expect(response.body).to match(project.name)
end
Loading
Loading
@@ -61,7 +61,7 @@ describe Admin::ProjectsController do
it 'renders show page' do
get :show, params: { namespace_id: project.namespace.path, id: project.path }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to match(project.name)
end
end
Loading
Loading
Loading
Loading
@@ -36,7 +36,7 @@ describe Admin::RequestsProfilesController do
it 'renders the data' do
subject
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to eq(sample_data)
end
end
Loading
Loading
@@ -54,7 +54,7 @@ describe Admin::RequestsProfilesController do
it 'renders the data' do
subject
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to eq(sample_data)
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment