From 95320f3b10a68734ba738a4ae0b2b11d913d0257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Bol=C3=ADvar?= Date: Wed, 23 Oct 2024 12:01:33 +0200 Subject: [PATCH] Fix workflows, adapt changes of overridden files, bump version of some dependencies, and uninstall `decidim-valid_auth` module (#564) * Fix CI * Fix overrides * Remove badge of unused module * Upload screenshots * Change Gemfile * Fix rubocop versions * Bump decidim-decidim_awesome * Change decidim branch * Bump decidim version * Fix tests related to valid_auth module * Ignore file for codeclimate * Disable valid_auth module --- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 9 +- .github/workflows/test_census_sms.yml | 9 +- .github/workflows/test_stats.yml | 9 +- .github/workflows/test_valid_auth.yml | 49 ----- Gemfile | 8 +- Gemfile.lock | 192 +++++++++--------- README.md | 2 - .../results/_scope_filters.html.erb | 4 +- config/initializers/decidim.rb | 2 + config/initializers/decidim_overrides.rb | 6 - config/secrets.yml | 2 + spec/lib/overrides_spec.rb | 7 +- 13 files changed, 131 insertions(+), 170 deletions(-) delete mode 100644 .github/workflows/test_valid_auth.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3608c94c9..a276d8c02 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,7 +8,7 @@ env: jobs: lint: name: Lint code - runs-on: ubuntu:22.04 + runs-on: ubuntu-22.04 env: DATABASE_USERNAME: postgres DATABASE_PASSWORD: postgres diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a216af1a..66c106dea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ env: jobs: test: name: Test - runs-on: ubuntu:22.04 + runs-on: ubuntu-22.04 services: postgres: image: postgres:11 @@ -47,3 +47,10 @@ jobs: mkdir node_modules bundle exec rspec name: Run specs + - uses: actions/upload-artifact@v4 + if: always() + with: + name: screenshots + path: ./tmp/screenshots + if-no-files-found: ignore + overwrite: true diff --git a/.github/workflows/test_census_sms.yml b/.github/workflows/test_census_sms.yml index 3156d4f79..84332e458 100644 --- a/.github/workflows/test_census_sms.yml +++ b/.github/workflows/test_census_sms.yml @@ -8,7 +8,7 @@ env: jobs: test: name: Test Census SMS - runs-on: ubuntu:22-04 + runs-on: ubuntu-22.04 services: postgres: image: postgres:11 @@ -47,3 +47,10 @@ jobs: mkdir node_modules bundle exec rspec decidim-census_sms name: Run specs + - uses: actions/upload-artifact@v4 + if: always() + with: + name: screenshots + path: ./tmp/screenshots + if-no-files-found: ignore + overwrite: true diff --git a/.github/workflows/test_stats.yml b/.github/workflows/test_stats.yml index fe33e7c72..e53d2e195 100644 --- a/.github/workflows/test_stats.yml +++ b/.github/workflows/test_stats.yml @@ -8,7 +8,7 @@ env: jobs: test: name: Test Stats - runs-on: ubuntu:22.04 + runs-on: ubuntu-22.04 services: postgres: image: postgres:11 @@ -47,3 +47,10 @@ jobs: mkdir node_modules bundle exec rspec decidim-stats name: Run specs + - uses: actions/upload-artifact@v4 + if: always() + with: + name: screenshots + path: ./tmp/screenshots + if-no-files-found: ignore + overwrite: true diff --git a/.github/workflows/test_valid_auth.yml b/.github/workflows/test_valid_auth.yml deleted file mode 100644 index b47187070..000000000 --- a/.github/workflows/test_valid_auth.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Test Valid Auth -on: [push] - -env: - RUBY_VERSION: 3.1.1 - NODE_VERSION: 18.17.1 - -jobs: - test: - name: Test Valid Auth - runs-on: ubuntu:22-04 - 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 - redis: - image: redis:3.2-alpine - ports: ["6379:6379"] - env: - DATABASE_USERNAME: postgres - DATABASE_PASSWORD: postgres - DATABASE_HOST: localhost - RAILS_ENV: test - steps: - - uses: actions/checkout@v2.0.0 - with: - fetch-depth: 1 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ env.RUBY_VERSION }} - bundler-cache: true - - uses: nanasess/setup-chromedriver@v2 - - run: bundle exec rake db:test:prepare - name: Setup database - - name: Precompile assets - run: | - npm install - bundle exec rake assets:precompile - - run: | - mkdir node_modules - bundle exec rspec decidim-valid_auth - name: Run specs diff --git a/Gemfile b/Gemfile index b518f8f55..c23cc5a58 100644 --- a/Gemfile +++ b/Gemfile @@ -2,14 +2,12 @@ source "https://rubygems.org" -DECIDIM_VERSION = "0.28.4" +DECIDIM_VERSION = { git: "https://github.com/AjuntamentdeBarcelona/decidim", branch: "release/0.28-stable-bcn" }.freeze ruby RUBY_VERSION -# gem "decidim", DECIDIM_VERSION -gem "decidim", github: "ajuntamentdeBarcelona/decidim", branch: "bcn/0.28-branch" +gem "decidim", DECIDIM_VERSION gem "decidim-initiatives", DECIDIM_VERSION -gem "decidim-internal_evaluation", github: "AjuntamentdeBarcelona/decidim-internal-evaluation-module", branch: "release/0.28-stable" gem "decidim-sortitions", DECIDIM_VERSION gem "decidim-templates", DECIDIM_VERSION @@ -17,9 +15,9 @@ gem "decidim-census_sms", path: "decidim-census_sms" gem "decidim-dataviz", path: "decidim-dataviz" gem "decidim-ephemeral_participation", path: "decidim-ephemeral_participation" # Installed but not used anymore gem "decidim-stats", path: "decidim-stats" -gem "decidim-valid_auth", path: "decidim-valid_auth" gem "decidim-decidim_awesome", git: "https://github.com/decidim-ice/decidim-module-decidim_awesome" +gem "decidim-internal_evaluation", git: "https://github.com/AjuntamentdeBarcelona/decidim-internal-evaluation-module", branch: "release/0.28-stable" gem "decidim-kids", git: "https://github.com/AjuntamentdeBarcelona/decidim-module-kids" gem "decidim-navigation_maps", git: "https://github.com/Platoniq/decidim-module-navigation_maps" gem "decidim-term_customizer", git: "https://github.com/mainio/decidim-module-term_customizer" diff --git a/Gemfile.lock b/Gemfile.lock index 0136fecf8..d2d6bb368 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,36 +1,7 @@ GIT - remote: https://github.com/AjuntamentdeBarcelona/decidim-internal-evaluation-module.git - revision: cf5eb7f00f957881ade8360a69655e92d95ceff0 - branch: release/0.28-stable - specs: - decidim-internal_evaluation (0.0.1) - decidim-core (~> 0.28.0) - decidim-proposals (~> 0.28.0) - decidim-templates (~> 0.28.0) - deface (~> 1.9) - -GIT - remote: https://github.com/AjuntamentdeBarcelona/decidim-module-kids - revision: df16cf4de13c306348761d850d19815c8221874e - specs: - decidim-kids (0.2.0) - decidim-core (>= 0.28, < 0.29) - decidim-system (>= 0.28, < 0.29) - decidim-verifications (>= 0.28, < 0.29) - deface (>= 1.5) - -GIT - remote: https://github.com/Platoniq/decidim-module-navigation_maps - revision: 7fd50e1368bae4c7955c0ba8ec5ee395273a5329 - specs: - decidim-navigation_maps (1.5.0) - decidim-admin (>= 0.28, < 0.29) - decidim-core (>= 0.28, < 0.29) - -GIT - remote: https://github.com/ajuntamentdeBarcelona/decidim.git - revision: 9c78c1c36bb6c44a855c02acd6f58c70345853c4 - branch: bcn/0.28-branch + remote: https://github.com/AjuntamentdeBarcelona/decidim + revision: 6e50c98a52907d8e830301d8e2a02c27ec5246c6 + branch: release/0.28-stable-bcn specs: decidim (0.28.4) decidim-accountability (= 0.28.4) @@ -131,12 +102,51 @@ GIT decidim-debates (0.28.4) decidim-comments (= 0.28.4) decidim-core (= 0.28.4) + decidim-dev (0.28.4) + bullet (~> 7.0) + byebug (~> 11.0) + capybara (~> 3.39) + decidim (= 0.28.4) + erb_lint (~> 0.4.0) + factory_bot_rails (~> 6.2) + faker (~> 3.2) + i18n-tasks (~> 1.0) + nokogiri (~> 1.14, >= 1.14.3) + parallel_tests (~> 4.2) + puma (~> 6.2, >= 6.3.1) + rails-controller-testing (~> 1.0) + rspec (~> 3.12) + rspec-cells (~> 0.3.7) + rspec-html-matchers (~> 0.10) + rspec-rails (~> 6.0) + rspec-retry (~> 0.6.2) + rspec_junit_formatter (~> 0.6.0) + rubocop (~> 1.50.0) + rubocop-faker (~> 1.1) + rubocop-rails (~> 2.19) + rubocop-rspec (~> 2.20) + selenium-webdriver (~> 4.9) + simplecov (~> 0.22.0) + simplecov-cobertura (~> 2.1.0) + spring (~> 2.0) + spring-watcher-listen (~> 2.0) + w3c_rspec_validators (~> 0.3.0) + webmock (~> 3.18) + wisper-rspec (~> 1.0) decidim-forms (0.28.4) decidim-core (= 0.28.4) wicked_pdf (~> 2.1) wkhtmltopdf-binary (~> 0.12) decidim-generators (0.28.4) decidim-core (= 0.28.4) + decidim-initiatives (0.28.4) + decidim-admin (= 0.28.4) + decidim-comments (= 0.28.4) + decidim-core (= 0.28.4) + decidim-verifications (= 0.28.4) + hexapdf (~> 0.32.0) + wicked_pdf (~> 2.1) + wkhtmltopdf-binary (~> 0.12) decidim-meetings (0.28.4) decidim-core (= 0.28.4) decidim-forms (= 0.28.4) @@ -150,6 +160,11 @@ GIT decidim-core (= 0.28.4) doc2text (~> 0.4.6) redcarpet (~> 3.5, >= 3.5.1) + decidim-sortitions (0.28.4) + decidim-admin (= 0.28.4) + decidim-comments (= 0.28.4) + decidim-core (= 0.28.4) + decidim-proposals (= 0.28.4) decidim-surveys (0.28.4) decidim-core (= 0.28.4) decidim-forms (= 0.28.4) @@ -159,12 +174,45 @@ GIT devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 2.0, >= 2.0.9) + decidim-templates (0.28.4) + decidim-core (= 0.28.4) + decidim-forms (= 0.28.4) + decidim-proposals (= 0.28.4) decidim-verifications (0.28.4) decidim-core (= 0.28.4) +GIT + remote: https://github.com/AjuntamentdeBarcelona/decidim-internal-evaluation-module + revision: cf5eb7f00f957881ade8360a69655e92d95ceff0 + branch: release/0.28-stable + specs: + decidim-internal_evaluation (0.0.1) + decidim-core (~> 0.28.0) + decidim-proposals (~> 0.28.0) + decidim-templates (~> 0.28.0) + deface (~> 1.9) + +GIT + remote: https://github.com/AjuntamentdeBarcelona/decidim-module-kids + revision: df16cf4de13c306348761d850d19815c8221874e + specs: + decidim-kids (0.2.0) + decidim-core (>= 0.28, < 0.29) + decidim-system (>= 0.28, < 0.29) + decidim-verifications (>= 0.28, < 0.29) + deface (>= 1.5) + +GIT + remote: https://github.com/Platoniq/decidim-module-navigation_maps + revision: 7fd50e1368bae4c7955c0ba8ec5ee395273a5329 + specs: + decidim-navigation_maps (1.5.0) + decidim-admin (>= 0.28, < 0.29) + decidim-core (>= 0.28, < 0.29) + GIT remote: https://github.com/decidim-ice/decidim-module-decidim_awesome - revision: 84374037d34a3ac80dc18406834169c65869f11b + revision: a8d21e4e178f1965a6e3e73cf0c781cb78661e32 specs: decidim-decidim_awesome (0.11.2) decidim-admin (>= 0.28.0, < 0.29) @@ -206,12 +254,6 @@ PATH decidim-core (~> 0.28.0) decidim-proposals (~> 0.28.0) -PATH - remote: decidim-valid_auth - specs: - decidim-valid_auth (0.0.3) - decidim-verifications (~> 0.28.0) - GEM remote: https://rubygems.org/ specs: @@ -379,54 +421,6 @@ GEM date_validator (0.12.0) activemodel (>= 3) activesupport (>= 3) - decidim-dev (0.28.4) - bullet (~> 7.0) - byebug (~> 11.0) - capybara (~> 3.39) - decidim (= 0.28.4) - erb_lint (~> 0.4.0) - factory_bot_rails (~> 6.2) - faker (~> 3.2) - i18n-tasks (~> 1.0) - nokogiri (~> 1.14, >= 1.14.3) - parallel_tests (~> 4.2) - puma (~> 6.2, >= 6.3.1) - rails-controller-testing (~> 1.0) - rspec (~> 3.12) - rspec-cells (~> 0.3.7) - rspec-html-matchers (~> 0.10) - rspec-rails (~> 6.0) - rspec-retry (~> 0.6.2) - rspec_junit_formatter (~> 0.6.0) - rubocop (~> 1.50.0) - rubocop-faker (~> 1.1) - rubocop-rails (~> 2.19) - rubocop-rspec (~> 2.20) - selenium-webdriver (~> 4.9) - simplecov (~> 0.22.0) - simplecov-cobertura (~> 2.1.0) - spring (~> 2.0) - spring-watcher-listen (~> 2.0) - w3c_rspec_validators (~> 0.3.0) - webmock (~> 3.18) - wisper-rspec (~> 1.0) - decidim-initiatives (0.28.4) - decidim-admin (= 0.28.4) - decidim-comments (= 0.28.4) - decidim-core (= 0.28.4) - decidim-verifications (= 0.28.4) - hexapdf (~> 0.32.0) - wicked_pdf (~> 2.1) - wkhtmltopdf-binary (~> 0.12) - decidim-sortitions (0.28.4) - decidim-admin (= 0.28.4) - decidim-comments (= 0.28.4) - decidim-core (= 0.28.4) - decidim-proposals (= 0.28.4) - decidim-templates (0.28.4) - decidim-core (= 0.28.4) - decidim-forms (= 0.28.4) - decidim-proposals (= 0.28.4) declarative-builder (0.1.0) declarative-option (< 0.2.0) declarative-option (0.1.0) @@ -839,21 +833,24 @@ GEM rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) - parser (>= 3.3.1.0) - rubocop-capybara (2.21.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.25.1) rubocop (~> 1.41) rubocop-faker (1.1.0) faker (>= 2.12.0) rubocop (>= 0.82.0) - rubocop-rails (2.25.1) + rubocop-rails (2.24.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (2.20.0) - rubocop (~> 1.33) + rubocop-rspec (2.27.1) + rubocop (~> 1.40) rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) ruby-progressbar (1.13.0) ruby-vips (2.2.2) ffi (~> 1.12) @@ -994,17 +991,16 @@ DEPENDENCIES decidim-census_sms! decidim-dataviz! decidim-decidim_awesome! - decidim-dev (= 0.28.4) + decidim-dev! decidim-ephemeral_participation! - decidim-initiatives (= 0.28.4) + decidim-initiatives! decidim-internal_evaluation! decidim-kids! decidim-navigation_maps! - decidim-sortitions (= 0.28.4) + decidim-sortitions! decidim-stats! - decidim-templates (= 0.28.4) + decidim-templates! decidim-term_customizer! - decidim-valid_auth! dotenv-rails faker foreman diff --git a/README.md b/README.md index e0f0df906..f7f1ce826 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,7 @@ Citizen Participation and Open Government Application. [![[CI] Lint](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/lint.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/lint.yml) [![[CI] Test](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test.yml) [![[CI] Test Census SMS](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_census_sms.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_census_sms.yml) -[![[CI] Test Ephemeral Participation](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_ephemeral_participation.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_ephemeral_participation.yml) [![[CI] Test Stats](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_stats.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_stats.yml) -[![[CI] Test Valid Auth](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_valid_auth.yml/badge.svg)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/actions/workflows/test_valid_auth.yml) [![Code Climate](https://codeclimate.com/github/AjuntamentdeBarcelona/decidim-barcelona/badges/gpa.svg)](https://codeclimate.com/github/AjuntamentdeBarcelona/decidim-barcelona) This is the opensource code repository for "decidim-barcelona", based on [Decidim](https://github.com/AjuntamentdeBarcelona/decidim). diff --git a/app/views/decidim/accountability/results/_scope_filters.html.erb b/app/views/decidim/accountability/results/_scope_filters.html.erb index 7c648c9d6..8a1002278 100644 --- a/app/views/decidim/accountability/results/_scope_filters.html.erb +++ b/app/views/decidim/accountability/results/_scope_filters.html.erb @@ -5,7 +5,7 @@ <% if current_component.has_subscopes? && !hide_subscopes %>
-