From ee832780876add739e16fe173d8157e48501cb49 Mon Sep 17 00:00:00 2001 From: Katrin Leinweber Date: Fri, 11 Jan 2019 20:04:07 +0000 Subject: Add @katrinleinweber as German proofreader --- doc/development/i18n/proofreader.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/development/i18n/proofreader.md b/doc/development/i18n/proofreader.md index ac910e80a89..4ef8bdf7466 100644 --- a/doc/development/i18n/proofreader.md +++ b/doc/development/i18n/proofreader.md @@ -40,6 +40,7 @@ are very appreciative of the work done by translators and proofreaders! - Pedro Garcia - [GitLab](https://gitlab.com/pedgarrod), [Crowdin](https://crowdin.com/profile/breaking_pitt) - German - Michael Hahnle - [GitLab](https://gitlab.com/mhah), [Crowdin](https://crowdin.com/profile/mhah) + - Katrin Leinweber - [GitLab](https://gitlab.com/katrinleinweber/), [Crowdin](https://crowdin.com/profile/katrinleinweber) - Greek - Proofreaders needed. - Hebrew -- cgit v1.2.1 From 75851599d1b7e8f0df7339ab3fcf5cd414deee97 Mon Sep 17 00:00:00 2001 From: Bertrand Jamin Date: Sun, 17 Feb 2019 10:14:25 +0000 Subject: Replace misinterpreted `|` caracter in a table --- doc/api/milestones.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/milestones.md b/doc/api/milestones.md index 07e66f89443..fef27c146cc 100644 --- a/doc/api/milestones.md +++ b/doc/api/milestones.md @@ -91,7 +91,7 @@ Parameters: - `description` (optional) - The description of a milestone - `due_date` (optional) - The due date of the milestone - `start_date` (optional) - The start date of the milestone -- `state_event` (optional) - The state event of the milestone (close|activate) +- `state_event` (optional) - The state event of the milestone (close or activate) ## Delete project milestone -- cgit v1.2.1 From b6ca523cf7b8f7339d13d730c9fa24e7cac3263b Mon Sep 17 00:00:00 2001 From: Willian Balmant Date: Thu, 4 Apr 2019 23:03:51 +0000 Subject: No leading/trailing spaces when generating heading ids (Fixes #57528) --- lib/banzai/filter/table_of_contents_filter.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/banzai/filter/table_of_contents_filter.rb b/lib/banzai/filter/table_of_contents_filter.rb index f2ae17b44fa..d4cf08be0ae 100644 --- a/lib/banzai/filter/table_of_contents_filter.rb +++ b/lib/banzai/filter/table_of_contents_filter.rb @@ -18,6 +18,7 @@ module Banzai # `li` child elements. class TableOfContentsFilter < HTML::Pipeline::Filter PUNCTUATION_REGEXP = /[^\p{Word}\- ]/u + LEADING_OR_TRAILING_SPACE_REGEXP = /^\p{Space}|\p{Space}$/ def call return doc if context[:no_header_anchors] @@ -31,6 +32,7 @@ module Banzai if header_content = node.children.first id = node .text + .gsub(LEADING_OR_TRAILING_SPACE_REGEXP, '') # remove leading and trailing spaces .downcase .gsub(PUNCTUATION_REGEXP, '') # remove punctuation .tr(' ', '-') # replace spaces with dash -- cgit v1.2.1 From 2075ef7d071286ad156ca13640336572bb20bceb Mon Sep 17 00:00:00 2001 From: Willian Balmant Date: Wed, 10 Apr 2019 20:50:26 +0000 Subject: No leading/trailing spaces when generating heading ids (Fixes #57528) Update based on comments in MR #27025 --- lib/banzai/filter/table_of_contents_filter.rb | 4 ++-- spec/lib/banzai/filter/table_of_contents_filter_spec.rb | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/banzai/filter/table_of_contents_filter.rb b/lib/banzai/filter/table_of_contents_filter.rb index d4cf08be0ae..8d79f5bd58b 100644 --- a/lib/banzai/filter/table_of_contents_filter.rb +++ b/lib/banzai/filter/table_of_contents_filter.rb @@ -17,8 +17,8 @@ module Banzai # :toc - String containing Table of Contents data as a `ul` element with # `li` child elements. class TableOfContentsFilter < HTML::Pipeline::Filter - PUNCTUATION_REGEXP = /[^\p{Word}\- ]/u - LEADING_OR_TRAILING_SPACE_REGEXP = /^\p{Space}|\p{Space}$/ + PUNCTUATION_REGEXP = /[^\p{Word}\- ]/u.freeze + LEADING_OR_TRAILING_SPACE_REGEXP = /^\p{Space}+|\p{Space}+$/.freeze def call return doc if context[:no_header_anchors] diff --git a/spec/lib/banzai/filter/table_of_contents_filter_spec.rb b/spec/lib/banzai/filter/table_of_contents_filter_spec.rb index 7213cd58ea7..f776e21a89e 100644 --- a/spec/lib/banzai/filter/table_of_contents_filter_spec.rb +++ b/spec/lib/banzai/filter/table_of_contents_filter_spec.rb @@ -58,6 +58,11 @@ describe Banzai::Filter::TableOfContentsFilter do expect(doc.css('h1 a').first.attr('href')).to eq '#this-header-is-filled-with-punctuation' end + it 'removes any leading or trailing spaces' do + doc = filter(header(1, " \r\n \t Title with spaces \r\n\t ")) + expect(doc.css('h1 a').first.attr('href')).to eq '#title-with-spaces' + end + it 'appends a unique number to duplicates' do doc = filter(header(1, 'One') + header(2, 'One')) -- cgit v1.2.1 From b27b8dc0c2e38689f519198ea127b60437e13983 Mon Sep 17 00:00:00 2001 From: Willian Balmant Date: Thu, 11 Apr 2019 16:09:03 +0000 Subject: Use strip to remove leading/trailing spaces Change based on comments in MR #27025 --- lib/banzai/filter/table_of_contents_filter.rb | 3 +-- spec/lib/banzai/filter/table_of_contents_filter_spec.rb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/banzai/filter/table_of_contents_filter.rb b/lib/banzai/filter/table_of_contents_filter.rb index 8d79f5bd58b..ade4d260be1 100644 --- a/lib/banzai/filter/table_of_contents_filter.rb +++ b/lib/banzai/filter/table_of_contents_filter.rb @@ -18,7 +18,6 @@ module Banzai # `li` child elements. class TableOfContentsFilter < HTML::Pipeline::Filter PUNCTUATION_REGEXP = /[^\p{Word}\- ]/u.freeze - LEADING_OR_TRAILING_SPACE_REGEXP = /^\p{Space}+|\p{Space}+$/.freeze def call return doc if context[:no_header_anchors] @@ -32,7 +31,7 @@ module Banzai if header_content = node.children.first id = node .text - .gsub(LEADING_OR_TRAILING_SPACE_REGEXP, '') # remove leading and trailing spaces + .strip .downcase .gsub(PUNCTUATION_REGEXP, '') # remove punctuation .tr(' ', '-') # replace spaces with dash diff --git a/spec/lib/banzai/filter/table_of_contents_filter_spec.rb b/spec/lib/banzai/filter/table_of_contents_filter_spec.rb index f776e21a89e..4a9880ac85a 100644 --- a/spec/lib/banzai/filter/table_of_contents_filter_spec.rb +++ b/spec/lib/banzai/filter/table_of_contents_filter_spec.rb @@ -59,7 +59,7 @@ describe Banzai::Filter::TableOfContentsFilter do end it 'removes any leading or trailing spaces' do - doc = filter(header(1, " \r\n \t Title with spaces \r\n\t ")) + doc = filter(header(1, " \r\n\tTitle with spaces\r\n\t ")) expect(doc.css('h1 a').first.attr('href')).to eq '#title-with-spaces' end -- cgit v1.2.1 From 4cb3ab8372694036a25e0b4943fc9dde0265d015 Mon Sep 17 00:00:00 2001 From: Brandon Houghton <3753196-bhoughton@users.noreply.gitlab.com> Date: Wed, 17 Apr 2019 16:39:30 +0000 Subject: Clarify instructions for making user/group site --- doc/user/project/pages/getting_started_part_two.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/user/project/pages/getting_started_part_two.md b/doc/user/project/pages/getting_started_part_two.md index 1034ba1733d..bb3be9a5ba8 100644 --- a/doc/user/project/pages/getting_started_part_two.md +++ b/doc/user/project/pages/getting_started_part_two.md @@ -94,8 +94,9 @@ You can also take some **optional** further steps: - _Make it a user or group website._ To turn a **project website** forked from the Pages group into a **user/group** website, you'll need to: - - Rename it to `namespace.gitlab.io`: navigate to project's **Settings** > - expand **Advanced settings** > and scroll down to **Rename repository**. + - Rename it to `namespace.gitlab.io`: go to your project's **Settings** + and expand **Advanced**. Scroll down to **Rename repository** and change +both the project name and the path to `namespace.gitlab.io`. - Adjust your SSG's [base URL](#urls-and-baseurls) from `"project-name"` to `""`. This setting will be at a different place for each SSG, as each of them have their own structure and file tree. Most likely, it will be in the SSG's -- cgit v1.2.1 From 4c248c05cbd1356199cc96775b68fbbde64d4d5d Mon Sep 17 00:00:00 2001 From: Ryan Cobb Date: Thu, 18 Apr 2019 12:40:00 -0600 Subject: Adds new metrics for unicorn monitoring This adds new metrics for monitoring unicorn. These metrics include process_cpu_seconds_total, process_start_time_seconds, process_max_fds, and unicorn_workers. --- Gemfile | 1 + Gemfile.lock | 3 ++ lib/gitlab/metrics/samplers/unicorn_sampler.rb | 36 +++++++++++++++++----- lib/gitlab/metrics/system.rb | 25 +++++++++++++++ .../metrics/samplers/unicorn_sampler_spec.rb | 33 +++++++++++++++++--- spec/lib/gitlab/metrics/system_spec.rb | 18 +++++++++++ 6 files changed, 103 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index c55e6478cb0..e38c1f03ca0 100644 --- a/Gemfile +++ b/Gemfile @@ -406,6 +406,7 @@ gem 'health_check', '~> 2.6.0' # System information gem 'vmstat', '~> 2.3.0' gem 'sys-filesystem', '~> 1.1.6' +gem 'sys-proctable', '~> 1.2' # SSH host key support gem 'net-ssh', '~> 5.0' diff --git a/Gemfile.lock b/Gemfile.lock index 109958e2591..36c24265e48 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -867,6 +867,8 @@ GEM state_machines-activemodel (>= 0.5.0) sys-filesystem (1.1.6) ffi + sys-proctable (1.2.1) + ffi sysexits (1.2.0) temple (0.8.0) test-prof (0.2.5) @@ -1160,6 +1162,7 @@ DEPENDENCIES stackprof (~> 0.2.10) state_machines-activerecord (~> 0.5.1) sys-filesystem (~> 1.1.6) + sys-proctable (~> 1.2) test-prof (~> 0.2.5) thin (~> 1.7.0) timecop (~> 0.8.0) diff --git a/lib/gitlab/metrics/samplers/unicorn_sampler.rb b/lib/gitlab/metrics/samplers/unicorn_sampler.rb index bec64e864b3..16a2ee9b9be 100644 --- a/lib/gitlab/metrics/samplers/unicorn_sampler.rb +++ b/lib/gitlab/metrics/samplers/unicorn_sampler.rb @@ -8,12 +8,19 @@ module Gitlab super(interval) end - def unicorn_active_connections - @unicorn_active_connections ||= ::Gitlab::Metrics.gauge(:unicorn_active_connections, 'Unicorn active connections', {}, :max) + def metrics + @metrics ||= init_metrics end - def unicorn_queued_connections - @unicorn_queued_connections ||= ::Gitlab::Metrics.gauge(:unicorn_queued_connections, 'Unicorn queued connections', {}, :max) + def init_metrics + { + unicorn_active_connections: ::Gitlab::Metrics.gauge(:unicorn_active_connections, 'Unicorn active connections', {}, :max), + unicorn_queued_connections: ::Gitlab::Metrics.gauge(:unicorn_queued_connections, 'Unicorn queued connections', {}, :max), + unicorn_workers: ::Gitlab::Metrics.gauge(:unicorn_workers, 'Unicorn workers'), + process_cpu_seconds_total: ::Gitlab::Metrics.gauge(:process_cpu_seconds_total, 'Process CPU seconds total'), + process_max_fds: ::Gitlab::Metrics.gauge(:process_max_fds, 'Process max fds'), + process_start_time_seconds: ::Gitlab::Metrics.gauge(:process_start_time_seconds, 'Process start time seconds') + } end def enabled? @@ -23,14 +30,19 @@ module Gitlab def sample Raindrops::Linux.tcp_listener_stats(tcp_listeners).each do |addr, stats| - unicorn_active_connections.set({ socket_type: 'tcp', socket_address: addr }, stats.active) - unicorn_queued_connections.set({ socket_type: 'tcp', socket_address: addr }, stats.queued) + metrics[:unicorn_active_connections].set({ socket_type: 'tcp', socket_address: addr }, stats.active) + metrics[:unicorn_queued_connections].set({ socket_type: 'tcp', socket_address: addr }, stats.queued) end Raindrops::Linux.unix_listener_stats(unix_listeners).each do |addr, stats| - unicorn_active_connections.set({ socket_type: 'unix', socket_address: addr }, stats.active) - unicorn_queued_connections.set({ socket_type: 'unix', socket_address: addr }, stats.queued) + metrics[:unicorn_active_connections].set({ socket_type: 'unix', socket_address: addr }, stats.active) + metrics[:unicorn_queued_connections].set({ socket_type: 'unix', socket_address: addr }, stats.queued) end + + metrics[:process_cpu_seconds_total].set({ pid: nil }, ::Gitlab::Metrics::System.cpu_time) + metrics[:process_start_time_seconds].set({ pid: nil }, ::Gitlab::Metrics::System.process_start_time) + metrics[:process_max_fds].set({ pid: nil }, ::Gitlab::Metrics::System.max_open_file_descriptors) + metrics[:unicorn_workers].set({}, unicorn_workers_count) end private @@ -39,6 +51,10 @@ module Gitlab @tcp_listeners ||= Unicorn.listener_names.grep(%r{\A[^/]+:\d+\z}) end + def pid + @pid ||= Process.pid + end + def unix_listeners @unix_listeners ||= Unicorn.listener_names - tcp_listeners end @@ -46,6 +62,10 @@ module Gitlab def unicorn_with_listeners? defined?(Unicorn) && Unicorn.listener_names.any? end + + def unicorn_workers_count + Sys::ProcTable.ps.select {|p| p.cmdline.match(/unicorn_rails worker/)}.count + end end end end diff --git a/lib/gitlab/metrics/system.rb b/lib/gitlab/metrics/system.rb index 426496855e3..a269a8688e9 100644 --- a/lib/gitlab/metrics/system.rb +++ b/lib/gitlab/metrics/system.rb @@ -23,6 +23,16 @@ module Gitlab def self.file_descriptor_count Dir.glob('/proc/self/fd/*').length end + + def self.max_open_file_descriptors + match = File.read('/proc/self/limits').match(/Max open files\s*(\d+)/) + + if match && match[1] + max_fds = match[1].to_i + end + + max_fds + end else def self.memory_usage 0.0 @@ -31,6 +41,10 @@ module Gitlab def self.file_descriptor_count 0 end + + def self.max_open_file_descriptors + 0 + end end # THREAD_CPUTIME is not supported on OS X @@ -46,6 +60,17 @@ module Gitlab end end + # CLOCK_BOOTTIME is not supported on OS X + if Process.const_defined?(:CLOCK_BOOTTIME) + def self.process_start_time + Process + .clock_gettime(Process::CLOCK_BOOTTIME, :float_second) + end + else + def self.process_start_time + 0.0 + end + end # Returns the current real time in a given precision. # # Returns the time as a Float for precision = :float_second. diff --git a/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb index 4b03f3c2532..4470dc3ee93 100644 --- a/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb +++ b/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb @@ -39,8 +39,8 @@ describe Gitlab::Metrics::Samplers::UnicornSampler do it 'updates metrics type unix and with addr' do labels = { socket_type: 'unix', socket_address: socket_address } - expect(subject).to receive_message_chain(:unicorn_active_connections, :set).with(labels, 'active') - expect(subject).to receive_message_chain(:unicorn_queued_connections, :set).with(labels, 'queued') + expect(subject.metrics[:unicorn_active_connections]).to receive(:set).with(labels, 'active') + expect(subject.metrics[:unicorn_queued_connections]).to receive(:set).with(labels, 'queued') subject.sample end @@ -50,7 +50,6 @@ describe Gitlab::Metrics::Samplers::UnicornSampler do context 'unicorn listens on tcp sockets' do let(:tcp_socket_address) { '0.0.0.0:8080' } let(:tcp_sockets) { [tcp_socket_address] } - before do allow(unicorn).to receive(:listener_names).and_return(tcp_sockets) end @@ -71,13 +70,37 @@ describe Gitlab::Metrics::Samplers::UnicornSampler do it 'updates metrics type unix and with addr' do labels = { socket_type: 'tcp', socket_address: tcp_socket_address } - expect(subject).to receive_message_chain(:unicorn_active_connections, :set).with(labels, 'active') - expect(subject).to receive_message_chain(:unicorn_queued_connections, :set).with(labels, 'queued') + expect(subject.metrics[:unicorn_active_connections]).to receive(:set).with(labels, 'active') + expect(subject.metrics[:unicorn_queued_connections]).to receive(:set).with(labels, 'queued') subject.sample end end end + + context 'additional metrics' do + let(:cpu_time) { 3.14 } + let(:process_start_time) { 19100.24 } + let(:process_max_fds) { 1024 } + let(:unicorn_workers) { 2 } + + before do + allow(unicorn).to receive(:listener_names).and_return([""]) + allow(::Gitlab::Metrics::System).to receive(:cpu_time).and_return(cpu_time) + allow(::Gitlab::Metrics::System).to receive(:process_start_time).and_return(process_start_time) + allow(::Gitlab::Metrics::System).to receive(:max_open_file_descriptors).and_return(process_max_fds) + allow(subject).to receive(:unicorn_workers_count).and_return(unicorn_workers) + end + + it "sets additional metrics" do + expect(subject.metrics[:process_cpu_seconds_total]).to receive(:set).with({ pid: nil }, cpu_time) + expect(subject.metrics[:process_start_time_seconds]).to receive(:set).with({ pid: nil }, process_start_time) + expect(subject.metrics[:process_max_fds]).to receive(:set).with({ pid: nil }, process_max_fds) + expect(subject.metrics[:unicorn_workers]).to receive(:set).with({}, unicorn_workers) + + subject.sample + end + end end describe '#start' do diff --git a/spec/lib/gitlab/metrics/system_spec.rb b/spec/lib/gitlab/metrics/system_spec.rb index 14afcdf5daa..2de6821bb79 100644 --- a/spec/lib/gitlab/metrics/system_spec.rb +++ b/spec/lib/gitlab/metrics/system_spec.rb @@ -13,6 +13,12 @@ describe Gitlab::Metrics::System do expect(described_class.file_descriptor_count).to be > 0 end end + + describe '.max_open_file_descriptors' do + it 'returns the max allowed open file descriptors' do + expect(described_class.max_open_file_descriptors).to be > 0 + end + end else describe '.memory_usage' do it 'returns 0.0' do @@ -25,6 +31,12 @@ describe Gitlab::Metrics::System do expect(described_class.file_descriptor_count).to eq(0) end end + + describe '.max_open_file_descriptors' do + it 'returns 0' do + expect(described_class.max_open_file_descriptors).to eq(0) + end + end end describe '.cpu_time' do @@ -44,4 +56,10 @@ describe Gitlab::Metrics::System do expect(described_class.monotonic_time).to be_an(Float) end end + + describe '.process_start_time' do + it 'returns a Float' do + expect(described_class.process_start_time).to be_an(Float) + end + end end -- cgit v1.2.1 From 2c2bd00a6c2f4484ac7ba522b8d6b5fb64304a42 Mon Sep 17 00:00:00 2001 From: mfluharty Date: Thu, 18 Apr 2019 17:47:03 -0600 Subject: Make canceled jobs not retryable See which tests break --- app/models/ci/build.rb | 2 +- ...obs-by-canceling-the-pipeline-and-manually-running-later-jobs.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/53064-bypassing-pipeline-jobs-by-canceling-the-pipeline-and-manually-running-later-jobs.yml diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 5cf9bb4979a..8db2b05de9a 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -353,7 +353,7 @@ module Ci end def retryable? - !archived? && (success? || failed? || canceled?) + !archived? && (success? || failed?) end def retries_count diff --git a/changelogs/unreleased/53064-bypassing-pipeline-jobs-by-canceling-the-pipeline-and-manually-running-later-jobs.yml b/changelogs/unreleased/53064-bypassing-pipeline-jobs-by-canceling-the-pipeline-and-manually-running-later-jobs.yml new file mode 100644 index 00000000000..48f0a668982 --- /dev/null +++ b/changelogs/unreleased/53064-bypassing-pipeline-jobs-by-canceling-the-pipeline-and-manually-running-later-jobs.yml @@ -0,0 +1,5 @@ +--- +title: Make canceled jobs not retryable +merge_request: 27503 +author: +type: changed -- cgit v1.2.1 From 1798dcc1a6fc24e4fba8ed53d89cd86039a670f9 Mon Sep 17 00:00:00 2001 From: mfluharty Date: Mon, 8 Apr 2019 21:16:52 -0600 Subject: Clarify masked variable message, add link to docs Update error message "This variable will not be masked" to "Cannot use Masked Variable with current value" Add link to masked variables section to error message --- app/views/ci/variables/_variable_row.html.haml | 4 +++- locale/gitlab.pot | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/ci/variables/_variable_row.html.haml b/app/views/ci/variables/_variable_row.html.haml index aecfdea10d9..12a8d9930b7 100644 --- a/app/views/ci/variables/_variable_row.html.haml +++ b/app/views/ci/variables/_variable_row.html.haml @@ -33,7 +33,9 @@ name: value_input_name, placeholder: s_('CiVariables|Input variable value') } = value - %p.masking-validation-error.gl-field-error.hide= s_("CiVariables|This variable will not be masked") + %p.masking-validation-error.gl-field-error.hide + = s_("CiVariables|Cannot use Masked Variable with current value") + = link_to icon('question-circle'), help_page_path('ci/variables/README', anchor: 'masked-variables'), target: '_blank', rel: 'noopener noreferrer' - unless only_key_value .ci-variable-body-item.ci-variable-protected-item .append-right-default diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 54c40e48084..e25aff920e9 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -1785,6 +1785,9 @@ msgstr "" msgid "CiStatus|running" msgstr "" +msgid "CiVariables|Cannot use Masked Variable with current value" +msgstr "" + msgid "CiVariables|Input variable key" msgstr "" @@ -1794,9 +1797,6 @@ msgstr "" msgid "CiVariables|Remove variable row" msgstr "" -msgid "CiVariables|This variable will not be masked" -msgstr "" - msgid "CiVariable|* (All environments)" msgstr "" -- cgit v1.2.1 From 6b7b07b7ec0bc434716236d18d34c9a4a4d2f2f4 Mon Sep 17 00:00:00 2001 From: mfluharty Date: Fri, 19 Apr 2019 13:19:59 -0600 Subject: Update specs that use retryable canceled jobs Specs that test canceled jobs now - expect them not to be retryable or playable - expect them not to show retry buttons Specs that test retryability now - use failed status instead of canceled status --- spec/features/projects/jobs_spec.rb | 6 +++--- spec/features/projects/pipelines/pipeline_spec.rb | 8 ++++---- spec/lib/gitlab/ci/status/build/factory_spec.rb | 8 ++++---- spec/models/ci/build_spec.rb | 4 ++-- spec/requests/api/jobs_spec.rb | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index 224375daf71..9cf04fe13b4 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -936,8 +936,8 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do find('.js-cancel-job').click end - it 'loads the page and shows all needed controls' do - expect(page).to have_content 'Retry' + it 'loads the page and shows no controls' do + expect(page).not_to have_content 'Retry' end end end @@ -946,7 +946,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do context "Job from project", :js do before do job.run! - job.cancel! + job.drop!(:script_failure) visit project_job_path(project, job) wait_for_requests diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index cf334e1e4da..0ea82ba9363 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -115,11 +115,11 @@ describe 'Pipeline', :js do end end - it 'cancels the running build and shows retry button' do + it 'cancels the running build and does not show retry button' do find('#ci-badge-deploy .ci-action-icon-container').click page.within('#ci-badge-deploy') do - expect(page).to have_css('.js-icon-retry') + expect(page).not_to have_css('.js-icon-retry') end end end @@ -133,11 +133,11 @@ describe 'Pipeline', :js do end end - it 'cancels the preparing build and shows retry button' do + it 'cancels the preparing build and does not show retry button' do find('#ci-badge-deploy .ci-action-icon-container').click page.within('#ci-badge-deploy') do - expect(page).to have_css('.js-icon-retry') + expect(page).not_to have_css('.js-icon-retry') end end end diff --git a/spec/lib/gitlab/ci/status/build/factory_spec.rb b/spec/lib/gitlab/ci/status/build/factory_spec.rb index b6231510b91..025439f1b6e 100644 --- a/spec/lib/gitlab/ci/status/build/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/build/factory_spec.rb @@ -163,11 +163,11 @@ describe Gitlab::Ci::Status::Build::Factory do it 'matches correct extended statuses' do expect(factory.extended_statuses) - .to eq [Gitlab::Ci::Status::Build::Canceled, Gitlab::Ci::Status::Build::Retryable] + .to eq [Gitlab::Ci::Status::Build::Canceled] end - it 'fabricates a retryable build status' do - expect(status).to be_a Gitlab::Ci::Status::Build::Retryable + it 'does not fabricate a retryable build status' do + expect(status).not_to be_a Gitlab::Ci::Status::Build::Retryable end it 'fabricates status with correct details' do @@ -177,7 +177,7 @@ describe Gitlab::Ci::Status::Build::Factory do expect(status.illustration).to include(:image, :size, :title) expect(status.label).to eq 'canceled' expect(status).to have_details - expect(status).to have_action + expect(status).not_to have_action end end diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 66be192ab21..7f53b7e7efc 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1425,7 +1425,7 @@ describe Ci::Build do build.cancel! end - it { is_expected.to be_retryable } + it { is_expected.not_to be_retryable } end end @@ -1955,7 +1955,7 @@ describe Ci::Build do context 'when build has been canceled' do subject { build_stubbed(:ci_build, :manual, status: :canceled) } - it { is_expected.to be_playable } + it { is_expected.not_to be_playable } end context 'when build is successful' do diff --git a/spec/requests/api/jobs_spec.rb b/spec/requests/api/jobs_spec.rb index ed2ef4c730b..c14507de186 100644 --- a/spec/requests/api/jobs_spec.rb +++ b/spec/requests/api/jobs_spec.rb @@ -863,7 +863,7 @@ describe API::Jobs do end describe 'POST /projects/:id/jobs/:job_id/retry' do - let(:job) { create(:ci_build, :canceled, pipeline: pipeline) } + let(:job) { create(:ci_build, :failed, pipeline: pipeline) } before do post api("/projects/#{project.id}/jobs/#{job.id}/retry", api_user) @@ -873,7 +873,7 @@ describe API::Jobs do context 'user with :update_build permission' do it 'retries non-running job' do expect(response).to have_gitlab_http_status(201) - expect(project.builds.first.status).to eq('canceled') + expect(project.builds.first.status).to eq('failed') expect(json_response['status']).to eq('pending') end end -- cgit v1.2.1 From 9c6ef1db259abdb7313817c26182282874621f52 Mon Sep 17 00:00:00 2001 From: mfluharty Date: Tue, 23 Apr 2019 20:28:31 -0600 Subject: Update documentation to explain job retryability --- doc/ci/pipelines.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/ci/pipelines.md b/doc/ci/pipelines.md index 2ffa3d4edc7..cb1fd43e179 100644 --- a/doc/ci/pipelines.md +++ b/doc/ci/pipelines.md @@ -266,6 +266,11 @@ Clicking on an individual job will show you its job trace, and allow you to: - Retry the job. - Erase the job trace. +>**Note:** +Once a job has been canceled, it cannot be retried in isolation. +This prevents jobs from being bypassed or run out of order. +To retry a canceled job, retry the pipeline it belongs to. + ### Seeing the failure reason for jobs > [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17782) in GitLab 10.7. -- cgit v1.2.1 From 174a03dfc284781d811df1874ce3cf11d451a8f5 Mon Sep 17 00:00:00 2001 From: Ryan Cobb Date: Wed, 24 Apr 2019 11:41:54 -0600 Subject: Move process specific metrics to ruby sampler These metrics are not unicorn specific and can be used across ruby processes --- lib/gitlab/metrics/samplers/ruby_sampler.rb | 22 +++++++++++------- lib/gitlab/metrics/samplers/unicorn_sampler.rb | 8 +------ .../gitlab/metrics/samplers/ruby_sampler_spec.rb | 26 +++++++++++++++++++++- .../metrics/samplers/unicorn_sampler_spec.rb | 7 ------ 4 files changed, 40 insertions(+), 23 deletions(-) diff --git a/lib/gitlab/metrics/samplers/ruby_sampler.rb b/lib/gitlab/metrics/samplers/ruby_sampler.rb index 18a69321905..c4b2224efdf 100644 --- a/lib/gitlab/metrics/samplers/ruby_sampler.rb +++ b/lib/gitlab/metrics/samplers/ruby_sampler.rb @@ -23,25 +23,31 @@ module Gitlab end def init_metrics - metrics = {} - metrics[:sampler_duration] = ::Gitlab::Metrics.counter(with_prefix(:sampler, :duration_seconds_total), 'Sampler time', labels) - metrics[:total_time] = ::Gitlab::Metrics.counter(with_prefix(:gc, :duration_seconds_total), 'Total GC time', labels) + metrics = { + file_descriptors: ::Gitlab::Metrics.gauge(with_prefix(:file, :descriptors), 'File descriptors used', labels, :livesum), + memory_usage: ::Gitlab::Metrics.gauge(with_prefix(:memory, :bytes), 'Memory used', labels, :livesum), + process_cpu_seconds_total: ::Gitlab::Metrics.gauge(:process_cpu_seconds_total, 'Process CPU seconds total'), + process_max_fds: ::Gitlab::Metrics.gauge(:process_max_fds, 'Process max fds'), + process_start_time_seconds: ::Gitlab::Metrics.gauge(:process_start_time_seconds, 'Process start time seconds'), + sampler_duration: ::Gitlab::Metrics.counter(with_prefix(:sampler, :duration_seconds_total), 'Sampler time', labels), + total_time: ::Gitlab::Metrics.counter(with_prefix(:gc, :duration_seconds_total), 'Total GC time', labels) + } + GC.stat.keys.each do |key| metrics[key] = ::Gitlab::Metrics.gauge(with_prefix(:gc_stat, key), to_doc_string(key), labels, :livesum) end - metrics[:memory_usage] = ::Gitlab::Metrics.gauge(with_prefix(:memory, :bytes), 'Memory used', labels, :livesum) - metrics[:file_descriptors] = ::Gitlab::Metrics.gauge(with_prefix(:file, :descriptors), 'File descriptors used', labels, :livesum) - metrics end def sample start_time = System.monotonic_time - metrics[:memory_usage].set(labels.merge(worker_label), System.memory_usage) metrics[:file_descriptors].set(labels.merge(worker_label), System.file_descriptor_count) - + metrics[:memory_usage].set(labels.merge(worker_label), System.memory_usage) + metrics[:process_cpu_seconds_total].set(labels.merge(worker_label), ::Gitlab::Metrics::System.cpu_time) + metrics[:process_start_time_seconds].set(labels.merge(worker_label), ::Gitlab::Metrics::System.process_start_time) + metrics[:process_max_fds].set(labels.merge(worker_label), ::Gitlab::Metrics::System.max_open_file_descriptors) sample_gc metrics[:sampler_duration].increment(labels, System.monotonic_time - start_time) diff --git a/lib/gitlab/metrics/samplers/unicorn_sampler.rb b/lib/gitlab/metrics/samplers/unicorn_sampler.rb index 16a2ee9b9be..c7063c5ba28 100644 --- a/lib/gitlab/metrics/samplers/unicorn_sampler.rb +++ b/lib/gitlab/metrics/samplers/unicorn_sampler.rb @@ -16,10 +16,7 @@ module Gitlab { unicorn_active_connections: ::Gitlab::Metrics.gauge(:unicorn_active_connections, 'Unicorn active connections', {}, :max), unicorn_queued_connections: ::Gitlab::Metrics.gauge(:unicorn_queued_connections, 'Unicorn queued connections', {}, :max), - unicorn_workers: ::Gitlab::Metrics.gauge(:unicorn_workers, 'Unicorn workers'), - process_cpu_seconds_total: ::Gitlab::Metrics.gauge(:process_cpu_seconds_total, 'Process CPU seconds total'), - process_max_fds: ::Gitlab::Metrics.gauge(:process_max_fds, 'Process max fds'), - process_start_time_seconds: ::Gitlab::Metrics.gauge(:process_start_time_seconds, 'Process start time seconds') + unicorn_workers: ::Gitlab::Metrics.gauge(:unicorn_workers, 'Unicorn workers') } end @@ -39,9 +36,6 @@ module Gitlab metrics[:unicorn_queued_connections].set({ socket_type: 'unix', socket_address: addr }, stats.queued) end - metrics[:process_cpu_seconds_total].set({ pid: nil }, ::Gitlab::Metrics::System.cpu_time) - metrics[:process_start_time_seconds].set({ pid: nil }, ::Gitlab::Metrics::System.process_start_time) - metrics[:process_max_fds].set({ pid: nil }, ::Gitlab::Metrics::System.max_open_file_descriptors) metrics[:unicorn_workers].set({}, unicorn_workers_count) end diff --git a/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb index 7972ff253fe..0fafcb8e380 100644 --- a/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb +++ b/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb @@ -10,8 +10,11 @@ describe Gitlab::Metrics::Samplers::RubySampler do describe '#sample' do it 'samples various statistics' do - expect(Gitlab::Metrics::System).to receive(:memory_usage) + expect(Gitlab::Metrics::System).to receive(:cpu_time) expect(Gitlab::Metrics::System).to receive(:file_descriptor_count) + expect(Gitlab::Metrics::System).to receive(:memory_usage) + expect(Gitlab::Metrics::System).to receive(:process_start_time) + expect(Gitlab::Metrics::System).to receive(:max_open_file_descriptors) expect(sampler).to receive(:sample_gc) sampler.sample @@ -34,6 +37,27 @@ describe Gitlab::Metrics::Samplers::RubySampler do sampler.sample end + it 'adds a metric containing the processes total cpu time' do + expect(Gitlab::Metrics::System).to receive(:cpu_time).and_return(0.51) + expect(sampler.metrics[:process_cpu_seconds_total]).to receive(:set).with({}, 0.51) + + sampler.sample + end + + it 'adds a metric containing the process start time' do + expect(Gitlab::Metrics::System).to receive(:process_start_time).and_return(12345) + expect(sampler.metrics[:process_start_time_seconds]).to receive(:set).with({}, 12345) + + sampler.sample + end + + it 'adds a metric containing the process max file descriptors' do + expect(Gitlab::Metrics::System).to receive(:max_open_file_descriptors).and_return(1024) + expect(sampler.metrics[:process_max_fds]).to receive(:set).with({}, 1024) + + sampler.sample + end + it 'clears any GC profiles' do expect(GC::Profiler).to receive(:clear) diff --git a/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb index 4470dc3ee93..0edbfc869a6 100644 --- a/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb +++ b/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb @@ -80,22 +80,15 @@ describe Gitlab::Metrics::Samplers::UnicornSampler do context 'additional metrics' do let(:cpu_time) { 3.14 } - let(:process_start_time) { 19100.24 } - let(:process_max_fds) { 1024 } let(:unicorn_workers) { 2 } before do allow(unicorn).to receive(:listener_names).and_return([""]) allow(::Gitlab::Metrics::System).to receive(:cpu_time).and_return(cpu_time) - allow(::Gitlab::Metrics::System).to receive(:process_start_time).and_return(process_start_time) - allow(::Gitlab::Metrics::System).to receive(:max_open_file_descriptors).and_return(process_max_fds) allow(subject).to receive(:unicorn_workers_count).and_return(unicorn_workers) end it "sets additional metrics" do - expect(subject.metrics[:process_cpu_seconds_total]).to receive(:set).with({ pid: nil }, cpu_time) - expect(subject.metrics[:process_start_time_seconds]).to receive(:set).with({ pid: nil }, process_start_time) - expect(subject.metrics[:process_max_fds]).to receive(:set).with({ pid: nil }, process_max_fds) expect(subject.metrics[:unicorn_workers]).to receive(:set).with({}, unicorn_workers) subject.sample -- cgit v1.2.1 From bb27bf4a1c7153f2f5074eb058d8659dd9f198ad Mon Sep 17 00:00:00 2001 From: Ryan Cobb Date: Wed, 24 Apr 2019 17:05:09 -0600 Subject: Update docs and calculate process start time via proc table This updates monitor docs to reflect the new ruby and unicorn metrics as well as making it so we fetch process start time via the proc table instead of via CLOCK_BOOTTIME --- .../monitoring/prometheus/gitlab_metrics.md | 14 +++++++++----- lib/gitlab/metrics/samplers/ruby_sampler.rb | 18 +++++++++--------- lib/gitlab/metrics/system.rb | 22 +++++++++++----------- .../gitlab/metrics/samplers/ruby_sampler_spec.rb | 6 +++--- spec/lib/gitlab/metrics/system_spec.rb | 18 ++++++++++++------ 5 files changed, 44 insertions(+), 34 deletions(-) diff --git a/doc/administration/monitoring/prometheus/gitlab_metrics.md b/doc/administration/monitoring/prometheus/gitlab_metrics.md index 3bfcc9a289e..8885236e7be 100644 --- a/doc/administration/monitoring/prometheus/gitlab_metrics.md +++ b/doc/administration/monitoring/prometheus/gitlab_metrics.md @@ -43,10 +43,11 @@ The following metrics are available: | redis_ping_latency_seconds | Gauge | 9.4 | Round trip time of the redis ping | | user_session_logins_total | Counter | 9.4 | Counter of how many users have logged in | | upload_file_does_not_exist | Counter | 10.7 in EE, 11.5 in CE | Number of times an upload record could not find its file | -| failed_login_captcha_total | Gauge | 11.0 | Counter of failed CAPTCHA attempts during login | -| successful_login_captcha_total | Gauge | 11.0 | Counter of successful CAPTCHA attempts during login | -| unicorn_active_connections | Gauge | 11.0 | The number of active Unicorn connections (workers) | -| unicorn_queued_connections | Gauge | 11.0 | The number of queued Unicorn connections | +| failed_login_captcha_total | Gauge | 11.0 | Counter of failed CAPTCHA attempts during login | +| successful_login_captcha_total | Gauge | 11.0 | Counter of successful CAPTCHA attempts during login | +| unicorn_active_connections | Gauge | 11.0 | The number of active Unicorn connections (workers) | +| unicorn_queued_connections | Gauge | 11.0 | The number of queued Unicorn connections | +| unicorn_workers | Gauge | 11.11 | The number of Unicorn workers | ### Ruby metrics @@ -57,8 +58,11 @@ Some basic Ruby runtime metrics are available: | ruby_gc_duration_seconds_total | Counter | 11.1 | Time spent by Ruby in GC | | ruby_gc_stat_... | Gauge | 11.1 | Various metrics from [GC.stat] | | ruby_file_descriptors | Gauge | 11.1 | File descriptors per process | -| ruby_memory_bytes | Gauge | 11.1 | Memory usage by process | +| ruby_process_resident_memory_bytes | Gauge | 11.1 | Memory usage by process | | ruby_sampler_duration_seconds_total | Counter | 11.1 | Time spent collecting stats | +| ruby_process_cpu_seconds_total | Gauge | 11.11 | Total amount of cpu time per process | +| ruby_process_max_fds | Gauge | 11.11 | Maximum number of open file descriptors per process | +| ruby_process_start_time_seconds | Gauge | 11.11 | The time the process started after system boot in seconds | [GC.stat]: https://ruby-doc.org/core-2.3.0/GC.html#method-c-stat diff --git a/lib/gitlab/metrics/samplers/ruby_sampler.rb b/lib/gitlab/metrics/samplers/ruby_sampler.rb index c4b2224efdf..5740380e63e 100644 --- a/lib/gitlab/metrics/samplers/ruby_sampler.rb +++ b/lib/gitlab/metrics/samplers/ruby_sampler.rb @@ -24,13 +24,13 @@ module Gitlab def init_metrics metrics = { - file_descriptors: ::Gitlab::Metrics.gauge(with_prefix(:file, :descriptors), 'File descriptors used', labels, :livesum), - memory_usage: ::Gitlab::Metrics.gauge(with_prefix(:memory, :bytes), 'Memory used', labels, :livesum), - process_cpu_seconds_total: ::Gitlab::Metrics.gauge(:process_cpu_seconds_total, 'Process CPU seconds total'), - process_max_fds: ::Gitlab::Metrics.gauge(:process_max_fds, 'Process max fds'), - process_start_time_seconds: ::Gitlab::Metrics.gauge(:process_start_time_seconds, 'Process start time seconds'), - sampler_duration: ::Gitlab::Metrics.counter(with_prefix(:sampler, :duration_seconds_total), 'Sampler time', labels), - total_time: ::Gitlab::Metrics.counter(with_prefix(:gc, :duration_seconds_total), 'Total GC time', labels) + file_descriptors: ::Gitlab::Metrics.gauge(with_prefix(:file, :descriptors), 'File descriptors used', labels, :livesum), + process_cpu_seconds_total: ::Gitlab::Metrics.gauge(with_prefix(:process, :cpu_seconds_total), 'Process CPU seconds total'), + process_max_fds: ::Gitlab::Metrics.gauge(with_prefix(:process, :max_fds), 'Process max fds'), + process_resident_memory_bytes: ::Gitlab::Metrics.gauge(with_prefix(:process, :resident_memory_bytes), 'Memory used', labels, :livesum), + process_start_time_seconds: ::Gitlab::Metrics.gauge(with_prefix(:process, :start_time_seconds), 'Process start time seconds'), + sampler_duration: ::Gitlab::Metrics.counter(with_prefix(:sampler, :duration_seconds_total), 'Sampler time', labels), + total_time: ::Gitlab::Metrics.counter(with_prefix(:gc, :duration_seconds_total), 'Total GC time', labels) } GC.stat.keys.each do |key| @@ -44,10 +44,10 @@ module Gitlab start_time = System.monotonic_time metrics[:file_descriptors].set(labels.merge(worker_label), System.file_descriptor_count) - metrics[:memory_usage].set(labels.merge(worker_label), System.memory_usage) metrics[:process_cpu_seconds_total].set(labels.merge(worker_label), ::Gitlab::Metrics::System.cpu_time) - metrics[:process_start_time_seconds].set(labels.merge(worker_label), ::Gitlab::Metrics::System.process_start_time) metrics[:process_max_fds].set(labels.merge(worker_label), ::Gitlab::Metrics::System.max_open_file_descriptors) + metrics[:process_resident_memory_bytes].set(labels.merge(worker_label), System.memory_usage) + metrics[:process_start_time_seconds].set(labels.merge(worker_label), ::Gitlab::Metrics::System.process_start_time) sample_gc metrics[:sampler_duration].increment(labels, System.monotonic_time - start_time) diff --git a/lib/gitlab/metrics/system.rb b/lib/gitlab/metrics/system.rb index a269a8688e9..ecd558d7ec7 100644 --- a/lib/gitlab/metrics/system.rb +++ b/lib/gitlab/metrics/system.rb @@ -33,6 +33,13 @@ module Gitlab max_fds end + + def self.process_start_time + start_time_in_jiffies = Sys::ProcTable.ps(pid: Process.pid).starttime + return 0 unless start_time_in_jiffies + + start_time_in_jiffies / 100 + end else def self.memory_usage 0.0 @@ -45,6 +52,10 @@ module Gitlab def self.max_open_file_descriptors 0 end + + def self.process_start_time + 0 + end end # THREAD_CPUTIME is not supported on OS X @@ -60,17 +71,6 @@ module Gitlab end end - # CLOCK_BOOTTIME is not supported on OS X - if Process.const_defined?(:CLOCK_BOOTTIME) - def self.process_start_time - Process - .clock_gettime(Process::CLOCK_BOOTTIME, :float_second) - end - else - def self.process_start_time - 0.0 - end - end # Returns the current real time in a given precision. # # Returns the time as a Float for precision = :float_second. diff --git a/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb index 0fafcb8e380..aaf8c9fa2a0 100644 --- a/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb +++ b/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb @@ -20,10 +20,10 @@ describe Gitlab::Metrics::Samplers::RubySampler do sampler.sample end - it 'adds a metric containing the memory usage' do + it 'adds a metric containing the process resident memory bytes' do expect(Gitlab::Metrics::System).to receive(:memory_usage).and_return(9000) - expect(sampler.metrics[:memory_usage]).to receive(:set).with({}, 9000) + expect(sampler.metrics[:process_resident_memory_bytes]).to receive(:set).with({}, 9000) sampler.sample end @@ -37,7 +37,7 @@ describe Gitlab::Metrics::Samplers::RubySampler do sampler.sample end - it 'adds a metric containing the processes total cpu time' do + it 'adds a metric containing the process total cpu time' do expect(Gitlab::Metrics::System).to receive(:cpu_time).and_return(0.51) expect(sampler.metrics[:process_cpu_seconds_total]).to receive(:set).with({}, 0.51) diff --git a/spec/lib/gitlab/metrics/system_spec.rb b/spec/lib/gitlab/metrics/system_spec.rb index 2de6821bb79..b0603d96eb2 100644 --- a/spec/lib/gitlab/metrics/system_spec.rb +++ b/spec/lib/gitlab/metrics/system_spec.rb @@ -19,6 +19,12 @@ describe Gitlab::Metrics::System do expect(described_class.max_open_file_descriptors).to be > 0 end end + + describe '.process_start_time' do + it 'returns the process start time' do + expect(described_class.process_start_time).to be > 0 + end + end else describe '.memory_usage' do it 'returns 0.0' do @@ -37,6 +43,12 @@ describe Gitlab::Metrics::System do expect(described_class.max_open_file_descriptors).to eq(0) end end + + describe 'process_start_time' do + it 'returns 0' do + expect(described_class.process_start_time).to eq(0) + end + end end describe '.cpu_time' do @@ -56,10 +68,4 @@ describe Gitlab::Metrics::System do expect(described_class.monotonic_time).to be_an(Float) end end - - describe '.process_start_time' do - it 'returns a Float' do - expect(described_class.process_start_time).to be_an(Float) - end - end end -- cgit v1.2.1 From dbeb7b21d3db77482bb23cca08d44248b1e2c616 Mon Sep 17 00:00:00 2001 From: Scott Hampton Date: Thu, 25 Apr 2019 11:49:13 -0700 Subject: Fix commits.scss style-lint errors Updating class names, and using existing utility classes. --- .../javascripts/diffs/components/commit_item.vue | 3 +- .../javascripts/serverless/components/url.vue | 2 +- .../javascripts/vue_shared/components/commit.vue | 4 +- app/assets/stylesheets/pages/commits.scss | 50 +++------------------- app/helpers/ci_status_helper.rb | 2 +- app/views/admin/applications/show.html.haml | 4 +- app/views/doorkeeper/applications/show.html.haml | 4 +- app/views/projects/branches/_commit.html.haml | 4 +- app/views/projects/ci/builds/_build.html.haml | 2 +- app/views/projects/commits/_commit.html.haml | 2 +- .../projects/commits/_inline_commit.html.haml | 2 +- app/views/projects/deployments/_commit.html.haml | 4 +- .../_generic_commit_status.html.haml | 4 +- app/views/shared/_mini_pipeline_graph.html.haml | 2 +- 14 files changed, 27 insertions(+), 62 deletions(-) diff --git a/app/assets/javascripts/diffs/components/commit_item.vue b/app/assets/javascripts/diffs/components/commit_item.vue index c02a8740a42..a767379d662 100644 --- a/app/assets/javascripts/diffs/components/commit_item.vue +++ b/app/assets/javascripts/diffs/components/commit_item.vue @@ -113,9 +113,10 @@ export default {
-
+
-
{{ uri }}
+
{{ uri }}