Commit graph

3800 commits

Author SHA1 Message Date
Andrew Kvalheim
266fdbabea
Omit nil SMTP settings
Allows leaving `smtp_settings[:domain]` unspecified. Explicitly setting
it to `nil` (as when `OSEM_SMTP_DOMAIN` is unset) overrides the default
value of `'localhost.localdomain'` and caused SMTP connections to fail
with `EOFError`.
2021-03-06 21:10:36 +01:00
Henne Vogelsang
32164c47db
Merge pull request #2663 from AndrewKvalheim/docker-compose-v2.4
Update Docker Compose file format: 2.0 → 2.4 (minor)
2021-03-06 21:03:22 +01:00
Henne Vogelsang
9a04411f81
Merge pull request #2667 from AndrewKvalheim/fix-migration-non-null
Work around bug in migrations to non-null columns
2021-03-06 21:02:13 +01:00
Henne Vogelsang
c29d45beea
Merge pull request #2666 from AndrewKvalheim/fix-migration-carrierwave
Fix migration that fails on conferences without pictures
2021-03-06 21:00:38 +01:00
Henne Vogelsang
fabb17f41c
Merge pull request #2665 from AndrewKvalheim/migration-rails-version
Annotate past migrations with Rails version
2021-03-06 20:59:57 +01:00
Andrew Kvalheim
fdd7806071
Work around bug in migrations to non-null columns
When running migration 20170705075039 followed by 20170715131706, the
latter fails due to lingering null values in a newly non-null column—

    Mysql2::Error: Invalid use of NULL value: ALTER TABLE `tracks` CHANGE `state` `state` varchar(255) DEFAULT 'new' NOT NULL
    db/migrate/20170715131706_make_track_state_not_null_and_add_default_value.rb:17:in `change'

—despite having apparently converted any existing null values prior to
changing the column type. Investigation reveals that actually the
attempted conversion has had no effect, and that this can be resolved by
clearing ActiveRecord internal caches between migrations:

    connection.schema_cache.clear_data_source_cache! 'tracks'

The same problem also affects running 20170705075039 followed by
20170720134353, but in that case it leads to silent data corruption as
`change_column_null` automatically converts any lingering null values.

This commit 1) clears ActiveRecord internal caches at the beginning of
each affected migration, and 2) replaces `change_column_null` with
`change_column` to reflect that no automatic conversion is intended.
2021-03-06 20:10:20 +01:00
Andrew Kvalheim
079f609603
Fix migration that fails on conferences without pictures
CarrierWave documentation:

> Note: `recreate_versions!` will throw an exception on records without
> an image. To avoid this, scope the records to those with images or
> check if an image exists within the block.

Resolves #1976:

    NoMethodError: undefined method `read' for nil:NilClass
    …/carrierwave-1.3.1/lib/carrierwave/uploader/cache.rb:81:in `sanitized_file'
    …/carrierwave-1.3.1/lib/carrierwave/uploader/cache.rb:118:in `cache!'
    …/carrierwave-1.3.1/lib/carrierwave/uploader/versions.rb:234:in `recreate_versions!'
    db/migrate/20171130172334_rebuild_conference_pictures.rb:4:in `block in up'
2021-03-06 20:08:15 +01:00
Andrew Kvalheim
5a890013ef
Annotate past migrations with Rails version
Many migrations currently fail to run with:

> Directly inheriting from ActiveRecord::Migration is not supported.
> Please specify the Rails release the migration was written for:
>
>     class Example < ActiveRecord::Migration[4.2]

I've annotated those that I need to run with the Rails version at the
time each was committed:

    rake db:migrate:status \
    | grep --perl-regexp --only-matching '(?<=^  down    )\d{14}' \
    | while read -r id; do
      path="$(ls -1 db/migrate/${id}_*.rb)"
      version="$(git show "$(git log --diff-filter=A --pretty=format:%H -- "$path")":Gemfile.lock \
        | grep --perl-regexp --only-matching '(?<=^    rails \()\d+\.\d+(?=(\.\d+)+\))')"
      sed --in-place -e "s/\(< ActiveRecord::Migration\)$/\\1[$version]/" "$path"
    done
2021-03-06 20:06:50 +01:00
Andrew Kvalheim
b6208d4d4b
Update Docker Compose file format: 2.0 → 2.4 (minor)
Allows the use of additional parameters such as `cpus` and
`healthcheck`.
2021-03-06 20:04:51 +01:00
Henne Vogelsang
2051540693
Merge pull request #2655 from AndrewKvalheim/rubocop-db-schema
Ignore schema.rb in RuboCop
2021-03-06 20:03:32 +01:00
Henne Vogelsang
7f1d3b923a
Merge pull request #2662 from AndrewKvalheim/issue-2661-workaround
Fix bug in test of animated form
2021-03-06 20:02:04 +01:00
Henne Vogelsang
0729c6f6fe
Merge pull request #2659 from AndrewKvalheim/transactional-tests
Use Rails transactional tests
2021-03-06 20:01:47 +01:00
Henne Vogelsang
fc61c4b39c
Merge pull request #2658 from AndrewKvalheim/save-screenshot
Fix bug in logging of screenshots of failed tests
2021-03-06 20:01:13 +01:00
Henne Vogelsang
995db101b3
Merge pull request #2657 from AndrewKvalheim/bootstrap-markdown
Remove superfluous click to display Markdown editor
2021-03-06 20:00:50 +01:00
Andrew Kvalheim
07f1323eff
Fix bug in test of animated form
The help text for the event type field is animated using a technique
unaffected by `Capybara.disable_animation`. Wait for the animation.

Resolves: #2356
Works around: #2661
2021-03-06 19:43:35 +01:00
Andrew Kvalheim
c3e02c20b9
Use Rails transactional tests
As of Rails 5.1:

  - Rails has built-in support for running tests within database
    transactions, so Database Cleaner is no longer needed for this.
  - Rails automatically shares the database connection across threads,
    so transactional_capybara is no longer needed.

Changes:

  - Enable `use_transactional_tests`.
  - Remove transactional_capybara.
  - Remove the Database Cleaner test wrapper.

This resolves:

  - transactional_capybara mismanages the shared database connection,
    causing the connection to falsely report as idle after the first
    test. At 6 minutes (idle_timeout + reaping_frequency) into testing,
    the connection is closed, causing e.g. `PG::ConnectionBad` errors.
2021-03-06 19:41:06 +01:00
Andrew Kvalheim
310fc8dc68
Fix bug in test database preparation
Presumably the intent of this was to clear the database and repopulate
it with seed data. `transaction` isn't the right strategy for this; it
just rolls back any existing transactions.
2021-03-06 19:41:06 +01:00
Andrew Kvalheim
2c8521a2e5
Remove redundant code
This functionality is provided by transactional_capybara.
2021-03-06 19:41:05 +01:00
Andrew Kvalheim
c0913ab723
Work around RuboCop false positive
Details: rubocop-hq/rubocop#7853
2021-03-06 19:38:47 +01:00
Andrew Kvalheim
0df16e4773
Fix bug in logging of screenshots of failed tests
Presumably this was a typo.
2021-03-06 19:38:47 +01:00
Henne Vogelsang
977748a039
Merge pull request #2653 from differentreality/chart_legend
Fix chart legend position
2021-03-06 19:36:34 +01:00
Andrew Kvalheim
ce59c37ff6
Use correct loading mode of Bootstrap-Markdown
data-provide="markdown-editable" is intended for inline editing of page
content à la contenteditable. When this is applied to a textarea, the
editor is loaded only after the user clicks on the field. This behavior
breaks focus and is incompatible with keyboard navigation.
2021-03-06 19:35:23 +01:00
Andrew Kvalheim
75d28b802f
Don't clobber RuboCop's default excludes
By default, adding an exclude (faffc49) has the effect of removing the
default excludes. Merge them as described in rubocop-hq/rubocop#6567.
2021-03-06 19:33:28 +01:00
Andrew Kvalheim
162e0f720f
Exclude Rails database schema from linting
The schema is automatically generated, so RuboCop's recommendations are
non-actionable; ignore it as in rubocop-hq/rubocop#752.
2021-03-06 19:33:28 +01:00
Stella Rouzi
c4da5cc31d
Fix chart legend position 2021-03-06 19:27:28 +01:00
Henne Vogelsang
0646e41a82
Merge pull request #2632 from esparta/delegation_for_conference_venue
Introducing Delegation for Conference-Venue properties
2021-03-06 19:21:36 +01:00
Andrew Kvalheim
fa129d218f
Whitelist Webdrivers update URLs in WebMock
Resolves #2557:

    $ docker-compose run --rm osem bundle exec rspec --tag js
    …
    WebMock::NetConnectNotAllowedError

See titusfortner/webdrivers#109 for details.
2021-03-06 19:20:30 +01:00
Henne Vogelsang
8e7cb18c36
Merge pull request #2631 from esparta/use_native_active_record_logger
Using Native ActiveRecord Logger
2021-03-06 19:16:36 +01:00
Henne Vogelsang
d928be7e18
Merge pull request #2629 from esparta/conference_index_dry
DRY on controllers/conferences_controller#index
2021-03-06 19:10:45 +01:00
Espartaco Palma
5d79049e59
Linters gonna lint
I was not aware the linting was also applied to specs
2021-03-06 19:09:38 +01:00
Espartaco Palma
f5986f4160
Using new accessor for city, country_name, venue name & street 2021-03-06 19:06:36 +01:00
Espartaco Palma
fd2635509f
Introducing delegation for city and country name (Conference - Venue
Using ActiveSupport delegate macro.
2021-03-06 19:06:36 +01:00
Espartaco Palma
2d17ce2667
Using Native ActiveRecord Logger
Starting in Rails 5.2 there's a new setting to log ActiveRecord
queries making the LogQuerySource not needed anymore
2021-03-06 19:03:47 +01:00
Espartaco Palma
490ea3c4b4
DRY on controllers/conferences_controller
Conferences.incoming is defined on the model as scope:

  scope :upcoming, (-> { where('end_date >= ?', Date.current) })
Conference.past

  scope :past, (-> { where('end_date < ?', Date.current) })
2021-03-06 19:00:47 +01:00
Henne Vogelsang
f50a92bf53
Merge pull request #2728 from hennevogel/feature/codacy
Set cobertura as simplecove formatter in github actions
2021-03-06 18:43:03 +01:00
Henne Vogelsang
2b0a257090
Set cobertura as simplecove formatter in github actions 2021-03-06 18:37:04 +01:00
Henne Vogelsang
a08862a134
Merge pull request #2727 from hennevogel/feature/codacy
Add codacy coverage reporter to CI cycle
2021-03-06 15:55:14 +01:00
Henne Vogelsang
85ac373cb1
Add codacy to CI cycle, lint first 2021-03-06 15:45:57 +01:00
Henne Vogelsang
ba03774793
Merge pull request #2628 from differentreality/fixes
Fix datepicker for admin/conferences#edit
2021-03-06 13:06:02 +01:00
Stella Rouzi
780d37eb41
Enable datepicker for readonly fields
Remove minDate definition, so that value appears in readonly input
2021-03-06 12:48:50 +01:00
Stella Rouzi
7495ca89ef
Change font for registration item in user menu 2021-03-06 12:48:47 +01:00
Henne Vogelsang
c7660d2201
Merge pull request #2624 from differentreality/proposal_form_cfp_existence
Check CfP existence in proposal form
2021-03-06 12:47:07 +01:00
Stella Rouzi
cb7519f7a4
Check CfP existence in proposal form 2021-03-06 12:38:02 +01:00
Henne Vogelsang
823f41427f
Merge pull request #2591 from openSUSE/remove-travel-schedule
Remove travel schedule from registration
2021-03-06 05:04:07 +01:00
Henne Vogelsang
8c37af53ea
Merge pull request #2722 from gonyere/master
removed-gendered-terms
2021-03-06 04:57:24 +01:00
Henne Vogelsang
9734120845
Merge pull request #2556 from esparta/promote_new_installation_page
Use New Install within their own template
2021-03-06 04:13:23 +01:00
James Mason
7a04f3582f
Remove travel schedule from registration
(cherry picked from commit d18cc02f0185df39bb4213d8a63a955dfb433dcb)
Re: https://github.com/openSUSE/osem/issues/2333
2021-03-06 04:09:02 +01:00
Espartaco Palma
e7452a9d31
Use New Install within their own template
It used to be a partial inside #index, but having their own page
yields some extra benefits:

- Performance: Move logic from the view to the controller
  - Theres' no need to go extra steps inside the :index view
- UI: Remove the extra 'Upcoming Conferences' when the system needs
  to start the flow of the creation of the first user
2021-03-06 03:58:32 +01:00
Emily Gonyer
77accc1100
removed-gendered-terms 2021-03-06 03:27:38 +01:00
Henne Vogelsang
ab0ff0ff03
Merge pull request #2698 from openSUSE/depfu/update/omniauth-1.9.1
Update omniauth: 1.9.0 → 1.9.1 (patch)
2021-03-06 03:22:51 +01:00