Skip to content

Commit

Permalink
Upgrade Decidim to v0.27 (#490)
Browse files Browse the repository at this point in the history
* Upgrade Decidim and Ruby

* Webpacker install

* Update secrets.yml and decidim config

* Update some external modules

* Compile webpacker

* decidim-home: update Gemfile.lock

* Review app decorators

* Changes in overrided login views

* Update assemblies locales

* Update decidim-home and decidim-type modules

* Update decidim-top_comments module

* Update decidim-recaptcha module

* Update decidim-process-extended module

* Update decidim-regulations module

* Update HOW TO UPGRADE

* Upgrade decidim-verifications-members_picker with temporal branch

* Upgrade Ruby version in GH workflow

* Add department admin v027 and fix duplicated description

* Add chromedriver workaround

* Refactor decorator

* Upgrade to Decidim v0.27.7

* Refactor decorators and add missing field in form

* Fix process extended tests

* Rubocopify

* Fix main tests

* WIP

* Rework decorators

* Remove decidim-type and decidim-admin-extended modules

* Rework types filter

* Remove require

* Add migration to move types and fix filter

* Fix tests

* Update to Decidim 0.27.8

* Fix tests

* Add capybara screenshots

* Changes in test

* Change gems versions

* Bump versions and fix overrides

* Recover decidim type model for migration

* Comment types decorators

* Rubocopify

* Remove decidim_type model

* Set department admin correct gem tag

* Fix department admin decorator error

* Upgrade department admin

* Fix decorators in lib folder

* Set department admin correct gem tag

* Fix mailer sender

* Fix filter in regulations

* Fix filter by type

* Add migration to change types in processes

* Fix export PDFs because wicked_pdf version

* Rubocopify

* Fix tests

* Changes in migration

* Fix timezone

* Add missing translation in upload file

* Fix import process and bump main Decidim to 0.27.9

* Upgrade all to Decidim 0.27.9

* Rubocopify

* Fix tests

* Add validate migrations to CI

* Refactor process serializers

* Change Ruby version in validate migrations

* Fix tests

* Jointly notify the import of proposals and answers

* Add modifications on code according to review suggestions

* Modify decorators to updated version of zeitwek

* Refactor importer decorator spec to avoid rubocop issue stub methods

* Add schema update

* Refactor decorators to avoid rubocop issue stub methods

* Fix validate migrations CI

* Add missing migrations

* Unify syntax for proposal_creator_decorator_spec

* Modify mailer sender default

* Modifying mailer to on answers importer

* Remove publish for every proposal import process

* Add reminders task to schedule

* Upgrade decidim-cdtb

* Fix JS compilation

---------

Co-authored-by: Oliver Valls <[email protected]>
Co-authored-by: Ivan <[email protected]>
  • Loading branch information
3 people authored Oct 21, 2024
1 parent 454a2ef commit 413e305
Show file tree
Hide file tree
Showing 451 changed files with 173,515 additions and 32,486 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

env:
RUBY_VERSION: 2.7.5
RUBY_VERSION: 3.0.7

jobs:
test-report:
Expand Down Expand Up @@ -37,6 +37,23 @@ jobs:
- name: Set bundle local config configvendor/bundle path
run: bundle config set --local path 'vendor/bundle'

# chromedriver workaround
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: 119.0.6045.105

- name: List Chrome
shell: "bash"
run: apt list --installed | grep chrome

- name: Remove Chrome
shell: "bash"
run: sudo apt remove google-chrome-stable

- uses: browser-actions/setup-chrome@v1
with:
chrome-version: 119.0.6045.105

- name: Install Ruby deps
uses: nick-invision/retry@v2
with:
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/test-process_extended.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

env:
RUBY_VERSION: 2.7.5
RUBY_VERSION: 3.0.7

jobs:
test-report:
Expand Down Expand Up @@ -52,6 +52,23 @@ jobs:
- name: Set bundle local config configvendor/bundle path
run: bundle config set --local path 'vendor/bundle'

# chromedriver workaround
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: 119.0.6045.105

- name: List Chrome
shell: "bash"
run: apt list --installed | grep chrome

- name: Remove Chrome
shell: "bash"
run: sudo apt remove google-chrome-stable

- uses: browser-actions/setup-chrome@v1
with:
chrome-version: 119.0.6045.105

- name: Install Ruby deps
uses: nick-invision/retry@v2
with:
Expand All @@ -65,7 +82,6 @@ jobs:
cd decidim-process-extended
bundle exec rake decidim:generate_external_test_app
cd spec/decidim_dummy_app/
bundle exec rake decidim_type:install:migrations
bundle exec rake decidim_process_extended:install:migrations
RAILS_ENV=test bundle exec rails db:migrate
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/test-recaptcha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

env:
RUBY_VERSION: 2.7.5
RUBY_VERSION: 3.0.7

jobs:
test-report:
Expand Down Expand Up @@ -52,6 +52,23 @@ jobs:
- name: Set bundle local config configvendor/bundle path
run: bundle config set --local path 'vendor/bundle'

# chromedriver workaround
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: 119.0.6045.105

- name: List Chrome
shell: "bash"
run: apt list --installed | grep chrome

- name: Remove Chrome
shell: "bash"
run: sudo apt remove google-chrome-stable

- uses: browser-actions/setup-chrome@v1
with:
chrome-version: 119.0.6045.105

- name: Install Ruby deps
uses: nick-invision/retry@v2
with:
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/test-top_comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

env:
RUBY_VERSION: 2.7.5
RUBY_VERSION: 3.0.7

jobs:
test-report:
Expand Down Expand Up @@ -52,6 +52,23 @@ jobs:
- name: Set bundle local config configvendor/bundle path
run: bundle config set --local path 'vendor/bundle'

# chromedriver workaround
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: 119.0.6045.105

- name: List Chrome
shell: "bash"
run: apt list --installed | grep chrome

- name: Remove Chrome
shell: "bash"
run: sudo apt remove google-chrome-stable

- uses: browser-actions/setup-chrome@v1
with:
chrome-version: 119.0.6045.105

- name: Install Ruby deps
uses: nick-invision/retry@v2
with:
Expand Down
32 changes: 31 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:

env:
RUBY_VERSION: 2.7.5
RUBY_VERSION: 3.0.7
NODE_VERSION: 16.9.1

jobs:
Expand Down Expand Up @@ -62,6 +62,23 @@ jobs:
- name: Set bundle local config configvendor/bundle path
run: bundle config set --local path 'vendor/bundle'

# chromedriver workaround
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: 119.0.6045.105

- name: List Chrome
shell: "bash"
run: apt list --installed | grep chrome

- name: Remove Chrome
shell: "bash"
run: sudo apt remove google-chrome-stable

- uses: browser-actions/setup-chrome@v1
with:
chrome-version: 119.0.6045.105

- name: Install Ruby deps
uses: nick-invision/retry@v2
with:
Expand All @@ -82,3 +99,16 @@ jobs:
max_attempts: 3
retry_on: error
command: CI=1 RAILS_ENV=test bundle exec rspec --backtrace

# Prepare screenshots for upload
- name: Prepare screenshots for upload
run: RAILS_ENV=test bundle exec rails ci:screenshots:rename
if: always()

# Upload screenshots artifact
- name: Upload screenshots
uses: actions/upload-artifact@v3
if: always()
with:
name: screenshot_artifact
path: /home/runner/work/participa/participa/tmp/screenshots/
67 changes: 67 additions & 0 deletions .github/workflows/validate_migrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "[CI] Validate migrations"

on:
push:
branches:
- master
- release/*
- "*-stable"
pull_request:

env:
DB_DATABASE: app
DB_USERNAME: postgres
DB_PASSWORD: postgres
RUBY_VERSION: 3.0.7

jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
env:
DB_DATABASE: app
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_HOST: localhost
SECRET_KEY_BASE: "secret_key_base"

steps:
- uses: actions/[email protected]
with:
fetch-depth: 1
- uses: ruby/setup-ruby@master
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
- name: Recover Ruby dependency cache
uses: actions/cache@v1
with:
path: ./vendor/bundle
key: ${{ runner.OS }}-app-rubydeps-${{ hashFiles('Gemfile.lock') }}
restore-keys: |
${{ runner.OS }}-app-rubydeps-${{ env.cache-name }}-
${{ runner.OS }}-app-rubydeps-
- name: Set bundle local config vendor/bundle path
run: bundle config set --local path 'vendor/bundle'

- name: Install Ruby deps
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
retry_on: error
command: bundle install --jobs 4 --retry 3

- name: Run specs
run: bin/rails cdtb:upgrades:validate_migrations
17 changes: 9 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
!/log/.keep
!/tmp/.keep

/node_modules
node_modules/

yarn.lock
/yarn-error.log
yarn-debug.log*
.yarn-integrity

.byebug_history

Expand All @@ -29,6 +31,12 @@ public/uploads
# Ignore public/assets as assets are generated in each server when deploying
public/assets

/public/packs
/public/packs-test
public/decidim-packs/
public/sw.js.*
public/sw.js

# Ignore test app
spec/decidim_dummy_app/
.rspec-failures
Expand All @@ -39,10 +47,3 @@ spec/decidim_dummy_app/

coverage/
storage/

/public/packs
/public/packs-test
public/decidim-packs/

yarn-debug.log*
.yarn-integrity
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.5
3.0.7
24 changes: 15 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,27 @@
source "https://rubygems.org"

ruby RUBY_VERSION
DECIDIM_VERSION = { git: "https://github.com/CodiTramuntana/decidim", branch: "release/0.26-stable" }.freeze
DECIDIM_VERSION = { git: "https://github.com/CodiTramuntana/decidim", branch: "release/0.27-stable" }.freeze

gem "decidim", DECIDIM_VERSION
gem "decidim-templates", DECIDIM_VERSION

#### Custom gems and modifications block start ####
gem "decidim-admin-extended", path: "decidim-admin-extended"
gem "decidim-home", path: "decidim-home"
gem "decidim-process-extended", path: "decidim-process-extended"
gem "decidim-recaptcha", path: "decidim-recaptcha"
gem "decidim-regulations", path: "decidim-regulations"
gem "decidim-top_comments", path: "decidim-top_comments"
gem "decidim-type", path: "decidim-type"

gem "decidim-cdtb", git: "https://github.com/CodiTramuntana/decidim-module-cdtb.git", branch: "main"
gem "decidim-challenges", git: "https://github.com/gencat/decidim-module-challenges.git", tag: "v0.2.0"
gem "decidim-department_admin", git: "https://github.com/gencat/decidim-module-department_admin.git", tag: "v6.0.0"
gem "decidim-idcat_mobil", "~> 0.3.0"
gem "decidim-term_customizer", git: "https://github.com/mainio/decidim-module-term_customizer.git", branch: "release/0.26-stable"
gem "decidim-cdtb"
gem "decidim-challenges", git: "https://github.com/gencat/decidim-module-challenges.git", tag: "v0.3.3"
gem "decidim-department_admin", git: "https://github.com/gencat/decidim-module-department_admin.git", tag: "v0.7.1"
gem "decidim-idcat_mobil"
gem "decidim-term_customizer", git: "https://github.com/mainio/decidim-module-term_customizer.git", branch: "release/0.27-stable"

gem "decidim-verifications-members_picker", git: "https://github.com/gencat/decidim-verifications-members_picker.git", tag: "0.0.6"
#### Custom gems and modifications block end ####

gem "decidim-verifications-members_picker", git: "https://github.com/gencat/decidim-verifications-members_picker.git", tag: "0.0.4"
gem "soda-ruby", require: false

gem "puma"
Expand All @@ -39,6 +38,12 @@ gem "whenever", require: false

gem "recaptcha"

# Error uninitialized constant WickedPdf::WickedPdfHelper::Assets::SprocketsEnvironment::Sprockets
# in update to 2.8.0
# https://github.com/mileszs/wicked_pdf/issues/1102

gem "wicked_pdf", "~> 2.7.0"

group :development, :test do
gem "bootsnap"
gem "byebug", platform: :mri
Expand All @@ -57,5 +62,6 @@ group :development do
end

group :test do
gem "capybara-screenshot"
gem "database_cleaner"
end
Loading

0 comments on commit 413e305

Please sign in to comment.