From a47c8545c719f3d68db360a1707a514b94f2e958 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 9 Oct 2018 19:39:46 +0900 Subject: [PATCH 1/6] Bump memory_profiler from 0.9.11 to 0.9.12 (#8937) Bumps [memory_profiler](https://github.com/SamSaffron/memory_profiler) from 0.9.11 to 0.9.12. - [Release notes](https://github.com/SamSaffron/memory_profiler/releases) - [Changelog](https://github.com/SamSaffron/memory_profiler/blob/master/CHANGELOG.md) - [Commits](https://github.com/SamSaffron/memory_profiler/compare/v0.9.11...v0.9.12) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b36c81f2f1f..a2a420bd212 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -328,7 +328,7 @@ GEM mimemagic (~> 0.3.2) mario-redis-lock (1.2.1) redis (>= 3.0.5) - memory_profiler (0.9.11) + memory_profiler (0.9.12) method_source (0.9.0) microformats (4.0.7) json From d4b7d7596806b73b29f08143734257e04fee82c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 9 Oct 2018 19:59:34 +0900 Subject: [PATCH 2/6] Bump faker from 1.8.7 to 1.9.1 (#8935) Bumps [faker](https://github.com/stympy/faker) from 1.8.7 to 1.9.1. - [Release notes](https://github.com/stympy/faker/releases) - [Changelog](https://github.com/stympy/faker/blob/master/CHANGELOG.md) - [Commits](https://github.com/stympy/faker/compare/v1.8.7...v1.9.1) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 477edf8d663..d6c1c965a54 100644 --- a/Gemfile +++ b/Gemfile @@ -108,7 +108,7 @@ end group :test do gem 'capybara', '~> 3.9' gem 'climate_control', '~> 0.2' - gem 'faker', '~> 1.8' + gem 'faker', '~> 1.9' gem 'microformats', '~> 4.0' gem 'rails-controller-testing', '~> 1.0' gem 'rspec-sidekiq', '~> 3.0' diff --git a/Gemfile.lock b/Gemfile.lock index a2a420bd212..549314cb6fa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -204,7 +204,7 @@ GEM tzinfo excon (0.62.0) fabrication (2.20.1) - faker (1.8.7) + faker (1.9.1) i18n (>= 0.7) faraday (0.15.0) multipart-post (>= 1.2, < 3) @@ -675,7 +675,7 @@ DEPENDENCIES doorkeeper (~> 5.0) dotenv-rails (~> 2.2, < 2.3) fabrication (~> 2.20) - faker (~> 1.8) + faker (~> 1.9) fast_blank (~> 1.0) fastimage fog-core (~> 2.1) From 7f9dd92a27e937e3cbc42c1e3c8b844c3583c92b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 9 Oct 2018 19:35:14 +0200 Subject: [PATCH 3/6] Track historical space stats in PgHero to determine PostgreSQL growth (#8906) --- app/workers/scheduler/pghero_scheduler.rb | 11 +++++++++++ config/sidekiq.yml | 3 +++ .../20181007025445_create_pghero_space_stats.rb | 13 +++++++++++++ db/schema.rb | 11 ++++++++++- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 app/workers/scheduler/pghero_scheduler.rb create mode 100644 db/migrate/20181007025445_create_pghero_space_stats.rb diff --git a/app/workers/scheduler/pghero_scheduler.rb b/app/workers/scheduler/pghero_scheduler.rb new file mode 100644 index 00000000000..4453bf2cd00 --- /dev/null +++ b/app/workers/scheduler/pghero_scheduler.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class Scheduler::PgheroScheduler + include Sidekiq::Worker + + sidekiq_options unique: :until_executed, retry: 0 + + def perform + PgHero.capture_space_stats + end +end diff --git a/config/sidekiq.yml b/config/sidekiq.yml index 6a09bb6e9ac..c44af5b6c5a 100644 --- a/config/sidekiq.yml +++ b/config/sidekiq.yml @@ -33,3 +33,6 @@ backup_cleanup_scheduler: cron: '<%= Random.rand(0..59) %> <%= Random.rand(3..5) %> * * *' class: Scheduler::BackupCleanupScheduler + pghero_scheduler: + cron: '0 0 * * *' + class: Scheduler::PgheroScheduler diff --git a/db/migrate/20181007025445_create_pghero_space_stats.rb b/db/migrate/20181007025445_create_pghero_space_stats.rb new file mode 100644 index 00000000000..6198a6f8468 --- /dev/null +++ b/db/migrate/20181007025445_create_pghero_space_stats.rb @@ -0,0 +1,13 @@ +class CreatePgheroSpaceStats < ActiveRecord::Migration[5.2] + def change + create_table :pghero_space_stats do |t| + t.text :database + t.text :schema + t.text :relation + t.integer :size, limit: 8 + t.timestamp :captured_at + end + + add_index :pghero_space_stats, [:database, :captured_at] + end +end diff --git a/db/schema.rb b/db/schema.rb index 1458bd70fa7..bf6ab4e68cf 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2018_09_29_222014) do +ActiveRecord::Schema.define(version: 2018_10_07_025445) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -372,6 +372,15 @@ ActiveRecord::Schema.define(version: 2018_09_29_222014) do t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true end + create_table "pghero_space_stats", force: :cascade do |t| + t.text "database" + t.text "schema" + t.text "relation" + t.bigint "size" + t.datetime "captured_at" + t.index ["database", "captured_at"], name: "index_pghero_space_stats_on_database_and_captured_at" + end + create_table "preview_cards", force: :cascade do |t| t.string "url", default: "", null: false t.string "title", default: "", null: false From e50cb5f4bd83339049f51dd2e9673be873f16539 Mon Sep 17 00:00:00 2001 From: mayaeh Date: Wed, 10 Oct 2018 02:36:13 +0900 Subject: [PATCH 4/6] Fix that the copy button of verify link did not work. (#8938) --- app/javascript/packs/public.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 22a8643d9c2..11dc1bafc58 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -184,7 +184,7 @@ function main() { }); delegate(document, '.input-copy button', 'click', ({ target }) => { - const input = target.parentNode.querySelector('input'); + const input = target.parentNode.querySelector('.input-copy__wrapper input'); input.focus(); input.select(); From 076ceffa846671f05e05ec1fa065470de0bd3dc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 9 Oct 2018 19:43:05 +0200 Subject: [PATCH 5/6] Bump dotenv-rails from 2.2.2 to 2.5.0 (#8934) Bumps [dotenv-rails](https://github.com/bkeepers/dotenv) from 2.2.2 to 2.5.0. - [Release notes](https://github.com/bkeepers/dotenv/releases) - [Changelog](https://github.com/bkeepers/dotenv/blob/master/Changelog.md) - [Commits](https://github.com/bkeepers/dotenv/compare/v2.2.2...v2.5.0) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index d6c1c965a54..28712b147d2 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,7 @@ gem 'hamlit-rails', '~> 0.2' gem 'pg', '~> 1.1' gem 'makara', '~> 0.4' gem 'pghero', '~> 2.2' -gem 'dotenv-rails', '~> 2.2', '< 2.3' +gem 'dotenv-rails', '~> 2.5' gem 'aws-sdk-s3', '~> 1.21', require: false gem 'fog-core', '~> 2.1' diff --git a/Gemfile.lock b/Gemfile.lock index 549314cb6fa..2b05c5a60f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -184,9 +184,9 @@ GEM unf (>= 0.0.5, < 1.0.0) doorkeeper (5.0.0) railties (>= 4.2) - dotenv (2.2.2) - dotenv-rails (2.2.2) - dotenv (= 2.2.2) + dotenv (2.5.0) + dotenv-rails (2.5.0) + dotenv (= 2.5.0) railties (>= 3.2, < 6.0) elasticsearch (6.0.2) elasticsearch-api (= 6.0.2) @@ -673,7 +673,7 @@ DEPENDENCIES devise-two-factor (~> 3.0) devise_pam_authenticatable2 (~> 9.2) doorkeeper (~> 5.0) - dotenv-rails (~> 2.2, < 2.3) + dotenv-rails (~> 2.5) fabrication (~> 2.20) faker (~> 1.9) fast_blank (~> 1.0) From 46e4a759bbe0e78fdbb4c1573a404bd4b531315a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 9 Oct 2018 19:43:26 +0200 Subject: [PATCH 6/6] Bump capistrano-rails from 1.3.1 to 1.4.0 (#8936) Bumps [capistrano-rails](https://github.com/capistrano/rails) from 1.3.1 to 1.4.0. - [Release notes](https://github.com/capistrano/rails/releases) - [Changelog](https://github.com/capistrano/rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/capistrano/rails/compare/v1.3.1...v1.4.0) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 28712b147d2..fe84966466e 100644 --- a/Gemfile +++ b/Gemfile @@ -132,7 +132,7 @@ group :development do gem 'scss_lint', '~> 0.57', require: false gem 'capistrano', '~> 3.11' - gem 'capistrano-rails', '~> 1.3' + gem 'capistrano-rails', '~> 1.4' gem 'capistrano-rbenv', '~> 2.1' gem 'capistrano-yarn', '~> 2.0' diff --git a/Gemfile.lock b/Gemfile.lock index 2b05c5a60f3..08d5666a43c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -118,7 +118,7 @@ GEM capistrano-bundler (1.3.0) capistrano (~> 3.1) sshkit (~> 1.2) - capistrano-rails (1.3.1) + capistrano-rails (1.4.0) capistrano (~> 3.1) capistrano-bundler (~> 1.1) capistrano-rbenv (2.1.4) @@ -660,7 +660,7 @@ DEPENDENCIES bullet (~> 5.7) bundler-audit (~> 0.6) capistrano (~> 3.11) - capistrano-rails (~> 1.3) + capistrano-rails (~> 1.4) capistrano-rbenv (~> 2.1) capistrano-yarn (~> 2.0) capybara (~> 3.9)