welaika-suspenders 2.32.2 → 2.33

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cde6a177dbc8f305be903441b88283e9bc6abc3f68c950bf2b732383239ec31e
4
- data.tar.gz: ca845db387e49483fbff6a017754c88d3cf92c5b74c556cb43255c1d6978fe04
3
+ metadata.gz: 1feb33dee0a5957e4e4f475da9afc775414ba866f162781bc160dec04fcdd9f4
4
+ data.tar.gz: 6b6f4bd1656d5cb86bf9ffbc4d2131ecc69b1dc64bca69199b4e385f3df3e9df
5
5
  SHA512:
6
- metadata.gz: 5ffb2c185c86290d917675281509a8388246b7992cbc3028afa0c199f27c5b0e0c584000850af7edee326b8b2f5991a4b1441a0faea467636cab7e788066d248
7
- data.tar.gz: 6b9d50b7a7f8acbdc88bdd12b4af77783e7e6daff44b04ea92ba27ff6ff8715f97b121f75075071c4a5277823ff317acb630ae88279b32c394b920cf14780b56
6
+ metadata.gz: fe96258397d31d095e8db2b2259117d1a6fb78eebe4b27e39047408b4628ed910b91815cab7087f5bbd9dfa16214b722c72a56399f15f7acc3cf2fdf8ccbb1d9
7
+ data.tar.gz: 4a01c8d4b248329326ef71e2bde68eb4c5d67672e3a7be437b8e72a6ada4fb2a015730ca27f673faee473030bb70b8881e0bf61639406b4aba9d4cc50a895ada
@@ -1,3 +1,13 @@
1
+ 2.33 (July 23th, 2019)
2
+ * Feature: allow to deploy to heroku with push --force-with-lease (useful for staging)
3
+ * Fix: make new Chrome versions (really) headless
4
+ * Fix: remove code written for simple_cov on Circle CI
5
+ * Change: create database snapshot on heroku at 2 am (UTC) instead of 10 am (UTC)
6
+ * Documentation: add info about resetting the db on heroku
7
+ * Feature: add factory_bot lint to gitlabci
8
+ * Fix: SENTRY_ENV environment name was mismatched in .env file
9
+ * Fix: Chrome now runs (again) on docker (for gitlabci)
10
+
1
11
  2.32.2 (June 24, 2019)
2
12
  * Fix: stylelint on gitlab was not working
3
13
 
@@ -59,7 +59,7 @@ module Suspenders
59
59
  def set_heroku_backup_schedule
60
60
  %w(staging production).each do |environment|
61
61
  run_toolbelt_command(
62
- "pg:backups:schedule DATABASE_URL --at '10:00 UTC'",
62
+ "pg:backups:schedule DATABASE_URL --at '2:00 UTC'",
63
63
  environment,
64
64
  )
65
65
  end
@@ -17,6 +17,26 @@ module Suspenders
17
17
 
18
18
  % ./bin/import_dump staging
19
19
  % ./bin/import_dump production
20
+
21
+ ## Resetting a database
22
+
23
+ If you want to reset (destroy and recreate) a database on Heroku, you
24
+ cannot use `heroku run rake db:drop`, instead use:
25
+
26
+ % heroku pg:reset DATABASE_URL --remote=staging
27
+
28
+ ( source: https://devcenter.heroku.com/articles/heroku-postgresql#pg-reset )
29
+
30
+ To load schema and seeds, you cannot use `heroku run rake db:setup`, instead use:
31
+
32
+ % heroku run rails db:schema:load db:seed --remote=staging
33
+
34
+ Remember to create a new backup schedule on Heroku after you reset your database!
35
+
36
+ % heroku pg:backups:schedule DATABASE_URL --at '2:00 UTC' --remote=staging
37
+
38
+ ( source: https://devcenter.heroku.com/articles/heroku-postgres-backups#scheduling-backups )
39
+
20
40
  MARKDOWN
21
41
 
22
42
  append_file "README.md", instructions
@@ -17,7 +17,9 @@ module Suspenders
17
17
  you can deploy to staging and production with:
18
18
 
19
19
  % ./bin/deploy staging
20
+ % ./bin/deploy -f staging # pushing with force-with-lease, attention!
20
21
  % ./bin/deploy production
22
+ % ./bin/deploy -f production # pushing with force-with-lease, attention!
21
23
  MARKDOWN
22
24
 
23
25
  append_file "README.md", instructions
@@ -5,5 +5,5 @@ module Suspenders
5
5
  read("#{File.dirname(__FILE__)}/../../.ruby-version").
6
6
  strip.
7
7
  freeze
8
- VERSION = "2.32.2".freeze
8
+ VERSION = "2.33".freeze
9
9
  end
@@ -61,7 +61,7 @@ module Suspenders
61
61
 
62
62
  def have_backup_schedule(remote_name)
63
63
  have_received(:run).
64
- with(/pg:backups:schedule DATABASE_URL --at '10:00 UTC' --remote #{remote_name}/)
64
+ with(/pg:backups:schedule DATABASE_URL --at '2:00 UTC' --remote #{remote_name}/)
65
65
  end
66
66
 
67
67
  def have_configured_var(remote_name, var)
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe "suspenders:staging:pull_requests", type: :generators do
3
+ RSpec.describe "suspenders:staging:pull_requests", type: :generator do
4
4
  it "generates the configuration for Heroku pipeline review apps" do
5
5
  with_app { generate("suspenders:staging:pull_requests") }
6
6
 
@@ -3,10 +3,22 @@
3
3
  # Run this script to deploy the app to Heroku.
4
4
 
5
5
  set -e
6
+ # set -x # turn debugging on
7
+
8
+ while getopts "f" options; do
9
+ case "${options}" in
10
+ f)
11
+ force='--force-with-lease'
12
+ ;;
13
+ *)
14
+ ;;
15
+ esac
16
+ done
17
+ shift $((OPTIND-1))
6
18
 
7
19
  branch="$(git symbolic-ref HEAD --short)"
8
20
  target="${1:-staging}"
9
21
 
10
- git push "$target" "$branch:master"
22
+ git push $force "$target" "$branch:master"
11
23
  heroku run rails db:migrate --exit-code --remote "$target"
12
24
  heroku restart --remote "$target"
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Capybara.server = :puma, { Silent: true }
@@ -10,19 +10,21 @@ end
10
10
  Capybara.register_driver :headless_chrome do |app|
11
11
  options = ::Selenium::WebDriver::Chrome::Options.new
12
12
  options.headless!
13
- # Set a big (15" MBP retina resolution) window size so that
14
- # `save_and_open_screenshot` captures the whole page.
15
- options.add_argument "--window-size=1680,1050"
13
+ options.add_argument '--window-size=1680,1050'
16
14
 
17
- capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
18
- chromeOptions: { args: %w[headless disable-gpu] }
19
- )
15
+ if ENV['CI'].present?
16
+ # NOTE: alternative, create a chrome user
17
+ # https://github.com/GoogleChromeLabs/lighthousebot/blob/master/builder/Dockerfile#L35-L40
18
+ options.add_argument '--no-sandbox'
19
+
20
+ options.add_argument '--disable-gpu'
21
+ options.add_argument '--disable-dev-shm-usage'
22
+ end
20
23
 
21
24
  Capybara::Selenium::Driver.new(
22
25
  app,
23
26
  browser: :chrome,
24
- options: options,
25
- desired_capabilities: capabilities
27
+ options: options
26
28
  )
27
29
  end
28
30
 
@@ -12,4 +12,4 @@ SMTP_PASSWORD=password
12
12
  SMTP_USERNAME=username
13
13
  WEB_CONCURRENCY=1
14
14
  SENTRY_DSN=
15
- SENTRY_CURRENT_ENV=
15
+ SENTRY_ENV=
@@ -93,6 +93,26 @@ quality:rubycritic:
93
93
  - bundle check --path vendor/bundle
94
94
  - bundle exec rubycritic app/ config/ lib/ --no-browser --minimum-score 94 --format console
95
95
 
96
+ test:factory_lint:
97
+ <<: *job-creation-policy
98
+ stage: test
99
+ services: *rails-services
100
+ cache:
101
+ <<: *cache-settings
102
+ script:
103
+ # Verify node and yarn versions
104
+ - node --version
105
+ - yarn --version
106
+
107
+ # Setup environment
108
+ - cp -f config/database.gitlab.yml config/database.yml
109
+ - bundle check --path vendor/bundle
110
+ - bin/yarn
111
+ - bundle exec rails db:setup RAILS_ENV=test
112
+
113
+ # Run factory_bot lint
114
+ - bundle exec rake factory_bot:lint RAILS_ENV=test
115
+
96
116
  test:rspec:
97
117
  <<: *job-creation-policy
98
118
  stage: test
@@ -3,6 +3,6 @@
3
3
  Raven.configure do |config|
4
4
  config.dsn = ENV.fetch('SENTRY_DSN')
5
5
  config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
6
- config.environments = %w[ staging production ]
6
+ config.environments = %w[staging production]
7
7
  config.current_environment = ENV.fetch('SENTRY_ENV', Rails.env)
8
8
  end
@@ -7,11 +7,6 @@ SimpleCov.start 'rails' do
7
7
  add_group 'Interactions', 'app/interactions'
8
8
  end
9
9
 
10
- if ENV['CIRCLE_ARTIFACTS']
11
- dir = File.join(ENV['CIRCLE_ARTIFACTS'], 'coverage')
12
- SimpleCov.coverage_dir(dir)
13
- end
14
-
15
10
  require 'webmock/rspec'
16
11
  require 'timecop'
17
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: welaika-suspenders
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.32.2
4
+ version: '2.33'
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-06-24 00:00:00.000000000 Z
12
+ date: 2019-07-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails