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

Add latest changes from gitlab-org/gitlab@master

parent 7530cf5a
No related branches found
No related tags found
No related merge requests found
Showing
with 145 additions and 66 deletions
# frozen_string_literal: true
class AddTrialStartsOnToGitlabSubscriptions < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :gitlab_subscriptions, :trial_starts_on, :date, null: true
add_column :gitlab_subscription_histories, :trial_starts_on, :date, null: true
end
end
Loading
Loading
@@ -1882,6 +1882,7 @@ ActiveRecord::Schema.define(version: 2019_12_08_071112) do
t.integer "change_type", limit: 2
t.bigint "gitlab_subscription_id", null: false
t.datetime_with_timezone "created_at"
t.date "trial_starts_on"
t.index ["gitlab_subscription_id"], name: "index_gitlab_subscription_histories_on_gitlab_subscription_id"
end
 
Loading
Loading
@@ -1896,6 +1897,7 @@ ActiveRecord::Schema.define(version: 2019_12_08_071112) do
t.integer "max_seats_used", default: 0
t.integer "seats", default: 0
t.boolean "trial", default: false
t.date "trial_starts_on"
t.index ["hosted_plan_id"], name: "index_gitlab_subscriptions_on_hosted_plan_id"
t.index ["namespace_id"], name: "index_gitlab_subscriptions_on_namespace_id", unique: true
end
Loading
Loading
Loading
Loading
@@ -393,6 +393,23 @@ It is stored at:
- `/var/log/gitlab/gitlab-rails/database_load_balancing.log` for Omnibus GitLab packages.
- `/home/git/gitlab/log/database_load_balancing.log` for installations from source.
 
## `elasticsearch.log`
Introduced in GitLab 12.6. This file lives in
`/var/log/gitlab/gitlab-rails/elasticsearch.log` for Omnibus GitLab
packages or in `/home/git/gitlab/log/elasticsearch.log` for installations
from source.
It logs information related to the Elasticsearch Integration including
errors during indexing or searching Elasticsearch.
Each line contains a JSON line that can be ingested by Elasticsearch, Splunk,
etc. For example:
```json
{"severity":"DEBUG","time":"2019-10-17T06:23:13.227Z","correlation_id":null,"message":"redacted_search_result","class_name":"Milestone","id":2,"ability":"read_milestone","current_user_id":2,"query":"project"}
```
[repocheck]: repository_checks.md
[Rack Attack]: ../security/rack_attack.md
[Rate Limit]: ../user/admin_area/settings/rate_limits_on_raw_endpoints.md
Loading
Loading
Loading
Loading
@@ -42,9 +42,9 @@ The current stages are:
## Default image
 
The default image is currently
`registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.3-golang-1.12-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.33`.
`registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.3-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.33`.
 
It includes Ruby 2.6.3, Go 1.12, Git 2.22, Chrome 73, Node 12, Yarn 1.16,
It includes Ruby 2.6.3, Go 1.12, Git 2.24, Git LFS 2.9, Chrome 73, Node 12, Yarn 1.16,
PostgreSQL 9.6, and Graphics Magick 1.3.33.
 
The images used in our pipelines are configured in the
Loading
Loading
Loading
Loading
@@ -134,7 +134,7 @@ Make sure you have the right version of Git installed:
# Install Git
sudo apt-get install -y git-core
 
# Make sure Git is version 2.22.0 or higher
# Make sure Git is version 2.24.1 or higher (minimal supported version is 2.22.0)
git --version
```
 
Loading
Loading
@@ -171,9 +171,9 @@ sudo make install
 
# Download and compile from source
cd /tmp
curl --remote-name --location --progress https://www.kernel.org/pub/software/scm/git/git-2.22.0.tar.gz
echo 'a4b7e4365bee43caa12a38d646d2c93743d755d1cea5eab448ffb40906c9da0b git-2.22.0.tar.gz' | shasum -a256 -c - && tar -xzf git-2.22.0.tar.gz
cd git-2.22.0/
curl --remote-name --location --progress https://www.kernel.org/pub/software/scm/git/git-2.24.1.tar.gz
echo 'ad5334956301c86841eb1e5b1bb20884a6bad89a10a6762c958220c7cf64da02 git-2.24.1.tar.gz' | shasum -a256 -c - && tar -xzf git-2.24.1.tar.gz
cd git-2.24.1/
./configure --with-libpcre
make prefix=/usr/local all
 
Loading
Loading
# frozen_string_literal: true
module Gitlab
module Elasticsearch
class Logger < ::Gitlab::JsonLogger
def self.file_name_noext
'elasticsearch'
end
end
end
end
# frozen_string_literal: true
require 'json'
module Gitlab
module PumaLogging
class JSONFormatter
def call(str)
{ timestamp: Time.now.utc.iso8601(3), pid: $$, message: str }.to_json
end
end
end
end
Loading
Loading
@@ -183,6 +183,7 @@ module Gitlab
command :zoom do |link|
result = @zoom_service.add_link(link)
@execution_message[:zoom] = result.message
@updates.merge!(result.payload) if result.payload
end
 
desc _('Remove Zoom meeting')
Loading
Loading
Loading
Loading
@@ -26,11 +26,6 @@ module QA
element :avatar_image
end
 
view 'app/assets/javascripts/sidebar/components/assignees/assignee_title.vue' do
element :assignee_edit_link
element :assignee_title
end
view 'app/assets/javascripts/sidebar/components/assignees/uncollapsed_assignee_list.vue' do
element :more_assignees_link
end
Loading
Loading
@@ -61,16 +56,6 @@ module QA
element :new_note_form, 'attr: :note' # rubocop:disable QA/ElementWithPattern
end
 
def assign(user)
click_element(:assignee_edit_link)
select_user(user.username)
click_body
end
def assignee_title
find_element(:assignee_title)
end
def avatar_image_count
wait_assignees_block_finish_loading do
all_elements(:avatar_image).count
Loading
Loading
@@ -168,19 +153,6 @@ module QA
end
end
 
def select_user(username)
find("#{element_selector_css(:assignee_block)} input").set(username)
dropdown_menu_user_link_selector = '.dropdown-menu-user-link'
at_username = "@#{username}"
ten_seconds = 10
wait(reload: false, max: ten_seconds, interval: 1) do
has_css?(dropdown_menu_user_link_selector, wait: ten_seconds, text: at_username)
end
find(dropdown_menu_user_link_selector, text: at_username).click
end
def wait_assignees_block_finish_loading
within_element(:assignee_block) do
wait(reload: false, max: 10, interval: 1) do
Loading
Loading
Loading
Loading
@@ -34,7 +34,7 @@ export const utilsMockData = [
content: [
{
text:
'Using Docker executor with image dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-golang-1.11-git-2.22-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.33',
'Using Docker executor with image dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.6.3-golang-1.12-git-2.24-lfs-2.9-chrome-73.0-node-12.x-yarn-1.16-postgresql-9.6-graphicsmagick-1.3.33',
},
],
section: 'prepare-executor',
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::PumaLogging::JSONFormatter do
it "generate json format with timestamp and pid" do
Timecop.freeze( Time.utc(2019, 12, 04, 9, 10, 11, 123456)) do
expect(subject.call('log message')).to eq "{\"timestamp\":\"2019-12-04T09:10:11.123Z\",\"pid\":#{Process.pid},\"message\":\"log message\"}"
end
end
end
Loading
Loading
@@ -21,6 +21,7 @@ describe AsanaService do
describe 'Execute' do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:gid) { "123456789ABCD" }
 
def create_data_for_commits(*messages)
{
Loading
Loading
@@ -48,32 +49,32 @@ describe AsanaService do
end
 
it 'calls Asana service to create a story' do
data = create_data_for_commits('Message from commit. related to #123456')
data = create_data_for_commits("Message from commit. related to ##{gid}")
expected_message = "#{data[:user_name]} pushed to branch #{data[:ref]} of #{project.full_name} ( #{data[:commits][0][:url]} ): #{data[:commits][0][:message]}"
 
d1 = double('Asana::Task')
d1 = double('Asana::Resources::Task')
expect(d1).to receive(:add_comment).with(text: expected_message)
expect(Asana::Task).to receive(:find_by_id).with(anything, '123456').once.and_return(d1)
expect(Asana::Resources::Task).to receive(:find_by_id).with(anything, gid).once.and_return(d1)
 
@asana.execute(data)
end
 
it 'calls Asana service to create a story and close a task' do
data = create_data_for_commits('fix #456789')
d1 = double('Asana::Task')
d1 = double('Asana::Resources::Task')
expect(d1).to receive(:add_comment)
expect(d1).to receive(:update).with(completed: true)
expect(Asana::Task).to receive(:find_by_id).with(anything, '456789').once.and_return(d1)
expect(Asana::Resources::Task).to receive(:find_by_id).with(anything, '456789').once.and_return(d1)
 
@asana.execute(data)
end
 
it 'is able to close via url' do
data = create_data_for_commits('closes https://app.asana.com/19292/956299/42')
d1 = double('Asana::Task')
d1 = double('Asana::Resources::Task')
expect(d1).to receive(:add_comment)
expect(d1).to receive(:update).with(completed: true)
expect(Asana::Task).to receive(:find_by_id).with(anything, '42').once.and_return(d1)
expect(Asana::Resources::Task).to receive(:find_by_id).with(anything, '42').once.and_return(d1)
 
@asana.execute(data)
end
Loading
Loading
@@ -84,28 +85,28 @@ describe AsanaService do
ref https://app.asana.com/19292/956299/42 and closing https://app.asana.com/19292/956299/12
EOF
data = create_data_for_commits(message)
d1 = double('Asana::Task')
d1 = double('Asana::Resources::Task')
expect(d1).to receive(:add_comment)
expect(d1).to receive(:update).with(completed: true)
expect(Asana::Task).to receive(:find_by_id).with(anything, '123').once.and_return(d1)
expect(Asana::Resources::Task).to receive(:find_by_id).with(anything, '123').once.and_return(d1)
 
d2 = double('Asana::Task')
d2 = double('Asana::Resources::Task')
expect(d2).to receive(:add_comment)
expect(d2).to receive(:update).with(completed: true)
expect(Asana::Task).to receive(:find_by_id).with(anything, '456').once.and_return(d2)
expect(Asana::Resources::Task).to receive(:find_by_id).with(anything, '456').once.and_return(d2)
 
d3 = double('Asana::Task')
d3 = double('Asana::Resources::Task')
expect(d3).to receive(:add_comment)
expect(Asana::Task).to receive(:find_by_id).with(anything, '789').once.and_return(d3)
expect(Asana::Resources::Task).to receive(:find_by_id).with(anything, '789').once.and_return(d3)
 
d4 = double('Asana::Task')
d4 = double('Asana::Resources::Task')
expect(d4).to receive(:add_comment)
expect(Asana::Task).to receive(:find_by_id).with(anything, '42').once.and_return(d4)
expect(Asana::Resources::Task).to receive(:find_by_id).with(anything, '42').once.and_return(d4)
 
d5 = double('Asana::Task')
d5 = double('Asana::Resources::Task')
expect(d5).to receive(:add_comment)
expect(d5).to receive(:update).with(completed: true)
expect(Asana::Task).to receive(:find_by_id).with(anything, '12').once.and_return(d5)
expect(Asana::Resources::Task).to receive(:find_by_id).with(anything, '12').once.and_return(d5)
 
@asana.execute(data)
end
Loading
Loading
Loading
Loading
@@ -27,12 +27,18 @@ describe Issues::ZoomLinkService do
end
end
 
shared_context 'insufficient permissions' do
shared_context 'insufficient issue update permissions' do
before do
project.add_guest(user)
end
end
 
shared_context 'insufficient issue create permissions' do
before do
expect(service).to receive(:can?).with(user, :create_issue, project).and_return(false)
end
end
describe '#add_link' do
shared_examples 'can add meeting' do
it 'appends the new meeting to zoom_meetings' do
Loading
Loading
@@ -69,16 +75,38 @@ describe Issues::ZoomLinkService do
subject(:result) { service.add_link(zoom_link) }
 
context 'without existing Zoom meeting' do
include_examples 'can add meeting'
context 'when updating an issue' do
before do
allow(issue).to receive(:persisted?).and_return(true)
end
 
context 'with invalid Zoom url' do
let(:zoom_link) { 'https://not-zoom.link' }
include_examples 'can add meeting'
 
include_examples 'cannot add meeting'
context 'with insufficient issue update permissions' do
include_context 'insufficient issue update permissions'
include_examples 'cannot add meeting'
end
end
 
context 'with insufficient permissions' do
include_context 'insufficient permissions'
context 'when creating an issue' do
before do
allow(issue).to receive(:persisted?).and_return(false)
end
it 'creates a new zoom meeting' do
expect(result).to be_success
expect(result.payload[:zoom_meetings][0].url).to eq(zoom_link)
end
context 'with insufficient issue create permissions' do
include_context 'insufficient issue create permissions'
include_examples 'cannot add meeting'
end
end
context 'with invalid Zoom url' do
let(:zoom_link) { 'https://not-zoom.link' }
include_examples 'cannot add meeting'
end
end
Loading
Loading
@@ -92,6 +120,7 @@ describe Issues::ZoomLinkService do
include_context '"added" Zoom meeting'
before do
allow(service).to receive(:can_add_link?).and_return(true)
allow(issue).to receive(:persisted?).and_return(true)
end
 
include_examples 'cannot add meeting'
Loading
Loading
@@ -104,8 +133,8 @@ describe Issues::ZoomLinkService do
context 'without "added" zoom meeting' do
it { is_expected.to eq(true) }
 
context 'with insufficient permissions' do
include_context 'insufficient permissions'
context 'with insufficient issue update permissions' do
include_context 'insufficient issue update permissions'
 
it { is_expected.to eq(false) }
end
Loading
Loading
@@ -156,12 +185,24 @@ describe Issues::ZoomLinkService do
context 'with Zoom meeting' do
include_context '"added" Zoom meeting'
 
context 'removes the link' do
context 'with existing issue' do
before do
allow(issue).to receive(:persisted?).and_return(true)
end
include_examples 'can remove meeting'
end
 
context 'with insufficient permissions' do
include_context 'insufficient permissions'
context 'without existing issue' do
before do
allow(issue).to receive(:persisted?).and_return(false)
end
include_examples 'cannot remove meeting'
end
context 'with insufficient issue update permissions' do
include_context 'insufficient issue update permissions'
include_examples 'cannot remove meeting'
end
end
Loading
Loading
@@ -193,8 +234,8 @@ describe Issues::ZoomLinkService do
it { is_expected.to eq(true) }
end
 
context 'with insufficient permissions' do
include_context 'insufficient permissions'
context 'with insufficient issue update permissions' do
include_context 'insufficient issue update permissions'
it { is_expected.to eq(false) }
end
end
Loading
Loading
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
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