From d9238ee6c0a0bea45b82638d04a913441344ffcf Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Fri, 9 Jun 2017 16:38:49 +0200 Subject: Translate time tooltips. Let the backend do the translation. --- config/locales/en.yml | 231 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 199 insertions(+), 32 deletions(-) (limited to 'config') diff --git a/config/locales/en.yml b/config/locales/en.yml index 9d47425950a..10c5d7f54f3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2,7 +2,6 @@ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. en: - hello: "Hello world" errors: messages: label_already_exists_at_group_level: "already exists at group level for %{group}. Please choose another one." @@ -13,39 +12,207 @@ en: pagination: previous: "Prev" next: "Next" + date: + abbr_day_names: + - Sun + - Mon + - Tue + - Wed + - Thu + - Fri + - Sat + abbr_month_names: + - + - Jan + - Feb + - Mar + - Apr + - May + - Jun + - Jul + - Aug + - Sep + - Oct + - Nov + - Dec + day_names: + - Sunday + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + formats: + default: "%Y-%m-%d" + long: "%B %d, %Y" + short: "%b %d" + month_names: + - + - January + - February + - March + - April + - May + - June + - July + - August + - September + - October + - November + - December + order: + - :year + - :month + - :day datetime: - time_ago_in_words: - half_a_minute: "half a minute ago" - less_than_x_seconds: - one: "less than 1 second ago" - other: "less than %{count} seconds ago" - x_seconds: - one: "1 second ago" - other: "%{count} seconds ago" - less_than_x_minutes: - one: "less than a minute ago" - other: "less than %{count} minutes ago" - x_minutes: - one: "1 minute ago" - other: "%{count} minutes ago" + distance_in_words: about_x_hours: - one: "about 1 hour ago" - other: "about %{count} hours ago" - x_days: - one: "1 day ago" - other: "%{count} days ago" + one: about 1 hour + other: about %{count} hours about_x_months: - one: "about 1 month ago" - other: "about %{count} months ago" - x_months: - one: "1 month ago" - other: "%{count} months ago" + one: about 1 month + other: about %{count} months about_x_years: - one: "about 1 year ago" - other: "about %{count} years ago" - over_x_years: - one: "over 1 year ago" - other: "over %{count} years ago" + one: about 1 year + other: about %{count} years almost_x_years: - one: "almost 1 year ago" - other: "almost %{count} years ago" + one: almost 1 year + other: almost %{count} years + half_a_minute: half a minute + less_than_x_minutes: + one: less than a minute + other: less than %{count} minutes + less_than_x_seconds: + one: less than 1 second + other: less than %{count} seconds + over_x_years: + one: over 1 year + other: over %{count} years + x_days: + one: 1 day + other: "%{count} days" + x_minutes: + one: 1 minute + other: "%{count} minutes" + x_months: + one: 1 month + other: "%{count} months" + x_years: + one: 1 year + other: "%{count} years" + x_seconds: + one: 1 second + other: "%{count} seconds" + prompts: + day: Day + hour: Hour + minute: Minute + month: Month + second: Seconds + year: Year + errors: + format: "%{attribute} %{message}" + messages: + accepted: must be accepted + blank: can't be blank + present: must be blank + confirmation: doesn't match %{attribute} + empty: can't be empty + equal_to: must be equal to %{count} + even: must be even + exclusion: is reserved + greater_than: must be greater than %{count} + greater_than_or_equal_to: must be greater than or equal to %{count} + inclusion: is not included in the list + invalid: is invalid + less_than: must be less than %{count} + less_than_or_equal_to: must be less than or equal to %{count} + model_invalid: "Validation failed: %{errors}" + not_a_number: is not a number + not_an_integer: must be an integer + odd: must be odd + required: must exist + taken: has already been taken + too_long: + one: is too long (maximum is 1 character) + other: is too long (maximum is %{count} characters) + too_short: + one: is too short (minimum is 1 character) + other: is too short (minimum is %{count} characters) + wrong_length: + one: is the wrong length (should be 1 character) + other: is the wrong length (should be %{count} characters) + other_than: must be other than %{count} + template: + body: 'There were problems with the following fields:' + header: + one: 1 error prohibited this %{model} from being saved + other: "%{count} errors prohibited this %{model} from being saved" + helpers: + select: + prompt: Please select + submit: + create: Create %{model} + submit: Save %{model} + update: Update %{model} + number: + currency: + format: + delimiter: "," + format: "%u%n" + precision: 2 + separator: "." + significant: false + strip_insignificant_zeros: false + unit: "$" + format: + delimiter: "," + precision: 3 + separator: "." + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: "%n %u" + units: + billion: Billion + million: Million + quadrillion: Quadrillion + thousand: Thousand + trillion: Trillion + unit: '' + format: + delimiter: '' + precision: 3 + significant: true + strip_insignificant_zeros: true + storage_units: + format: "%n %u" + units: + byte: + one: Byte + other: Bytes + gb: GB + kb: KB + mb: MB + tb: TB + percentage: + format: + delimiter: '' + format: "%n%" + precision: + format: + delimiter: '' + support: + array: + last_word_connector: ", and " + two_words_connector: " and " + words_connector: ", " + time: + am: am + formats: + default: "%a, %d %b %Y %H:%M:%S %z" + long: "%B %d, %Y %H:%M" + short: "%d %b %H:%M" + pm: pm -- cgit v1.2.1 From 7d024a1db37b0632df88f91ed1e4115e8cef951d Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 12 Jun 2017 10:12:07 +0200 Subject: Make sure there's only 1 `errors.messages` definition in en.yml --- config/locales/en.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/locales/en.yml b/config/locales/en.yml index 10c5d7f54f3..6f23ca353e3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2,12 +2,6 @@ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. en: - errors: - messages: - label_already_exists_at_group_level: "already exists at group level for %{group}. Please choose another one." - wrong_size: "is the wrong size (should be %{file_size})" - size_too_small: "is too small (should be at least %{file_size})" - size_too_big: "is too big (should be at most %{file_size})" views: pagination: previous: "Prev" @@ -114,6 +108,10 @@ en: errors: format: "%{attribute} %{message}" messages: + label_already_exists_at_group_level: "already exists at group level for %{group}. Please choose another one." + wrong_size: "is the wrong size (should be %{file_size})" + size_too_small: "is too small (should be at least %{file_size})" + size_too_big: "is too big (should be at most %{file_size})" accepted: must be accepted blank: can't be blank present: must be blank -- cgit v1.2.1 From 0c04a890db17f3e23e17ace5221836e6f748fc7e Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 12 Jun 2017 10:16:18 +0200 Subject: Re-add time_ago_in_words --- config/locales/en.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'config') diff --git a/config/locales/en.yml b/config/locales/en.yml index 6f23ca353e3..77d59c5d77a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -60,6 +60,41 @@ en: - :month - :day datetime: + time_ago_in_words: + half_a_minute: "half a minute ago" + less_than_x_seconds: + one: "less than 1 second ago" + other: "less than %{count} seconds ago" + x_seconds: + one: "1 second ago" + other: "%{count} seconds ago" + less_than_x_minutes: + one: "less than a minute ago" + other: "less than %{count} minutes ago" + x_minutes: + one: "1 minute ago" + other: "%{count} minutes ago" + about_x_hours: + one: "about 1 hour ago" + other: "about %{count} hours ago" + x_days: + one: "1 day ago" + other: "%{count} days ago" + about_x_months: + one: "about 1 month ago" + other: "about %{count} months ago" + x_months: + one: "1 month ago" + other: "%{count} months ago" + about_x_years: + one: "about 1 year ago" + other: "about %{count} years ago" + over_x_years: + one: "over 1 year ago" + other: "over %{count} years ago" + almost_x_years: + one: "almost 1 year ago" + other: "almost %{count} years ago" distance_in_words: about_x_hours: one: about 1 hour -- cgit v1.2.1 From 67d52fe48f4116731fcfbb5d5c658ad8d11eb4b9 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 12 Jun 2017 10:35:36 +0200 Subject: Use the same time format as before --- config/locales/en.yml | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/locales/en.yml b/config/locales/en.yml index 77d59c5d77a..2f21a907154 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -248,4 +248,5 @@ en: default: "%a, %d %b %Y %H:%M:%S %z" long: "%B %d, %Y %H:%M" short: "%d %b %H:%M" + timeago_tooltip: "%b %-d, %Y %-k:%M%P" pm: pm -- cgit v1.2.1 From 9c8f9e8324e6227a615325e5e022fa6dbc09bb0c Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Tue, 13 Jun 2017 10:18:48 +0200 Subject: Update timeago tooltips for Spanish --- config/locales/es.yml | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/locales/es.yml b/config/locales/es.yml index d71c6eb5047..fdc52b4ae11 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -251,4 +251,5 @@ es: default: "%A, %d de %B de %Y %H:%M:%S %z" long: "%d de %B de %Y %H:%M" short: "%d de %b %H:%M" + timeago_tooltip: "%d de %B de %Y %H:%M" pm: pm -- cgit v1.2.1 From 80db01491f4074f44333c5f1854888b3763510d5 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Thu, 15 Jun 2017 14:29:11 +0200 Subject: Take timezone into account when comparing dates in the UI --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/locales/en.yml b/config/locales/en.yml index 2f21a907154..8932db138d9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -248,5 +248,5 @@ en: default: "%a, %d %b %Y %H:%M:%S %z" long: "%B %d, %Y %H:%M" short: "%d %b %H:%M" - timeago_tooltip: "%b %-d, %Y %-k:%M%P" + timeago_tooltip: "%b %-d, %Y %-l:%M%P" pm: pm -- cgit v1.2.1 From e5a91870fd2a4eefd086aa88e3b5ea02e2fbc768 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 16 Jun 2017 20:40:28 +0000 Subject: Increase karma socket timeout --- config/karma.config.js | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/karma.config.js b/config/karma.config.js index 978850e5d70..5911a9a7e10 100644 --- a/config/karma.config.js +++ b/config/karma.config.js @@ -54,6 +54,7 @@ module.exports = function(config) { subdir: '.', fixWebpackSourcePaths: true }; + karmaConfig.browserNoActivityTimeout = 60000; // 60 seconds } if (process.env.DEBUG) { -- cgit v1.2.1 From e0dbfacf6eae0ef6ce1f641e5057bc89c9478b47 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 16 Jun 2017 15:15:54 -0500 Subject: don't make assumptions about command line arguments invoking webpack config --- config/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index 3c2455ebf35..ad6bd88020d 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -11,7 +11,7 @@ var WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeMod var ROOT_PATH = path.resolve(__dirname, '..'); var IS_PRODUCTION = process.env.NODE_ENV === 'production'; -var IS_DEV_SERVER = process.argv[1].indexOf('webpack-dev-server') !== -1; +var IS_DEV_SERVER = process.argv.join(' ').indexOf('webpack-dev-server') !== -1; var DEV_SERVER_HOST = process.env.DEV_SERVER_HOST || 'localhost'; var DEV_SERVER_PORT = parseInt(process.env.DEV_SERVER_PORT, 10) || 3808; var DEV_SERVER_LIVERELOAD = process.env.DEV_SERVER_LIVERELOAD !== 'false'; -- cgit v1.2.1 From 3265670327ed8900f2cb6a3df5eec05de3f93096 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 16 Jun 2017 15:16:52 -0500 Subject: refactor zopfli fallback config --- config/webpack.config.js | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'config') diff --git a/config/webpack.config.js b/config/webpack.config.js index ad6bd88020d..fb91ffef7e7 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -18,15 +18,6 @@ var DEV_SERVER_LIVERELOAD = process.env.DEV_SERVER_LIVERELOAD !== 'false'; var WEBPACK_REPORT = process.env.WEBPACK_REPORT; var NO_COMPRESSION = process.env.NO_COMPRESSION; -// optional dependency `node-zopfli` is unavailable on CentOS 6 -var ZOPFLI_AVAILABLE; -try { - require.resolve('node-zopfli'); - ZOPFLI_AVAILABLE = true; -} catch(err) { - ZOPFLI_AVAILABLE = false; -} - var config = { // because sqljs requires fs. node: { @@ -233,12 +224,12 @@ if (IS_PRODUCTION) { // zopfli requires a lot of compute time and is disabled in CI if (!NO_COMPRESSION) { - config.plugins.push( - new CompressionPlugin({ - asset: '[path].gz[query]', - algorithm: ZOPFLI_AVAILABLE ? 'zopfli' : 'gzip', - }) - ); + // gracefully fall back to gzip if `node-zopfli` is unavailable (e.g. in CentOS 6) + try { + config.plugins.push(new CompressionPlugin({ algorithm: 'zopfli' })); + } catch(err) { + config.plugins.push(new CompressionPlugin({ algorithm: 'gzip' })); + } } } -- cgit v1.2.1 From 76bafc00e62b3a90252f0d229c7ce98c2691da30 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Fri, 16 Jun 2017 18:42:41 +0200 Subject: Pass Gitaly token on Ruby gRPC requests --- config/gitlab.yml.example | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 0b33783869b..7c7e444af3a 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -454,6 +454,8 @@ production: &base # introduced in 9.0). Eventually Gitaly use will become mandatory and # this option will disappear. enabled: true + # Default Gitaly authentication token. Can be overriden per storage. + token: "" # # 4. Advanced settings @@ -469,6 +471,7 @@ production: &base default: path: /home/git/repositories/ gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket # TCP connections are supported too (e.g. tcp://host:port) + # gitaly_token: 'special token' # Optional: override global gitaly.token for this storage. ## Backup settings backup: -- cgit v1.2.1 From ed5c7d11b19c9507206ada5c6e12eef477370fa9 Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Thu, 15 Jun 2017 23:41:47 +0200 Subject: Do not enable prometheus metrics when data folder is not present. + Set defaults correctly only for when not in production or staging + set ENV['prometheus_multiproc_dir'] in config/boot.rb instead of config.ru Test prometheus metrics unmemoized --- config/boot.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/boot.rb b/config/boot.rb index db5ab918021..16de55d7a86 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -6,7 +6,9 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) # set default directory for multiproces metrics gathering -ENV['prometheus_multiproc_dir'] ||= 'tmp/prometheus_multiproc_dir' +if ENV['RAILS_ENV'] == 'development' || ENV['RAILS_ENV'] == 'test' + ENV['prometheus_multiproc_dir'] ||= 'tmp/prometheus_multiproc_dir' +end # Default Bootsnap configuration from https://github.com/Shopify/bootsnap#usage require 'bootsnap' -- cgit v1.2.1 From 4f8af50b619dd87c16035f56dce5cbde3531aef1 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 20 Jun 2017 17:31:49 +0200 Subject: Rubocop and comment fixes --- config/gitlab.yml.example | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 7c7e444af3a..82dd53013f9 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -454,8 +454,10 @@ production: &base # introduced in 9.0). Eventually Gitaly use will become mandatory and # this option will disappear. enabled: true - # Default Gitaly authentication token. Can be overriden per storage. - token: "" + # Default Gitaly authentication token. Can be overriden per storage. Can + # be left blank when Gitaly is running locally on a Unix socket, which + # is the normal way to deploy Gitaly. + token: # # 4. Advanced settings -- cgit v1.2.1 From 218da88e1aa7b0538d069ce9dc6e3a4348c610fc Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 20 Jun 2017 17:42:54 +0200 Subject: Enable gitaly token auth when testing --- config/gitlab.yml.example | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 82dd53013f9..43a8c0078ca 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -599,6 +599,7 @@ test: gitaly_address: unix:tmp/tests/gitaly/gitaly.socket gitaly: enabled: true + token: secret backup: path: tmp/tests/backups gitlab_shell: -- cgit v1.2.1 From 0430b7644101fc70ed4be6bf69ccf05b900f4cdf Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Wed, 21 Jun 2017 13:48:12 +0000 Subject: Enable Style/DotPosition Rubocop :cop: --- config/initializers/8_metrics.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/initializers/8_metrics.rb b/config/initializers/8_metrics.rb index 508b886d6a0..a0a63ddf8f0 100644 --- a/config/initializers/8_metrics.rb +++ b/config/initializers/8_metrics.rb @@ -154,8 +154,8 @@ if Gitlab::Metrics.enabled? ActiveRecord::Querying.public_instance_methods(false).map(&:to_s) ) - Gitlab::Metrics::Instrumentation. - instrument_class_hierarchy(ActiveRecord::Base) do |klass, method| + Gitlab::Metrics::Instrumentation + .instrument_class_hierarchy(ActiveRecord::Base) do |klass, method| # Instrumenting the ApplicationSetting class can lead to an infinite # loop. Since the data is cached any way we don't really need to # instrument it. -- cgit v1.2.1