diff --git a/.babelrc b/.babelrc index 82c38bec1caf9..a2893f35e5214 100644 --- a/.babelrc +++ b/.babelrc @@ -1,17 +1,6 @@ +// This file is required by jest (otherwise, it doesn't transpile the test files) { - "presets": [ - "env", - "airbnb", - "react", - "stage-2" - ], - "plugins": ["transform-decorators-legacy"], - "env": { - "test": { - "plugins": [ - ["__coverage__", {"ignore": "*.+(test|stub).*"}], - "transform-es2015-modules-commonjs" - ] - } - } + "presets": [ + "@babel/preset-env" + ] } diff --git a/.codeclimate.yml b/.codeclimate.yml index 745a6e3f6715f..46634fab079ff 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -115,7 +115,14 @@ plugins: severity: minor stylelint: - enabled: true + # FIXME: after the webpacker packages changes, this is broken with this error: + # + # > Error: Could not find "@decidim/stylelint-config". Do you need a `configBasedir`? + # > See our documentation at https://docs.codeclimate.com/docs/stylelint for more information. + # + # Disabling it for the moment, we should enable it as it's useful. + # + enabled: false exclude_patterns: - "decidim-admin/app/assets/stylesheets/decidim/admin/bundle.scss" - "decidim-core/app/assets/stylesheets/decidim/email.css" diff --git a/.decidim-version b/.decidim-version index 63082344eb335..166c9e29b70b1 100644 --- a/.decidim-version +++ b/.decidim-version @@ -1 +1 @@ -0.24.3 +0.25.2 diff --git a/.eslintrc.json b/.eslintrc.json index 2bff9292423da..08de8c7f32172 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,278 +1,3 @@ { - "env": { - "browser": true, - "es6": true - }, - "extends": ["eslint:recommended", "plugin:react/recommended"], - "parser": "babel-eslint", - "parserOptions": { - "ecmaFeatures": { - "experimentalObjectRestSpread": true, - "jsx": true - }, - "sourceType": "module" - }, - "plugins": [ - "react" - ], - "globals": { - "$": false, - "jQuery": false, - "React": false, - "ReactDOM": false, - "describe": false, - "it": false, - "expect": false, - "beforeEach": false, - "afterEach": false, - "sinon": false, - "GraphQLDocs": false, - "Quill": false, - "SVGInjector": false, - "require": false, - "DecidimAdmin": false, - "L": false, - "decidimBulletinBoard": false - }, - "rules": { - "accessor-pairs": "error", - "array-bracket-spacing": "error", - "array-callback-return": "error", - "arrow-body-style": "off", - "arrow-parens": [ - "error", - "always" - ], - "arrow-spacing": [ - "error", - { - "after": true, - "before": true - } - ], - "block-scoped-var": "error", - "block-spacing": "off", - "callback-return": "error", - "camelcase": "error", - "class-methods-use-this": "off", - "comma-dangle": ["error", "never"], - "comma-spacing": [ - "error", - { - "after": true, - "before": false - } - ], - "comma-style": [ - "error", - "last" - ], - "complexity": "error", - "computed-property-spacing": [ - "error", - "never" - ], - "consistent-return": "error", - "consistent-this": "error", - "curly": "error", - "default-case": "error", - "dot-location": "error", - "dot-notation": "error", - "eol-last": "error", - "eqeqeq": "error", - "func-call-spacing": "error", - "func-name-matching": "error", - "func-names": [ - "error", - "never" - ], - "func-style": "error", - "generator-star-spacing": "error", - "global-require": "error", - "guard-for-in": "error", - "handle-callback-err": "error", - "id-blacklist": "error", - "id-length": "error", - "id-match": "error", - "indent": ["error", 2, { "VariableDeclarator": 2 }], - "init-declarations": "error", - "jsx-quotes": "error", - "key-spacing": "error", - "keyword-spacing": [ - "error", - { - "after": true, - "before": true - } - ], - "line-comment-position": "error", - "linebreak-style": [ - "error", - "unix" - ], - "lines-around-comment": "error", - "lines-around-directive": "error", - "max-depth": "error", - "max-len": "off", - "max-lines": "error", - "max-nested-callbacks": "error", - "max-params": "error", - "max-statements": "off", - "max-statements-per-line": "error", - "multiline-ternary": "error", - "new-cap": "error", - "new-parens": "error", - "newline-after-var": "off", - "newline-before-return": "off", - "newline-per-chained-call": "off", - "no-alert": "error", - "no-array-constructor": "error", - "no-bitwise": "error", - "no-caller": "error", - "no-catch-shadow": "error", - "no-confusing-arrow": "error", - "no-continue": "error", - "no-div-regex": "error", - "no-duplicate-imports": "error", - "no-else-return": "error", - "no-eq-null": "error", - "no-eval": "error", - "no-extend-native": "error", - "no-extra-bind": "error", - "no-extra-label": "error", - "no-extra-parens": "off", - "no-floating-decimal": "error", - "no-implicit-coercion": "error", - "no-implicit-globals": "error", - "no-implied-eval": "error", - "no-inline-comments": "error", - "no-invalid-this": "error", - "no-iterator": "error", - "no-label-var": "error", - "no-labels": "error", - "no-lone-blocks": "error", - "no-lonely-if": "error", - "no-loop-func": "error", - "no-magic-numbers": "off", - "no-mixed-operators": "error", - "no-mixed-requires": "error", - "no-multi-spaces": "off", - "no-multi-str": "error", - "no-multiple-empty-lines": "error", - "no-native-reassign": "error", - "no-negated-condition": "error", - "no-negated-in-lhs": "error", - "no-nested-ternary": "error", - "no-new": "error", - "no-new-func": "error", - "no-new-object": "error", - "no-new-require": "error", - "no-new-wrappers": "error", - "no-octal-escape": "error", - "no-param-reassign": "error", - "no-path-concat": "error", - "no-plusplus": "error", - "no-process-env": "error", - "no-process-exit": "error", - "no-proto": "error", - "no-prototype-builtins": "error", - "no-restricted-globals": "error", - "no-restricted-imports": "error", - "no-restricted-modules": "error", - "no-restricted-properties": "error", - "no-restricted-syntax": "error", - "no-return-assign": "error", - "no-script-url": "error", - "no-self-compare": "error", - "no-sequences": "error", - "no-shadow": "error", - "no-shadow-restricted-names": "error", - "no-spaced-func": "error", - "no-sync": "error", - "no-tabs": "error", - "no-template-curly-in-string": "error", - "no-ternary": "error", - "no-throw-literal": "error", - "no-trailing-spaces": "off", - "no-undef-init": "error", - "no-undefined": "error", - "no-underscore-dangle": "off", - "no-unmodified-loop-condition": "error", - "no-unneeded-ternary": "error", - "no-unused-expressions": "error", - "no-use-before-define": "error", - "no-useless-call": "error", - "no-useless-computed-key": "error", - "no-useless-concat": "error", - "no-useless-constructor": "error", - "no-useless-escape": "error", - "no-useless-rename": "error", - "no-var": "error", - "no-void": "error", - "no-warning-comments": "error", - "no-whitespace-before-property": "error", - "no-with": "error", - "object-curly-newline": "off", - "object-curly-spacing": "off", - "object-property-newline": [ - "error", - { - "allowMultiplePropertiesPerLine": true - } - ], - "object-shorthand": "off", - "one-var": "off", - "one-var-declaration-per-line": "error", - "operator-assignment": "error", - "operator-linebreak": "error", - "padded-blocks": "off", - "prefer-arrow-callback": "off", - "prefer-const": "off", - "prefer-numeric-literals": "error", - "prefer-reflect": "error", - "prefer-rest-params": "error", - "prefer-spread": "error", - "prefer-template": "error", - "quote-props": "off", - "quotes": ["error", "double", { "avoidEscape": true }], - "radix": "error", - "require-jsdoc": "error", - "rest-spread-spacing": "error", - "semi": "off", - "semi-spacing": "error", - "sort-imports": "off", - "sort-keys": "off", - "sort-vars": "error", - "space-before-blocks": "error", - "space-before-function-paren": "off", - "space-in-parens": [ - "error", - "never" - ], - "space-infix-ops": "error", - "space-unary-ops": "error", - "spaced-comment": [ - "error", - "always" - ], - "strict": "error", - "symbol-description": "error", - "template-curly-spacing": "error", - "unicode-bom": [ - "error", - "never" - ], - "valid-jsdoc": "error", - "vars-on-top": "error", - "wrap-iife": "error", - "wrap-regex": "error", - "yield-star-spacing": "error", - "yoda": "error", - "import/no-named-as-default": "off", - "import/no-extraneous-dependencies": "off", - "react/prefer-stateless-function": "off", - "react/jsx-filename-extension": "off", - "react/no-multi-comp": "off", - "react/sort-comp": "off" - } + "extends": "@decidim" } diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 554b2bec5b5db..61cbbccb130c3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -10,7 +10,7 @@ *Describe the best way to test or validate your PR.* #### :clipboard: Checklist -:rotating_light: Please review the [guidelines for contributing](../CONTRIBUTING.adoc) to this repository. +:rotating_light: Please review the [guidelines for contributing](https://github.com/decidim/decidim/blob/develop/CONTRIBUTING.adoc) to this repository. - [ ] :question: **CONSIDER** adding a unit test if your PR resolves an issue. - [ ] :heavy_check_mark: **DO** check open PR's to avoid duplicates. diff --git a/.github/upload_coverage.sh b/.github/upload_coverage.sh index 7624a57ee6686..287c9f82571a2 100755 --- a/.github/upload_coverage.sh +++ b/.github/upload_coverage.sh @@ -8,7 +8,7 @@ SHA=`jq -r ".pull_request.head.sha // .check_run.head_sha // .after" $EVENT_PAYL if [ $PRID = "null" ] then - bash <(curl -s https://codecov.io/bash) -n $REPORT_NAME -C $SHA + bash <(curl -s https://codecov.io/bash) -n $REPORT_NAME -C $SHA -F $REPORT_NAME else - bash <(curl -s https://codecov.io/bash) -n $REPORT_NAME -C $SHA -P $PRID + bash <(curl -s https://codecov.io/bash) -n $REPORT_NAME -C $SHA -P $PRID -F $REPORT_NAME fi diff --git a/.github/workflows/ci_accountability.yml b/.github/workflows/ci_accountability.yml index ec21d5681e526..9bfe96e837f49 100644 --- a/.github/workflows/ci_accountability.yml +++ b/.github/workflows/ci_accountability.yml @@ -8,11 +8,24 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-accountability/**" + - "decidim-admin/**" + - "decidim-assemblies/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-meetings/**" + - "decidim-participatory_processes/**" + - "decidim-proposals/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-accountability jobs: @@ -38,7 +51,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +62,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_admin.yml b/.github/workflows/ci_admin.yml index 66fbdc725bd16..ba5c69bfdc65b 100644 --- a/.github/workflows/ci_admin.yml +++ b/.github/workflows/ci_admin.yml @@ -8,11 +8,19 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-participatory_processes/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-admin jobs: @@ -38,7 +46,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +57,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_api.yml b/.github/workflows/ci_api.yml index 0c975677966a5..6585d9da5fd69 100644 --- a/.github/workflows/ci_api.yml +++ b/.github/workflows/ci_api.yml @@ -8,11 +8,20 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-api/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-participatory_processes/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-api jobs: @@ -38,7 +47,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +58,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_assemblies.yml b/.github/workflows/ci_assemblies.yml index 53739c44b577b..1ce6b01521a3c 100644 --- a/.github/workflows/ci_assemblies.yml +++ b/.github/workflows/ci_assemblies.yml @@ -8,11 +8,19 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-assemblies/**" + - "decidim-core/**" + - "decidim-dev/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-assemblies jobs: @@ -38,7 +46,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +57,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_blogs.yml b/.github/workflows/ci_blogs.yml index cb39354dae4b9..52f0576cec5a6 100644 --- a/.github/workflows/ci_blogs.yml +++ b/.github/workflows/ci_blogs.yml @@ -8,11 +8,22 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-assemblies/**" + - "decidim-blogs/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-participatory_processes/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-blogs jobs: @@ -38,7 +49,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +60,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_budgets.yml b/.github/workflows/ci_budgets.yml index fc8629f104542..e0c9925c5007d 100644 --- a/.github/workflows/ci_budgets.yml +++ b/.github/workflows/ci_budgets.yml @@ -8,11 +8,21 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-budgets/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-proposals/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-budgets jobs: @@ -38,7 +48,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +59,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_comments.yml b/.github/workflows/ci_comments.yml index ad0e587ba0d1f..685035d40a168 100644 --- a/.github/workflows/ci_comments.yml +++ b/.github/workflows/ci_comments.yml @@ -8,12 +8,19 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 - NODE_VERSION: 12.9.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-comments jobs: @@ -37,9 +44,9 @@ jobs: DATABASE_USERNAME: postgres DATABASE_PASSWORD: postgres DATABASE_HOST: localhost - RUBYOPT: '-W:no-deprecated' + RUBYOPT: "-W:no-deprecated" steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -50,18 +57,31 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true - - uses: actions/setup-node@master + - uses: actions/setup-node@v1 with: node-version: ${{ env.NODE_VERSION }} - - run: npm ci - name: Install JS deps - - run: npm run test - name: Test JS files + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- + - name: Install JS dependencies + run: npm ci - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ + - run: npm run test + name: Test JS files - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_conferences.yml b/.github/workflows/ci_conferences.yml index f3bb701ff82b2..2ff815ae716e6 100644 --- a/.github/workflows/ci_conferences.yml +++ b/.github/workflows/ci_conferences.yml @@ -8,11 +8,20 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-conferences/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-meetings/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-conferences jobs: @@ -38,7 +47,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +58,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_consultations.yml b/.github/workflows/ci_consultations.yml index d067785103956..665d42cb64892 100644 --- a/.github/workflows/ci_consultations.yml +++ b/.github/workflows/ci_consultations.yml @@ -8,11 +8,20 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-comments/**" + - "decidim-consultations/**" + - "decidim-core/**" + - "decidim-dev/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-consultations jobs: @@ -38,7 +47,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +58,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_core_system.yml b/.github/workflows/ci_core_system.yml index 63099929e5ee7..bcf088a2b6654 100644 --- a/.github/workflows/ci_core_system.yml +++ b/.github/workflows/ci_core_system.yml @@ -8,11 +8,18 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-api/**" + - "decidim-core/**" + - "decidim-dev/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-core jobs: @@ -38,7 +45,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +56,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec spec/system name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_core_unit.yml b/.github/workflows/ci_core_unit.yml index b3134840937ab..5063b1bac1346 100644 --- a/.github/workflows/ci_core_unit.yml +++ b/.github/workflows/ci_core_unit.yml @@ -8,11 +8,18 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-api/**" + - "decidim-core/**" + - "decidim-dev/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-core jobs: @@ -38,7 +45,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +56,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb' name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_debates.yml b/.github/workflows/ci_debates.yml index d3dd5e3ac4217..62b4244f6849a 100644 --- a/.github/workflows/ci_debates.yml +++ b/.github/workflows/ci_debates.yml @@ -8,11 +8,20 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-debates/**" + - "decidim-dev/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-debates jobs: @@ -38,7 +47,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +58,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_dev_system.yml b/.github/workflows/ci_dev_system.yml new file mode 100644 index 0000000000000..d27509e46fd31 --- /dev/null +++ b/.github/workflows/ci_dev_system.yml @@ -0,0 +1,89 @@ +name: "[CI] Dev (system specs)" +on: + push: + branches: + - develop + - release/* + - "*-stable" + pull_request: + branches-ignore: + - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-core/**" + - "decidim-dev/**" + +env: + CI: "true" + SIMPLECOV: "true" + RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 + DECIDIM_MODULE: decidim-dev + +jobs: + main: + name: Tests + runs-on: ubuntu-latest + if: "!startsWith(github.head_ref, 'chore/l10n')" + timeout-minutes: 60 + 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: + DATABASE_USERNAME: postgres + DATABASE_PASSWORD: postgres + DATABASE_HOST: localhost + RUBYOPT: '-W:no-deprecated' + steps: + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 + if: "github.ref != 'refs/heads/develop'" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - 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: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- + - run: bundle exec rake test_app + name: Create test app + - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots + name: Create the screenshots folder + - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ + - run: bundle exec rspec spec/system + name: RSpec + working-directory: ${{ env.DECIDIM_MODULE }} + - run: ./.github/upload_coverage.sh $DECIDIM_MODULE $GITHUB_EVENT_PATH + name: Upload coverage + - uses: actions/upload-artifact@v2 + if: always() + with: + name: screenshots + path: ./spec/decidim_dummy_app/tmp/screenshots + if-no-files-found: ignore diff --git a/.github/workflows/ci_elections_system_admin.yml b/.github/workflows/ci_elections_system_admin.yml index 8c64d77206a77..29192600dc0fc 100644 --- a/.github/workflows/ci_elections_system_admin.yml +++ b/.github/workflows/ci_elections_system_admin.yml @@ -8,11 +8,22 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-bulletin_board/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-elections/**" + - "decidim-forms/**" + - "decidim-proposals/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-elections jobs: @@ -32,13 +43,25 @@ jobs: --health-retries 5 env: POSTGRES_PASSWORD: postgres + bulletin_board: + image: codegram/decidim-bulletin-board:0.21.1 + ports: ["8000:8000"] + env: + DATABASE_URL: postgresql://postgres:postgres@postgres/bb + RAILS_ENV: test + SEED: 1 + IDENTIFICATION_PRIVATE_KEY: '{"kty":"RSA","n":"zMXsZpYPKkDlSmezX898y7zNOaJ7ENIN4kj4UhQ95Vm4HlgTpIs2VMMsO0eqynMaOR_G1mXdqbpbaJtXijBe4V8323QwGm6WVAa71E7pDXa5g6-uo5f8GePitN0YER9y2yNQN4uTaNzJiWV2uLBUYfMdj3SIif31YwLULHAOj3B_oleFK8coE_Qr3NzATcYBmsqE8AR4NljxTO6KDmP1SLdf5GBOBhOAIFbnL_Kpj2xkm7MS3hjMVKpiRhqA1UgX5oKZ8ixBv46fNJF0pBsHi3fHNjK9oZzgdx_AI-YFpdE_40-8bh_g9sWzxacqOM2-MdQLHbvRPEVltO3E8tr6I5YWrylcP7l9VD8OJeqjq2qFYHnGYdmLoD2XuXmI9EuBvSb9H4-qcartxZSIQCimKib_fxZvgrG1FSRRhK6YpvIdGv4-G2zfCCRsC4XD80TYI2bf-oYCoy7eU3_eVHFMV2yg4p1Wnuw2Vgq0edPL_bKaV9JvGx7F-U5juxNN0WZR9LzbPl4ReejzN95lyHgbj0nTH_u3bSpZmgJrQF-PwdnPcG46deVjJgUeosrlC4lQxVrRz0GL58BuFunnz2uYDBDrcJCiG60EbdkAFHjOcXU4wrUWATin7je_aqdBXhSnkTafcJAMvL7Y2Ld7vDge8nLqjAVlAi5am3rN0kqKT6M","e":"AQAB","kid":"a8e86f02ca27e1861bfc49e2a9a4614ca9068f8efdb6d42d19d3aab0eb2a31be"}' + DISABLE_DATABASE_ENVIRONMENT_CHECK: 1 + RAILS_SERVE_STATIC_FILES: enabled + DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true env: DATABASE_USERNAME: postgres DATABASE_PASSWORD: postgres DATABASE_HOST: localhost - RUBYOPT: '-W:no-deprecated' + RUBYOPT: "-W:no-deprecated" + ELECTIONS_BULLETIN_BOARD_SERVER: http://localhost:8000/api steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,10 +72,26 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - uses: nanasess/setup-chromedriver@v1.0.1 - run: bundle exec rspec spec/system/admin name: RSpec diff --git a/.github/workflows/ci_elections_system_public.yml b/.github/workflows/ci_elections_system_public.yml index 29a622eb3d1ed..673b3708f21a5 100644 --- a/.github/workflows/ci_elections_system_public.yml +++ b/.github/workflows/ci_elections_system_public.yml @@ -8,11 +8,22 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-bulletin_board/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-elections/**" + - "decidim-forms/**" + - "decidim-proposals/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-elections jobs: @@ -32,13 +43,25 @@ jobs: --health-retries 5 env: POSTGRES_PASSWORD: postgres + bulletin_board: + image: codegram/decidim-bulletin-board:0.21.1 + ports: ["8000:8000"] + env: + DATABASE_URL: postgresql://postgres:postgres@postgres/bb + RAILS_ENV: test + SEED: 1 + IDENTIFICATION_PRIVATE_KEY: '{"kty":"RSA","n":"zMXsZpYPKkDlSmezX898y7zNOaJ7ENIN4kj4UhQ95Vm4HlgTpIs2VMMsO0eqynMaOR_G1mXdqbpbaJtXijBe4V8323QwGm6WVAa71E7pDXa5g6-uo5f8GePitN0YER9y2yNQN4uTaNzJiWV2uLBUYfMdj3SIif31YwLULHAOj3B_oleFK8coE_Qr3NzATcYBmsqE8AR4NljxTO6KDmP1SLdf5GBOBhOAIFbnL_Kpj2xkm7MS3hjMVKpiRhqA1UgX5oKZ8ixBv46fNJF0pBsHi3fHNjK9oZzgdx_AI-YFpdE_40-8bh_g9sWzxacqOM2-MdQLHbvRPEVltO3E8tr6I5YWrylcP7l9VD8OJeqjq2qFYHnGYdmLoD2XuXmI9EuBvSb9H4-qcartxZSIQCimKib_fxZvgrG1FSRRhK6YpvIdGv4-G2zfCCRsC4XD80TYI2bf-oYCoy7eU3_eVHFMV2yg4p1Wnuw2Vgq0edPL_bKaV9JvGx7F-U5juxNN0WZR9LzbPl4ReejzN95lyHgbj0nTH_u3bSpZmgJrQF-PwdnPcG46deVjJgUeosrlC4lQxVrRz0GL58BuFunnz2uYDBDrcJCiG60EbdkAFHjOcXU4wrUWATin7je_aqdBXhSnkTafcJAMvL7Y2Ld7vDge8nLqjAVlAi5am3rN0kqKT6M","e":"AQAB","kid":"a8e86f02ca27e1861bfc49e2a9a4614ca9068f8efdb6d42d19d3aab0eb2a31be"}' + DISABLE_DATABASE_ENVIRONMENT_CHECK: 1 + RAILS_SERVE_STATIC_FILES: enabled + DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true env: DATABASE_USERNAME: postgres DATABASE_PASSWORD: postgres DATABASE_HOST: localhost - RUBYOPT: '-W:no-deprecated' + RUBYOPT: "-W:no-deprecated" + ELECTIONS_BULLETIN_BOARD_SERVER: http://localhost:8000/api steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,10 +72,26 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - uses: nanasess/setup-chromedriver@v1.0.1 - run: bundle exec rspec spec/system/ --exclude-pattern 'spec/system/admin/**/*_spec.rb' name: RSpec diff --git a/.github/workflows/ci_elections_unit_tests.yml b/.github/workflows/ci_elections_unit_tests.yml index 0d02ab5d7ad78..04b483b26d12a 100644 --- a/.github/workflows/ci_elections_unit_tests.yml +++ b/.github/workflows/ci_elections_unit_tests.yml @@ -8,11 +8,22 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-bulletin_board/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-elections/**" + - "decidim-forms/**" + - "decidim-proposals/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-elections jobs: @@ -32,13 +43,25 @@ jobs: --health-retries 5 env: POSTGRES_PASSWORD: postgres + bulletin_board: + image: codegram/decidim-bulletin-board:0.21.1 + ports: ["8000:8000"] + env: + DATABASE_URL: postgresql://postgres:postgres@postgres/bb + RAILS_ENV: test + SEED: 1 + IDENTIFICATION_PRIVATE_KEY: '{"kty":"RSA","n":"zMXsZpYPKkDlSmezX898y7zNOaJ7ENIN4kj4UhQ95Vm4HlgTpIs2VMMsO0eqynMaOR_G1mXdqbpbaJtXijBe4V8323QwGm6WVAa71E7pDXa5g6-uo5f8GePitN0YER9y2yNQN4uTaNzJiWV2uLBUYfMdj3SIif31YwLULHAOj3B_oleFK8coE_Qr3NzATcYBmsqE8AR4NljxTO6KDmP1SLdf5GBOBhOAIFbnL_Kpj2xkm7MS3hjMVKpiRhqA1UgX5oKZ8ixBv46fNJF0pBsHi3fHNjK9oZzgdx_AI-YFpdE_40-8bh_g9sWzxacqOM2-MdQLHbvRPEVltO3E8tr6I5YWrylcP7l9VD8OJeqjq2qFYHnGYdmLoD2XuXmI9EuBvSb9H4-qcartxZSIQCimKib_fxZvgrG1FSRRhK6YpvIdGv4-G2zfCCRsC4XD80TYI2bf-oYCoy7eU3_eVHFMV2yg4p1Wnuw2Vgq0edPL_bKaV9JvGx7F-U5juxNN0WZR9LzbPl4ReejzN95lyHgbj0nTH_u3bSpZmgJrQF-PwdnPcG46deVjJgUeosrlC4lQxVrRz0GL58BuFunnz2uYDBDrcJCiG60EbdkAFHjOcXU4wrUWATin7je_aqdBXhSnkTafcJAMvL7Y2Ld7vDge8nLqjAVlAi5am3rN0kqKT6M","e":"AQAB","kid":"a8e86f02ca27e1861bfc49e2a9a4614ca9068f8efdb6d42d19d3aab0eb2a31be"}' + DISABLE_DATABASE_ENVIRONMENT_CHECK: 1 + RAILS_SERVE_STATIC_FILES: enabled + DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true env: DATABASE_USERNAME: postgres DATABASE_PASSWORD: postgres DATABASE_HOST: localhost - RUBYOPT: '-W:no-deprecated' + RUBYOPT: "-W:no-deprecated" + ELECTIONS_BULLETIN_BOARD_SERVER: http://localhost:8000/api steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,10 +72,26 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - uses: nanasess/setup-chromedriver@v1.0.1 - run: bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb' name: RSpec diff --git a/.github/workflows/ci_forms.yml b/.github/workflows/ci_forms.yml index 7b3c6803a0178..206a324bb2691 100644 --- a/.github/workflows/ci_forms.yml +++ b/.github/workflows/ci_forms.yml @@ -8,11 +8,19 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-forms/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-forms jobs: @@ -38,7 +46,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +57,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_generators.yml b/.github/workflows/ci_generators.yml index ef3ce847748f6..18200ac3872e5 100644 --- a/.github/workflows/ci_generators.yml +++ b/.github/workflows/ci_generators.yml @@ -8,11 +8,17 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-core/**" + - "decidim-generators/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-generators jobs: @@ -38,7 +44,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,6 +55,19 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle install --jobs 4 --retry 3 name: Install Ruby deps working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_initiatives.yml b/.github/workflows/ci_initiatives.yml index 93c6369033935..c6a0d76c35b1a 100644 --- a/.github/workflows/ci_initiatives.yml +++ b/.github/workflows/ci_initiatives.yml @@ -8,11 +8,21 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-initiatives/**" + - "decidim-verifications/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-initiatives jobs: @@ -38,7 +48,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +59,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_main.yml b/.github/workflows/ci_main.yml index a8c2ba4c5143e..b754366dd2df7 100644 --- a/.github/workflows/ci_main.yml +++ b/.github/workflows/ci_main.yml @@ -13,7 +13,7 @@ env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 - NODE_VERSION: 12.9.1 + NODE_VERSION: 16.9.1 jobs: main: @@ -21,21 +21,31 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - uses: actions/checkout@v2.0.0 with: fetch-depth: 1 - - uses: actions/setup-node@master - with: - node-version: ${{ env.NODE_VERSION }} - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true - - run: npm ci - name: Install JS deps + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-main" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- + - name: Install JS dependencies + run: npm ci - run: bundle exec rspec name: RSpec diff --git a/.github/workflows/ci_meetings_system_admin.yml b/.github/workflows/ci_meetings_system_admin.yml index 09decc2be6c70..0f4addb057bb8 100644 --- a/.github/workflows/ci_meetings_system_admin.yml +++ b/.github/workflows/ci_meetings_system_admin.yml @@ -8,11 +8,22 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-assemblies/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-forms/**" + - "decidim-meetings/**" + - "decidim-participatory_processes/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-meetings jobs: @@ -38,7 +49,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +60,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec spec/system/admin name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_meetings_system_public.yml b/.github/workflows/ci_meetings_system_public.yml index 0fb32fe4ba8b2..0c0b4a60d71fd 100644 --- a/.github/workflows/ci_meetings_system_public.yml +++ b/.github/workflows/ci_meetings_system_public.yml @@ -8,11 +8,22 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-assemblies/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-forms/**" + - "decidim-meetings/**" + - "decidim-participatory_processes/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-meetings jobs: @@ -38,7 +49,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +60,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec spec/system/ --exclude-pattern 'spec/system/admin/**/*_spec.rb' name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_meetings_unit_tests.yml b/.github/workflows/ci_meetings_unit_tests.yml index fbf317798c5d4..0d42cb44026bd 100644 --- a/.github/workflows/ci_meetings_unit_tests.yml +++ b/.github/workflows/ci_meetings_unit_tests.yml @@ -8,11 +8,22 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-assemblies/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-forms/**" + - "decidim-meetings/**" + - "decidim-participatory_processes/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-meetings jobs: @@ -38,7 +49,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +60,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb' name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_pages.yml b/.github/workflows/ci_pages.yml index f886cc185fc0e..3477df644cfa3 100644 --- a/.github/workflows/ci_pages.yml +++ b/.github/workflows/ci_pages.yml @@ -8,11 +8,19 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-pages/**" + - "decidim-participatory_processes/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-pages jobs: @@ -38,7 +46,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +57,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_participatory_processes.yml b/.github/workflows/ci_participatory_processes.yml index 6e0aaf9ffbfce..b6dbc8f2fbe3b 100644 --- a/.github/workflows/ci_participatory_processes.yml +++ b/.github/workflows/ci_participatory_processes.yml @@ -8,11 +8,20 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-meetings/**" + - "decidim-participatory_processes/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-participatory_processes jobs: @@ -38,7 +47,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +58,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_proposals_system_admin.yml b/.github/workflows/ci_proposals_system_admin.yml index 74e0eea09f00e..16794c6c527c6 100644 --- a/.github/workflows/ci_proposals_system_admin.yml +++ b/.github/workflows/ci_proposals_system_admin.yml @@ -8,11 +8,24 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-assemblies/**" + - "decidim-budgets/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-meetings/**" + - "decidim-participatory_processes/**" + - "decidim-proposals/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-proposals jobs: @@ -38,7 +51,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +62,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec spec/system/admin name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_proposals_system_public_1.yml b/.github/workflows/ci_proposals_system_public_1.yml index 3b96fcb79dfce..e400dd45b74b2 100644 --- a/.github/workflows/ci_proposals_system_public_1.yml +++ b/.github/workflows/ci_proposals_system_public_1.yml @@ -8,11 +8,24 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-assemblies/**" + - "decidim-budgets/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-meetings/**" + - "decidim-participatory_processes/**" + - "decidim-proposals/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-proposals jobs: @@ -38,7 +51,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +62,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: | count=$(ls spec/system/*_spec.rb | wc -l | tr -d ' ') half=$(expr $count / 2) diff --git a/.github/workflows/ci_proposals_system_public_2.yml b/.github/workflows/ci_proposals_system_public_2.yml index 6cc604178be88..dfeea2a12419a 100644 --- a/.github/workflows/ci_proposals_system_public_2.yml +++ b/.github/workflows/ci_proposals_system_public_2.yml @@ -8,11 +8,24 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-assemblies/**" + - "decidim-budgets/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-meetings/**" + - "decidim-participatory_processes/**" + - "decidim-proposals/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-proposals jobs: @@ -38,7 +51,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +62,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: | count=$(ls spec/system/*_spec.rb | wc -l | tr -d ' ') half=$(expr $count / 2) diff --git a/.github/workflows/ci_proposals_unit_tests.yml b/.github/workflows/ci_proposals_unit_tests.yml index 450d471f71a16..050168de20749 100644 --- a/.github/workflows/ci_proposals_unit_tests.yml +++ b/.github/workflows/ci_proposals_unit_tests.yml @@ -8,11 +8,24 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-assemblies/**" + - "decidim-budgets/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-meetings/**" + - "decidim-participatory_processes/**" + - "decidim-proposals/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-proposals jobs: @@ -38,7 +51,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +62,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb' name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_sortitions.yml b/.github/workflows/ci_sortitions.yml index 164ae20c7a983..009318137e8a9 100644 --- a/.github/workflows/ci_sortitions.yml +++ b/.github/workflows/ci_sortitions.yml @@ -8,11 +8,21 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-comments/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-proposals/**" + - "decidim-sortitions/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-sortitions jobs: @@ -38,7 +48,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +59,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_surveys.yml b/.github/workflows/ci_surveys.yml index 92b78d6190ff9..f77d10256bd08 100644 --- a/.github/workflows/ci_surveys.yml +++ b/.github/workflows/ci_surveys.yml @@ -8,11 +8,22 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-forms/**" + - "decidim-participatory_processes/**" + - "decidim-surveys/**" + - "decidim-templates/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-surveys jobs: @@ -38,7 +49,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +60,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_system.yml b/.github/workflows/ci_system.yml index 3ca5e844082ac..3bed5e6bf22ce 100644 --- a/.github/workflows/ci_system.yml +++ b/.github/workflows/ci_system.yml @@ -8,11 +8,18 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-system/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-system jobs: @@ -38,7 +45,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +56,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_templates.yml b/.github/workflows/ci_templates.yml index da3a63a15b424..6fc2340a66653 100644 --- a/.github/workflows/ci_templates.yml +++ b/.github/workflows/ci_templates.yml @@ -8,11 +8,21 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-forms/**" + - "decidim-module-templates/**" + - "decidim-templates/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-templates jobs: @@ -38,7 +48,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +59,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/ci_verifications.yml b/.github/workflows/ci_verifications.yml index 0d933b3fb4842..9cff15756c746 100644 --- a/.github/workflows/ci_verifications.yml +++ b/.github/workflows/ci_verifications.yml @@ -8,11 +8,19 @@ on: pull_request: branches-ignore: - "chore/l10n*" + paths: + - "*" + - ".github/**" + - "decidim-admin/**" + - "decidim-core/**" + - "decidim-dev/**" + - "decidim-verifications/**" env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 + NODE_VERSION: 16.9.1 DECIDIM_MODULE: decidim-verifications jobs: @@ -38,7 +46,7 @@ jobs: DATABASE_HOST: localhost RUBYOPT: '-W:no-deprecated' steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -49,11 +57,27 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-${{ env.DECIDIM_MODULE }}" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- - run: bundle exec rake test_app name: Create test app - run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots name: Create the screenshots folder - uses: nanasess/setup-chromedriver@v1.0.1 + - run: RAILS_ENV=test bundle exec rails assets:precompile + name: Precompile assets + working-directory: ./spec/decidim_dummy_app/ - run: bundle exec rspec name: RSpec working-directory: ${{ env.DECIDIM_MODULE }} diff --git a/.github/workflows/dependencies.sh b/.github/workflows/dependencies.sh new file mode 100755 index 0000000000000..d89190529aa2e --- /dev/null +++ b/.github/workflows/dependencies.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# This script gathers all the dependencies for each decidim module in the repository. +# Run it located on the root folder of the repo to get the list of paths to add to each workflow. +# The output must be manually added to each module workflow, in the on.pull_request.paths zone. + +for module in $(ls | grep decidim-) +do + echo "$module:" + echo ' - "*"' + echo ' - ".github/**"' + cat "$module/$module.gemspec" | grep -o "decidim-[^\"]*" | sort | uniq | sed 's/^\(.*\)$/ - \"\1\/**"/' +done diff --git a/.github/workflows/lint_code.yml b/.github/workflows/lint_code.yml index 9206dfee4d0b4..05c956387f6de 100644 --- a/.github/workflows/lint_code.yml +++ b/.github/workflows/lint_code.yml @@ -13,7 +13,7 @@ env: CI: "true" SIMPLECOV: "true" RUBY_VERSION: 2.7.1 - NODE_VERSION: 12.9.1 + NODE_VERSION: 16.9.1 jobs: lint: @@ -22,7 +22,7 @@ jobs: if: "!startsWith(github.head_ref, 'chore/l10n')" timeout-minutes: 60 steps: - - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + - uses: rokroskar/workflow-run-cleanup-action@v0.3.0 if: "github.ref != 'refs/heads/develop'" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -33,14 +33,26 @@ jobs: with: ruby-version: ${{ env.RUBY_VERSION }} bundler-cache: true - - uses: actions/setup-node@master + - uses: actions/setup-node@v1 with: node-version: ${{ env.NODE_VERSION }} - - run: npm ci - name: Install JS deps + - name: Get npm cache directory path + id: npm-cache-dir-path + run: echo "::set-output name=dir::$(npm get cache)-lint" + - uses: actions/cache@v2 + id: npm-cache + with: + path: ${{ steps.npm-cache-dir-path.outputs.dir }} + key: npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + npm- + - name: Install JS dependencies + run: npm ci - run: bundle exec rubocop -P name: Lint Ruby files - run: npm run lint name: Lint JS files + - run: npm run stylelint + name: Lint SCSS files - run: ./.github/run_erblint.sh name: Lint ERB files diff --git a/.github/workflows/on_docs_update.yml b/.github/workflows/on_docs_update.yml index 0d79bb7e202b0..2a497a96273bd 100644 --- a/.github/workflows/on_docs_update.yml +++ b/.github/workflows/on_docs_update.yml @@ -1,22 +1,23 @@ name: "On docs update" on: push: + branches: + - develop paths: - 'docs/**' jobs: - trigger_docker_build: + trigger_documentation_build: name: Trigger decidim/documentation build runs-on: ubuntu-latest - if: "github.ref == 'refs/heads/develop'" timeout-minutes: 60 steps: - name: Send dispatch for trigger_build workflow run: | - curl --request POST \ + curl --fail --show-error \ + --request POST \ --user "decidim-bot:${{ secrets.DOCS_WORKFLOW_PAT }}" \ --header "Accept: application/vnd.github.everest-preview+json" \ --header "Content-Type: application/json" \ https://api.github.com/repos/decidim/documentation/actions/workflows/trigger_build.yml/dispatches \ --data '{"ref": "master"}' - diff --git a/.github/workflows/on_release.yml b/.github/workflows/on_release.yml index 5cce6e4e1c7db..303f649cc1bf7 100644 --- a/.github/workflows/on_release.yml +++ b/.github/workflows/on_release.yml @@ -9,20 +9,12 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - name: Send dispatch for Github Container Registry build - run: | - curl --request POST \ - --user "decidim-bot:${{ secrets.DOCKER_WORKFLOW_PAT }}" \ - --header "Accept: application/vnd.github.everest-preview+json" \ - --header "Content-Type: application/json" \ - https://api.github.com/repos/decidim/docker/actions/workflows/github_registry.yml/dispatches \ - --data '{"ref": "master"}' - name: Send dispatch for Docker Hub build run: | - curl --request POST \ + curl --fail --show-error \ + --request POST \ --user "decidim-bot:${{ secrets.DOCKER_WORKFLOW_PAT }}" \ --header "Accept: application/vnd.github.everest-preview+json" \ --header "Content-Type: application/json" \ https://api.github.com/repos/decidim/docker/actions/workflows/dockerhub.yml/dispatches \ --data '{"ref": "master"}' - diff --git a/.gitignore b/.gitignore index 465a29cae9167..6fead199957f3 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,13 @@ schema.json .tags # Vim swap files *.swp +# NVM RC (node version manager) +.nvmrc +# Decidim webpack packs +public/decidim-packs +# tmp folder (used by webpack to deal with cache) +tmp +# webpack packs output +decidim-packs +temporary_changelog.md diff --git a/.node-version b/.node-version new file mode 100644 index 0000000000000..06e7515969b81 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +16.9.1 diff --git a/.prettierrc b/.prettierrc index 8f4d58a7b5554..1a8654abc2805 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,3 +1,3 @@ { - "trailingComma": true -} + "trailingComma": "none" +} \ No newline at end of file diff --git a/.rubocop_ruby.yml b/.rubocop_ruby.yml index b05a2f7a8ce56..299a4ada0d7d2 100644 --- a/.rubocop_ruby.yml +++ b/.rubocop_ruby.yml @@ -15,6 +15,7 @@ AllCops: Exclude: - "**/vendor/**/*" - "development_app/**/*" + - "decidim_app-design/node_modules/**/*" - "spec/decidim_dummy_app/**/*" - "node_modules/**/*" # Default formatter will be used if no -f/--format option is given. @@ -176,6 +177,15 @@ Layout/ParameterAlignment: # But it can be overridden by setting this parameter IndentationWidth: ~ +Style/ArrayCoercion: + Description: >- + Use Array() instead of explicit Array check or [*var], when dealing + with a variable you want to treat as an Array, but you're not certain it's an array. + StyleGuide: '#array-coercion' + Safe: false + Enabled: false + VersionAdded: '0.88' + Style/AndOr: # Whether `and` and `or` are banned only in conditionals (conditionals) # or completely (always). @@ -451,6 +461,7 @@ Naming/FileName: - "**/Gemfile" - "**/Rakefile" - "**/*.gemspec" + - "decidim-dev/lib/decidim-dev.rb" # When true, requires that each source file should define a class or module # with a name which matches the file name (converted to ... case). # It further expects it to be nested inside modules which match the names @@ -1218,7 +1229,7 @@ RSpec/ContextWording: RSpec/DescribeClass: Exclude: - spec/gemfiles_spec.rb - - spec/js_bundles_spec.rb + - spec/webpacker_spec.rb - spec/i18n_spec.rb - "**/*/spec/**/*_badge_spec.rb" - decidim-core/spec/lib/global_engines_spec.rb @@ -1248,6 +1259,8 @@ RSpec/MultipleExpectations: RSpec/MultipleMemoizedHelpers: Max: 35 + Exclude: + - decidim-assemblies/spec/forms/assembly_form_spec.rb RSpec/NestedGroups: Max: 7 diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 0000000000000..dc88952f3bd7c --- /dev/null +++ b/.stylelintignore @@ -0,0 +1 @@ +decidim-*/app/packs/stylesheets/**/bundle.scss diff --git a/CHANGELOG.md b/CHANGELOG.md index e94e21d2137d5..dc21320c3d06f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,25 @@ # Change Log +## [Unreleased](https://github.com/decidim/decidim/tree/HEAD) -## [v0.24.3](https://github.com/decidim/decidim/releases/tag/v0.24.3) +#### Blocked user in global search + +PR [\#8658](https://github.com/decidim/decidim/pull/8658) Blocked users are present in global search, to update the search and make them disappear, Run in a rails console or create a migration with: + +```ruby + Decidim::User.find_each(&:try_update_index_for_search_resource) +``` + +Please be aware that it could take a while if your database has a lot of Users. + +### Added + +### Changed + +### Fixed + +### Removed + +## [0.25.2](https://github.com/decidim/decidim/tree/v0.25.2) ### Added @@ -12,15 +31,18 @@ Nothing. ### Fixed -- **decidim-participatory processes**: Fix attachment title migration generating possibly invalid values [\#8044](https://github.com/decidim/decidim/pull/8044) -- **decidim-comments**, **decidim-consultations**: Fix for commenting in consultation questions [\#8062](https://github.com/decidim/decidim/pull/8062) -- **decidim-core**: Fix boolean fields for .reported? and .hidden? which is nil if no report exists [\#8082](https://github.com/decidim/decidim/pull/8082) -- **decidim-core**: Fix redirects broken by Terms and Conditions redirect [\#8083](https://github.com/decidim/decidim/pull/8083) -- **decidim-core**: Use correct newsletter cell for web view [\#8081](https://github.com/decidim/decidim/pull/8081) -- **decidim-core**, **decidim-proposals**: Remove proposals filters cache [\#8038](https://github.com/decidim/decidim/pull/8038) -- **decidim-core**, **decidim-meetings**: Include resources on maps only when the geocoding got valid coords [\#8039](https://github.com/decidim/decidim/pull/8039) -- **decidim-core**: Fix editor when formatting starts with a linebreak [\#8024](https://github.com/decidim/decidim/pull/8024) -- **decidim-admin**: Use symbols for polymorphic route arguments [\#8060](https://github.com/decidim/decidim/pull/8060) +- **decidim-surveys**: Backport fix notification after creating survey [\#8467](https://github.com/decidim/decidim/pull/8467) +- **decidim-budgets**, **decidim-comments**: Backport comment's get link in project view (#8450) [\#8469](https://github.com/decidim/decidim/pull/8469) +- **decidim-core**: Backport "Fix 404 link in 'how to participate' home content block" to v0.25 [\#8521](https://github.com/decidim/decidim/pull/8521) +- **decidim-system**: Backport "Add `pptx` in allowed_file_extensions (of admin)" to v0.25 [\#8533](https://github.com/decidim/decidim/pull/8533) +- **decidim-generators**: Backport "Freezing webpacker to RC.5 until RC.7 is fixed" to v0.25 [\#8536](https://github.com/decidim/decidim/pull/8536) +- **decidim-meetings**: Backport "Fix meetings with multiple dates" to v0.25 [\#8522](https://github.com/decidim/decidim/pull/8522) +- **decidim-conferences**: Backport "Fix conference speakers when there isn't any avatar" to v0.25 [\#8538](https://github.com/decidim/decidim/pull/8538) +- **decidim-assemblies**, **decidim-participatory processes**: Backport "Fix the copy of components weights in participatory processes and assemblies" to v0.25 [\#8539](https://github.com/decidim/decidim/pull/8539) + +### Improved + +Nothing. ### Removed @@ -28,10 +50,52 @@ Nothing. ### Developer improvements -- Bump gems versions to fix dependendabot alerts [\#8041](https://github.com/decidim/decidim/pull/8041) -- Bump bundle version for security reasons [\#8084](https://github.com/decidim/decidim/pull/8084) +Nothing. -## [v0.24.2](https://github.com/decidim/decidim/releases/tag/v0.24.2) +## [0.25.1](https://github.com/decidim/decidim/tree/v0.25.1) + +### Added + +#### Register assets paths +To prevent Zeitwerk from trying to autoload classes from the `app/packs` folder, it's necesary to register these paths for each module and for the application using the method `Decidim.register_assets_path` on initializers. This is explained in the webpacker migration guides for [applications](https://github.com/decidim/decidim/blob/develop/docs/modules/develop/pages/guide_migrate_webpacker_app.adoc#help-decidim-to-know-the-applications-assets-folder) and [modules](https://github.com/decidim/decidim/blob/develop/docs/modules/develop/pages/guide_migrate_webpacker_module.adoc#help-decidim-to-know-the-modules-assets-folder)), and was implemented in [\#8449](https://github.com/decidim/decidim/pull/8449). + +#### Unconfirmed access disabled by default +As per [\#8233](https://github.com/decidim/decidim/pull/8233), by default all participants must confirm their email account to sign in. Implementors can change this setting as a [initializer configuration](https://docs.decidim.org/en/configure/initializer/#_unconfirmed_access_for_users): + +### Changed + +Nothing. + +### Fixed + +- **decidim-proposals**: Backport: Any user can access proposal's pages representing the "create a proposal" steps (#8390) [\#8407](https://github.com/decidim/decidim/pull/8407) +- Backport "Increase text contrast in current phase of a participatory process" [\#8436](https://github.com/decidim/decidim/pull/8436) +- **decidim-core**: Backport "Include only public entities in the following page" to 0.25 [\#8406](https://github.com/decidim/decidim/pull/8406) +- **decidim-generators**: Backport "Fix railties requirements on created applications" [\#8439](https://github.com/decidim/decidim/pull/8439) +- **decidim-blogs**: Backport "Add missing translations" [\#8441](https://github.com/decidim/decidim/pull/8441) +- **decidim-core**: Backport "Fix javascript exception when geocoding proposals is disabled" [\#8437](https://github.com/decidim/decidim/pull/8437) +- **decidim-core**: Force Rails version to 6.0 [\#8440](https://github.com/decidim/decidim/pull/8440) +- Backport "Fix CVE-2021-41136" [\#8443](https://github.com/decidim/decidim/pull/8443) +- **decidim-comments**: Backport "Refresh comments component after updating" to v0.25 [\#8446](https://github.com/decidim/decidim/pull/8446) +- **decidim-core**: Backport "Fix webpacker issue when using zeitwerk" to 0.25 [\#8447](https://github.com/decidim/decidim/pull/8447) +- **decidim-core**: Backport "Improve Zeitwerk assets paths to ignore" to 0.25 [\#8454](https://github.com/decidim/decidim/pull/8454) + +### Improved + +- **decidim-core**: Backport "Enforce redirects to include the organization host" to 0.25 [\#8405](https://github.com/decidim/decidim/pull/8405) +- **decidim-core**: Backport: Disallow redirection to the host when performing redirect_back [\#8402](https://github.com/decidim/decidim/pull/8402) +- **decidim-core**: Backport "Update omniauth gem and dependencies" [\#8442](https://github.com/decidim/decidim/pull/8442) + +### Removed + +Nothing. + +### Developer improvements + +- Backport "Fix railties requirements on created applications" [\#8439](https://github.com/decidim/decidim/pull/8439) +- Backport "Fixing generator webpacker issues" [\#8438](https://github.com/decidim/decidim/pull/8438) + +## [0.25.0](https://github.com/decidim/decidim/tree/v0.25.0) ### Added @@ -43,13 +107,17 @@ Nothing. ### Fixed -- **decidim-core**: CSV exporter should take into account locales from all resources [\#7860](https://github.com/decidim/decidim/pull/7860) -- **decidim-comments**: Fix TypeError in newsletters [\#7876](https://github.com/decidim/decidim/pull/7876) -- **decidim-core**: Open attachments in new tab [\#7918](https://github.com/decidim/decidim/pull/7918) -- **decidim-core**: Validate nickname using correct regexp [\#7921](https://github.com/decidim/decidim/pull/7921) -- **decidim-proposals**: Cast proposal and collaborative drafts titles to text [\#7928](https://github.com/decidim/decidim/pull/7928) -- **decidim-core**: Fix editor: remove br tags from inside a tags [\#7957](https://github.com/decidim/decidim/pull/7957) -- **decidim-core**: Fix fragment caching with multiple locales [\#7960](https://github.com/decidim/decidim/pull/7960) +- **decidim-debates**: Backport: Fix title meta tag for debates (#8323) [\#8350](https://github.com/decidim/decidim/pull/8350) +- **decidim-proposals**: Backport: Fix machine translated similarity for proposals (#8098) [\#8338](https://github.com/decidim/decidim/pull/8338) +- **decidim-conferences**: Backport "Fix error when accessing the meetings of a conference with speakers related" [\#8371](https://github.com/decidim/decidim/pull/8371) +- **decidim-admin**: Backport "Do not block registered users with InviteUserAgain" to v0.25 [\#8366](https://github.com/decidim/decidim/pull/8366) +- **decidim-proposals**: [Backport] Fix UserAnswersSerializer for CSV exports to v0.25 [\#8370](https://github.com/decidim/decidim/pull/8370) +- **decidim-meetings**: Backport "Define localized fields in Decidim::Meetings:DiffRenderer" to v0.25 [\#8384](https://github.com/decidim/decidim/pull/8384) + +### Improved + +- **decidim-comments**: Backport "Ignore errors during comments migration task" [\#8365](https://github.com/decidim/decidim/pull/8365) +- **decidim-conferences**: Backport "Fix details on conference speakers: affiliation order, personal URL link, seeds and more info link" to v0.25 [\#8382](https://github.com/decidim/decidim/pull/8382) ### Removed @@ -57,10 +125,9 @@ Nothing. ### Developer improvements -- Do not change the global test app configs during specs [\#7816](https://github.com/decidim/decidim/pull/7816) -- Update to Rails 5.2.6 [\#7949](https://github.com/decidim/decidim/pull/7949) +Nothing. -## [v0.24.1](https://github.com/decidim/decidim/releases/tag/v0.24.1) +## [0.25.0.rc4](https://github.com/decidim/decidim/tree/v0.25.0.rc4) ### Added @@ -72,10 +139,11 @@ Nothing. ### Fixed -- **decidim-admin**: Add admin missing translations (#7702) [\#7766](https://github.com/decidim/decidim/pull/7766) -- **decidim-initiatives**: Fix permission for initiative edit and update [\#7654](https://github.com/decidim/decidim/pull/7654) -- **decidim-conferences**: Fix validations for registration related fields in Conference form [\#7734](https://github.com/decidim/decidim/pull/7734) -- **decidim-admin**, **decidim-conferences**: Add Conferences and Admin missing translations (#7653) [\#7765](https://github.com/decidim/decidim/pull/7765) +Nothing. + +### Improved + +Nothing. ### Removed @@ -83,501 +151,560 @@ Nothing. ### Developer improvements -- Do not modify the controller class in the controller tests that rende… [\#7775](https://github.com/decidim/decidim/pull/7775) -- Upgrade to Rails 5.2.5 [\#7806](https://github.com/decidim/decidim/pull/7806) +- Backport "Update NPM version" [\#8344](https://github.com/decidim/decidim/pull/8344) -## [v0.24.0](https://github.com/decidim/decidim/releases/tag/v0.24.0) +## [0.25.0.rc3](https://github.com/decidim/decidim/tree/v0.25.0.rc3) + +### Added + +Nothing. + +### Changed + +Nothing. + +### Fixed + +- **decidim-debates**: Backport "Fix "last comment by" when commenter is a user group" [\#8337](https://github.com/decidim/decidim/pull/8337) +- **decidim-comments**: Backport "Fix issues with dynamic comments polling" to v0.25 [\#8340](https://github.com/decidim/decidim/pull/8340) +- **decidim-core**: Backport "Remove npm decidim packages with dependencies from other decidim packages" [\#8339](https://github.com/decidim/decidim/pull/8339) + +### Improved + +Nothing. + +### Removed + +Nothing. + +### Developer improvements + +- Backport "Fix CSS validation tests caused by a bug on the validation service" [\#8325](https://github.com/decidim/decidim/pull/8325) +- Backport "Remove npm decidim packages with dependencies from other decidim packages" [\#8339](https://github.com/decidim/decidim/pull/8339) + +## [0.25.0.rc2](https://github.com/decidim/decidim/tree/v0.25.0.rc2) ### Upgrade Notes -#### Bump Ruby to v2.7 +#### Comments statistics change + +* [#8012](https://github.com/decidim/decidim/pull/8012) Participatory space to comments, to fix the statistics. Use +`rake decidim_comments:update_participatory_process_in_comments` to migrate existing comments to the new structure. + +### Added + +Nothing. + +### Changed + +Nothing. + +### Fixed -We've bumped the minimum Ruby version to 2.7.1, thanks to 2 PRs: +- Backport "Fix webpacker dependency lock" to v0.25 [\#8289](https://github.com/decidim/decidim/pull/8289) +- Backport "Fix NPM packages versioning during release process" [\#8284](https://github.com/decidim/decidim/pull/8284) +- **decidim-accountability**: Backport "Fix accountability notifications proposal title" to v0.25 [\#8287](https://github.com/decidim/decidim/pull/8287) +- Backport "Fix Luxembourgish locale" to v0.25 [\#8282](https://github.com/decidim/decidim/pull/8282) +- **decidim-debates**, **decidim-meetings**, **decidim-proposals**: Backport - Fix characters not encoded in title to 0.25 [\#8292](https://github.com/decidim/decidim/pull/8292) +- **decidim-core**: Backport "Fix invalid i18n values for diff changeset" to v0.25 [\#8305](https://github.com/decidim/decidim/pull/8305) +- **decidim-meetings**: Backport "Fix live? missing method delegation in online_meeting cell" to v0.25 [\#8309](https://github.com/decidim/decidim/pull/8309) +- **decidim-comments**: Backport: Fix statistics in Comments (#8012) [\#8316](https://github.com/decidim/decidim/pull/8316) +- **decidim-core**: Backport: [CVE-2021-22942] Possible Open Redirect in Host Authorization Middleware [\#8320](https://github.com/decidim/decidim/pull/8320) +- **decidim-core**: Backport "Remove unnecessary spacer from external link indicator" to v0.25 [\#8319](https://github.com/decidim/decidim/pull/8319) +- Backport "Fix CSS validation tests caused by a bug on the validation service" [\#8325](https://github.com/decidim/decidim/pull/8325) +- **decidim-core**: Backport "Fix missing icons after CORS" to v0.25 [\#8318](https://github.com/decidim/decidim/pull/8318) +- Backport "Update foundation-sites to 6.7.0 for better Dart Sass compatibility" to v0.25 [\#8300](https://github.com/decidim/decidim/pull/8300) -- [\#6320](https://github.com/decidim/decidim/pull/6320) -- [\#6522](https://github.com/decidim/decidim/pull/6522) -#### Comments no longer use react +### Removed -As per [\#6498](https://github.com/decidim/decidim/pull/6498), the comments component is no longer implemented with the react component. In case you had customized the react component, it will still work as you would expect as the GraphQL API has not disappeared anywhere. You should, however, gradually migrate to the "new way" (Trailblazer cells) in order to ensure compatibility with future versions too. +Nothing. -#### Consultations module deprecation +## [0.25.0.rc1](https://github.com/decidim/decidim/tree/v0.25.0.rc1) -As the new `Votings` module is being developed and will eventually replace the `Consultations` module, the latter enters the deprecation phase. +#### Statistics change +As per [\#8147](https://github.com/decidim/decidim/pull/8147), the participants stats will not take into account deleted and blocked users. -#### Authorization metadata is now encrypted in the database +#### Webpacker migration +As per [#7464](https://github.com/decidim/decidim/pull/7464), [#7733](https://github.com/decidim/decidim/pull/7733) Decidim has been upgraded to use Webpacker to manage its assets. It's a huge change that requires some updates in your applications. Please refer to the guide [Migrate to Webpacker an instance app](https://github.com/decidim/decidim/blob/develop/docs/modules/develop/pages/guide_migrate_webpacker_app.adoc) and follow the steps described. -As per [\#6947](https://github.com/decidim/decidim/pull/6947), the JSON values for the authorizations' `metadata` and `verification_metadata` columns in the `decidim_authorizations` database table are now automatically encrypted because they can contain identifiable or sensitive personal information connected to a user account. Storing this data in plain text in the database would be a security risk. +#### Improved menu api +As per [\#7368](https://github.com/decidim/decidim/pull/7368), [\#7382](https://github.com/decidim/decidim/pull/7382) the entire admin structure has been migrated from menus being rendered in partials, to the existing menu structure. Before, this change adding a new menu item to an admin submenu required partial override. -You need to do changes to your code if you have been querying these tables in the past through the `Decidim::Authorization` model as follows: +As per [\#7545](https://github.com/decidim/decidim/pull/7545) the menu api has been enhanced to support removal of elements and reordering. All the menu items have an identifier that allow any developer to interact without overriding the entire menu structure. As a result of this change, the old ```menu.item``` function has been deprecated in favour of a more verbose version ```menu.add_item ```, of which first argument is the menu identifier. +Example on adding new elements to a menu: ```ruby -Decidim::Authorization.where( - name: "your_authorization_handler" -).where("metadata ->> 'gender' = ?", "f").find_each do |authorization| - puts "#{authorization.user.name} is a #{authorization.metadata["gender"]}" +Decidim.menu :menu do |menu| + menu.add_item :root, + I18n.t("menu.home", scope: "decidim"), + decidim.root_path, + position: 1, + active: :exclusive + + menu.add_item :pages, + I18n.t("menu.help", scope: "decidim"), + decidim.pages_path, + position: 7, + active: :inclusive end ``` -The problem with this code is that the data in the `metadata ->> 'gender'` column is now encrypted, so your search would not match any records in the database. Instead, you can do the following: +Example Customizing the elements of a menu: ```ruby -Decidim::Authorization.where( - name: "your_authorization_handler" -).find_each do |authorization| - next unless authorization.metadata["gender"] == "f" - - puts "#{authorization.user.name} is a #{authorization.metadata["gender"]}" +Decidim.menu :menu do |menu| + # Completely remove a menu item + menu.remove_item :my_item + + # Change the items order + menu.move :root, after: :pages + # alternative + menu.move :pages, before: :root end ``` -As you notice, when you are accessing the `metadata` or `verification_metadata` columns through the Active Record object, you can utilize the data in plain text. This is because the accessor method for these columns will automatically decrypt the data in the hash object. +#### Meetings merge minutes and close actions + +With changes introduced in [\#7968](https://github.com/decidim/decidim/pull/7968) the `Decidim::Meetings::Minutes` model and related table are removed and the attributes of the previously existing minutes are migrated to `Decidim::Meetings::Meeting` model in the `closing_report`, `video_url`, `audio_url` and `closing_visible` columns. These are the different results of the merge according to the initial data: + +* It there was no minutes data and the meeting was not closed nothing changes +* If there was no minutes data and the meeting was closed, the meeting remains closed with the `closing_visible` attribute to true. In this way the closing data will remain visible. +* If there was minutes data and the meeting was not closed, the meeting is closed and the minutes `description` value is copied to the meeting `closing_report`, the `video_url` and `audio_url` minutes attributes values are copied to the respective meeting attributes and the minutes `visible` attribute value is copied to the meeting `closing_visible` attribute. +* If there was minutes data and the meeting was closed, the meeting remains closed and the meeting `closing_report` value remains if present. Elsewere the minutes `description` value is copied to the meeting `closing_report`. the `video_url` and `audio_url` minutes attributes values are copied to the respective meeting attributes and the minutes `visible` attribute value is copied to the meeting `closing_visible` attribute. In this case the visibility of closing report may change to false if there was a minutes with `visible` set to false. + +Please, note that if there was previously `minutes_description` and `closing_report` data for a meeting, after applying the changes of this release, the `minutes_description` data will be lost. + +If there is previous activity of creation or edition of minutes, `Decidim::ActionLog` instances and an associated `PaperTrail::Version` instance for each one will have been created pointing to these elements in their polymorphic associations. To avoid errors, the migration includes changing those associations to point to the meeting and changing the action to `close` in the action log items. This change is not reversible + +#### New Job queues + +PR [\#7986](https://github.com/decidim/decidim/pull/7986) splits some jobs from the `:default` queue to two new queues: + +- `:exports` +- `:translations` + +If your application uses Sidekiq and you set a manual configuration file, you'll need to update it to add these two new queues. Otherwise these queues [will never run](https://github.com/mperham/sidekiq/issues/4897). + +#### User groups in global search + +PR [\#8061](https://github.com/decidim/decidim/pull/8061) adds user groups to the global search and previously existing groups need to be indexed, otherwise it won't be available as search results. Run in a rails console or create a migration with: + +```ruby + Decidim::UserGroup.find_each(&:try_update_index_for_search_resource) +``` + +Please be aware that it could take a while if your database has a lot of groups. + +#### ActiveStorage migration + +PR [\#7598](https://github.com/decidim/decidim/pull/7598) migrates attachments from `CarrierWave` to `ActiveStorage`. There was a migration to move some organization fields to a content block (decidim-core/db/migrate/20180810092428_move_organization_fields_to_hero_content_block.rb) including the use of `CarrierWave` to migrate an image. This part has been removed. Please, if your application has the old migration replace its content with the changed file to avoid errors in the future because `CarrierWave` dependency will be eliminated. + +PR[\#7902](https://github.com/decidim/decidim/pull/7902) provides a task to migrate existing `CarrierWave` attachment files to `ActiveStorage`. Keep in mind that the `ActiveStorage` migration PRs don't delete `CarrierWave` attachments and preserve the columns used by it. To guarantee the access to `CarrierWave` files the gem must be installed (the current core engine maintains that dependency) and configured as it was before the migration to `ActiveStorage`. The task downloads each file using `CarrierWave` uploaders and uploads it again using `ActiveStorage`. This PR provides 2 tasks: + +* The task to copy files to `ActiveStorage`. The task generates a log file in `log/` with a line with the result of each migration. The result can be: + * `[OK] Migrated - [OK] Checksum identical` if the file was copied successfully and the checksums of the origin and copied files are identical. This should be the expected result. + * `[KO] Migrated - [KO] Checksum different` if the file was copied successfully but the checksums are different. + * `[SKIP] Migrated` The migration was skipped because the task detected that there was already an existing file attached with `ActiveStorage` (the other task allows us to check if `CarrierWave` and `ActiveStorage` files are identical. + * `[ERROR] Exception` if any error prevents the migration of the file. The error message is included in the result. + +The task also creates a mapping of paths in `tmp/attachment_mappings.csv` with the id of the instance, the name of the `CarrierWave` attribute and its origin path and the destination path in `ActiveStorage`. To run this task execute: + +``` +rails decidim:active_storage_migrations:migrate_from_carrierwave_to_active_storage +``` + +Note that the migration generates instances of `ActiveStorage::Attachment` in case they are not yet created. To repeat the migration from scratch it would be enough to delete all `ActiveStorage::Attachment` items (be careful not to delete attachments that were created earlier with `ActiveStorage`) + -This is less performant but it is more secure. Security weighs more. +* The task to check migration and compare files. This task finds each `CarrierWave` attachment file and looks for corresponding `ActiveStorage` attachment and compares them if possible. The result for each attachment can be: + * `[OK] Checksum identical` if both files exist and checkums are identical. + * `[KO] Checksum different` if both files exist but checkums are different. + * `[SKIP] Pending migration` if the `ActiveStorage` file is not present. + * `[ERROR] Exception` if there is any error in the checking process. The error message is included in the result. + + +To run this task execute: + +``` +rails decidim:active_storage_migrations:check_migration_from_carrierwave_to_active_storage +``` ### Added -- **decidim-initiatives**: Show draft initiatives [\#6584](https://github.com/decidim/decidim/pull/6584) -- **decidim-budgets**: Add scope to proposals import in budgets [\#6525](https://github.com/decidim/decidim/pull/6525) -- Add new languages: Korean, Vietnamese and Chinese [\#6648](https://github.com/decidim/decidim/pull/6648) -- **decidim-core**, **decidim-meetings**: Add online meetings [\#6572](https://github.com/decidim/decidim/pull/6572) -- **decidim-core**: Allow customization of the upload help messages [\#6683](https://github.com/decidim/decidim/pull/6683) -- **decidim-admin**, **decidim-assemblies**, **decidim-elections**: Add elections trustees role [\#6535](https://github.com/decidim/decidim/pull/6535) -- **decidim-elections**: Add the trustee zone for users [\#6615](https://github.com/decidim/decidim/pull/6615) -- **decidim-elections**: Elections design improvements [\#6721](https://github.com/decidim/decidim/pull/6721) -- **decidim-elections**, **decidim-forms**: Election feedback form [\#6548](https://github.com/decidim/decidim/pull/6548) -- **decidim-meetings**: Missing i18n on closed debate notification [\#6746](https://github.com/decidim/decidim/pull/6746) -- **decidim-admin**, **decidim-core**, **decidim-debates**, **decidim-meetings**, **decidim-proposals**: Improve moderation panel [\#6677](https://github.com/decidim/decidim/pull/6677) -- **decidim-budgets**: Budget voting projects rule (select min-max projects) [\#6753](https://github.com/decidim/decidim/pull/6753) -- **decidim-meetings**: Let users close meetings from public pages [\#6703](https://github.com/decidim/decidim/pull/6703) -- **decidim-elections**: Add preview of questions to an election [\#6749](https://github.com/decidim/decidim/pull/6749) -- **decidim-core**: feat: send notification to reported content authors [\#6747](https://github.com/decidim/decidim/pull/6747) -- **decidim-core**: Allow subhero content block to hold HTML tags [\#6810](https://github.com/decidim/decidim/pull/6810) -- **decidim-core**: Add info to report email for moderators [\#6725](https://github.com/decidim/decidim/pull/6725) -- **decidim-meetings**: Add registration system to meetings [\#6662](https://github.com/decidim/decidim/pull/6662) -- **decidim-initiatives**: Filter created initiatives only by author [\#6658](https://github.com/decidim/decidim/pull/6658) -- **decidim-proposals**: Add locales for cost report [\#6767](https://github.com/decidim/decidim/pull/6767) -- **decidim-admin**, **decidim-core**: Detect the use of spam-bots and ban non compliant users (part 1) [\#6696](https://github.com/decidim/decidim/pull/6696) -- **decidim-core**: Send report email when reported resource is translated to default org language [\#6726](https://github.com/decidim/decidim/pull/6726) -- **decidim-elections**: Setup election for bulletin board [\#6813](https://github.com/decidim/decidim/pull/6813) -- **decidim-initiatives**: Edit initiative as promoter [\#6790](https://github.com/decidim/decidim/pull/6790) -- **decidim-admin**, **decidim-core**: Send notification to resource's authors when it is hidden by a moderator [\#6885](https://github.com/decidim/decidim/pull/6885) -- **decidim-meetings**: Add a config flag to disable the registration code [\#6698](https://github.com/decidim/decidim/pull/6698) -- **decidim-elections**: Show election results [\#6768](https://github.com/decidim/decidim/pull/6768) -- **decidim-admin**: Add HTML titles in Admin panel [\#6666](https://github.com/decidim/decidim/pull/6666) -- **decidim-core**, **decidim-elections**: Export election results [\#6846](https://github.com/decidim/decidim/pull/6846) -- **decidim-admin**, **decidim-participatory processes**: Implement ContentBlock for Process Groups (Admin UI) [\#6655](https://github.com/decidim/decidim/pull/6655) -- **decidim-meetings**: Automatically enable registrations when meeting is "on this platform" [\#6874](https://github.com/decidim/decidim/pull/6874) -- **decidim-core**, **decidim-proposals**: Allow user to drag address on proposal map [\#6291](https://github.com/decidim/decidim/pull/6291) -- **decidim-conferences**: Localize a string in conference speaker [\#6866](https://github.com/decidim/decidim/pull/6866) -- **decidim-participatory processes**: Add HTML Content Blocks in Process Groups [\#6823](https://github.com/decidim/decidim/pull/6823) -- **decidim-core**: Adds spinner to block page while ajax petition is executed [\#6611](https://github.com/decidim/decidim/pull/6611) -- **decidim-participatory processes**: Add Metadata Content Block in Process Groups [\#6699](https://github.com/decidim/decidim/pull/6699) -- **decidim-participatory processes**: Add Participatory Processes Content Block in Process Groups [\#6826](https://github.com/decidim/decidim/pull/6826) -- **decidim-admin**: Add a general moderation panel [\#6955](https://github.com/decidim/decidim/pull/6955) -- **decidim-participatory processes**: Edit link in groups and show group in processes [\#6827](https://github.com/decidim/decidim/pull/6827) -- **decidim-participatory processes**: Improve highlights of Process Groups [\#6828](https://github.com/decidim/decidim/pull/6828) -- **decidim-participatory processes**: Improvements in Process Groups and processes block [\#6853](https://github.com/decidim/decidim/pull/6853) -- **decidim-debates**: Archive Debates [\#6940](https://github.com/decidim/decidim/pull/6940) -- **decidim-admin**, **decidim-core**: Let components define settings with type time [\#6948](https://github.com/decidim/decidim/pull/6948) -- **decidim-debates**: Export debate comments [\#6962](https://github.com/decidim/decidim/pull/6962) -- **decidim-elections**: Add and use decidim-bulletin_board gem [\#6997](https://github.com/decidim/decidim/pull/6997) -- **decidim-meetings**: Allow creation of hybrid meetings [\#6891](https://github.com/decidim/decidim/pull/6891) -- **decidim-core**, **decidim-verifications**: Encrypt authorization metadata [\#6947](https://github.com/decidim/decidim/pull/6947) -- **decidim-admin**, **decidim-core**, **decidim-system**: Make it possible to allow some pages to display publicly even when organization access is limited [\#6951](https://github.com/decidim/decidim/pull/6951) -- **decidim-surveys**: Start and end dates for survey [\#7016](https://github.com/decidim/decidim/pull/7016) -- **decidim-admin**, **decidim-core**, **decidim-verifications**: Improve management of managed user [\#6748](https://github.com/decidim/decidim/pull/6748) -- **decidim-participatory processes**: Let admins enter the Space Private Users section in admin [\#7067](https://github.com/decidim/decidim/pull/7067) -- **decidim-admin**, **decidim-core**: Detect the use of spam-bots and ban non compliant users (part 2) [\#6804](https://github.com/decidim/decidim/pull/6804) -- **decidim-meetings**: Add comments export to meetings [\#6946](https://github.com/decidim/decidim/pull/6946) -- **decidim-consultations**: See a deprecation callout in Consultations [\#7095](https://github.com/decidim/decidim/pull/7095) -- **decidim-debates**: Add scope to debates [\#6326](https://github.com/decidim/decidim/pull/6326) -- **decidim-budgets**: Sum Budgets finished and pending orders in admin panel [\#7010](https://github.com/decidim/decidim/pull/7010) -- **decidim-admin**, **decidim-assemblies**, **decidim-participatory processes**: Allow admin to be registered as a participatory space user [\#6890](https://github.com/decidim/decidim/pull/6890) -- **decidim-budgets**: Export budgets projects [\#7021](https://github.com/decidim/decidim/pull/7021) -- **decidim-initiatives**: Allow the admin to send an initiative to technical validation after it was discarded [\#6993](https://github.com/decidim/decidim/pull/6993) -- **decidim-debates**: Debates with no start and end time [\#6959](https://github.com/decidim/decidim/pull/6959) -- **decidim-accountability**: Add search, filter, order, and paginate capabilities to admin results view [\#7048](https://github.com/decidim/decidim/pull/7048) -- **decidim-core**: Allow customizing SMTP settings for seed data [\#7183](https://github.com/decidim/decidim/pull/7183) -- **decidim-elections**: Create Votings participatory space [\#7145](https://github.com/decidim/decidim/pull/7145) -- **decidim-elections**: Manage Votings [\#7160](https://github.com/decidim/decidim/pull/7160) -- **decidim-dev**, **decidim-elections**: Add the key ceremony [\#6967](https://github.com/decidim/decidim/pull/6967) -- **decidim-core**, **decidim-forms**: Create file uploads question type [\#7192](https://github.com/decidim/decidim/pull/7192) -- **decidim-debates**: Revert "Archive Debates (#6940)" [\#7214](https://github.com/decidim/decidim/pull/7214) -- **decidim-elections**: Add API types for votings [\#7222](https://github.com/decidim/decidim/pull/7222) -- **decidim-elections**: Open and close the Bulletin Board ballot box for elections [\#7035](https://github.com/decidim/decidim/pull/7035) -- **decidim-elections**: Add Vote verification client [\#7056](https://github.com/decidim/decidim/pull/7056) -- **decidim-elections**: Manage attachments in a voting [\#7175](https://github.com/decidim/decidim/pull/7175) -- **decidim-elections**: Add default help texts for votings [\#7174](https://github.com/decidim/decidim/pull/7174) -- **decidim-accountability**: Add attachments to accountability results [\#6851](https://github.com/decidim/decidim/pull/6851) -- **decidim-elections**: Prevent destroying an election component when elections are present [\#7235](https://github.com/decidim/decidim/pull/7235) -- **decidim-elections**: Ensure election data is sent to BB in the default locale [\#7069](https://github.com/decidim/decidim/pull/7069) -- **decidim-admin**: Add CTA buttons to Moderation report page [\#7227](https://github.com/decidim/decidim/pull/7227) -- **decidim-admin**: Display error message in case that justification length is less than specified characters [\#7173](https://github.com/decidim/decidim/pull/7173) -- **decidim-proposals**: Simplify collaborative drafts wizard [\#7239](https://github.com/decidim/decidim/pull/7239) -- **decidim-elections**: Add the votings content block in Homepage [\#7194](https://github.com/decidim/decidim/pull/7194) -- **decidim-core**: Add private message link to proposal author tooltip [\#7207](https://github.com/decidim/decidim/pull/7207) -- **decidim-elections**: Improve vote process [\#7229](https://github.com/decidim/decidim/pull/7229) -- **decidim-proposals**: Proposal preview with full text and attachments [\#7248](https://github.com/decidim/decidim/pull/7248) -- **decidim-elections**: Define voting type [\#7217](https://github.com/decidim/decidim/pull/7217) -- **decidim-elections**: Ensure Bulletin Board is configured for trustee zone [\#7074](https://github.com/decidim/decidim/pull/7074) -- **decidim-budgets**: Admin panel budgets count users with finished and pending votes [\#7195](https://github.com/decidim/decidim/pull/7195) -- **decidim-initiatives**: Include area in initiatives export [\#7242](https://github.com/decidim/decidim/pull/7242) -- **decidim-elections**: Add Polling Stations to Votings [\#7300](https://github.com/decidim/decidim/pull/7300) -- **decidim-initiatives**: Add optional order for initiative content block [\#7047](https://github.com/decidim/decidim/pull/7047) -- **decidim-initiatives**: Notification to initiative authors / promotor committee [\#7028](https://github.com/decidim/decidim/pull/7028) -- **decidim-admin**: Add sorting for “Number of reports” column on Reported users page [\#7279](https://github.com/decidim/decidim/pull/7279) -- **decidim-assemblies**: Add new statistics design to Assemblies [\#7275](https://github.com/decidim/decidim/pull/7275) -- **decidim-elections**: Add the tally process [\#7268](https://github.com/decidim/decidim/pull/7268) -- **decidim-forms**: Max characters for questionnaire answers [\#7314](https://github.com/decidim/decidim/pull/7314) -- **decidim-comments**: Notify users when their comments are voted [\#7055](https://github.com/decidim/decidim/pull/7055) -- **decidim-elections**: Let user change their vote in an Election [\#7262](https://github.com/decidim/decidim/pull/7262) -- **decidim-core**: Add notification setting: emails on moderations [\#7328](https://github.com/decidim/decidim/pull/7328) -- **decidim-admin**, **decidim-proposals**: Import proposals from a spreadsheet [\#7084](https://github.com/decidim/decidim/pull/7084) -- **decidim-meetings**: Add "my activity" filter section on meeting index [\#7261](https://github.com/decidim/decidim/pull/7261) -- **decidim-core**, **decidim-proposals**: Allow multiple lines in announcement block [\#7341](https://github.com/decidim/decidim/pull/7341) -- **decidim-admin**, **decidim-core**: Show session timeout warning and limit sessions to 30min of inactivity [\#7282](https://github.com/decidim/decidim/pull/7282) -- **decidim-admin**, **decidim-core**: Detect the use of spam-bots and ban non compliant users (part 4) [\#6941](https://github.com/decidim/decidim/pull/6941) -- **decidim-elections**: Add Polling Officers to Voting [\#7315](https://github.com/decidim/decidim/pull/7315) -- **decidim-meetings**: Add filter help in all the meetings navigation page [\#7355](https://github.com/decidim/decidim/pull/7355) -- **decidim-elections**: Votings public index [\#7284](https://github.com/decidim/decidim/pull/7284) -- **decidim-elections**: Add admin users query for voting [\#7391](https://github.com/decidim/decidim/pull/7391) -- **decidim-elections**: Add election statistics [\#7258](https://github.com/decidim/decidim/pull/7258) -- **decidim-admin**, **decidim-elections**: Manage voting landing page with content blocks [\#7331](https://github.com/decidim/decidim/pull/7331) -- **decidim-proposals**: Let admins delete proposal attachments [\#7259](https://github.com/decidim/decidim/pull/7259) -- **decidim-assemblies**, **decidim-participatory processes**: Add assemblies & processes weight field [\#7283](https://github.com/decidim/decidim/pull/7283) -- **decidim-elections**: Assign Polling Officers to Polling Stations [\#7344](https://github.com/decidim/decidim/pull/7344) -- **decidim-elections**: Add Monitoring Committee to Voting [\#7396](https://github.com/decidim/decidim/pull/7396) -- **decidim-initiatives**: Raise an alert when there's an error signing an initiative [\#7412](https://github.com/decidim/decidim/pull/7412) -- **decidim-elections**: Filter Polling Stations by Polling Officers assigned/not assigned [\#7415](https://github.com/decidim/decidim/pull/7415) -- **decidim-elections**: Filter and search polling officers [\#7411](https://github.com/decidim/decidim/pull/7411) -- **decidim-api**: Add default order by ID to API list queries [\#7424](https://github.com/decidim/decidim/pull/7424) -- **decidim-api**: Further default orders for the API [\#7436](https://github.com/decidim/decidim/pull/7436) -- **decidim-elections**: Voting: show callout when Polling Stations miss Polling Officers [\#7417](https://github.com/decidim/decidim/pull/7417) -- **decidim-elections**: Add Polling Officer Zone [\#7439](https://github.com/decidim/decidim/pull/7439) -- **decidim-assemblies**: Add order in not highlighted assemblies by weight [\#7444](https://github.com/decidim/decidim/pull/7444) -- **decidim-elections**: Add Votings to Open Data export [\#7388](https://github.com/decidim/decidim/pull/7388) -- **decidim-proposals**: Feature proposal infinite edit time [\#7406](https://github.com/decidim/decidim/pull/7406) +- **decidim-conferences**, **decidim-core**, **decidim-meetings**: Add CSS selectors to emails to improve design customization [\#7493](https://github.com/decidim/decidim/pull/7493) +- **decidim-elections**: Audit vote [\#7442](https://github.com/decidim/decidim/pull/7442) +- **decidim-core**: Let installations delay TranslatorJob initialization [\#7507](https://github.com/decidim/decidim/pull/7507) +- **decidim-budgets**: Add share modal to budgets [\#7519](https://github.com/decidim/decidim/pull/7519) +- **decidim-elections**: Add Votings landing page layout [\#7440](https://github.com/decidim/decidim/pull/7440) +- **decidim-assemblies**, **decidim-conferences**, **decidim-consultations**, **decidim-core**, **decidim-elections**, **decidim-participatory processes**, **decidim-sortitions**, **decidim-surveys**: Add statistics cell to votings landing page and reuse it in other places [\#7413](https://github.com/decidim/decidim/pull/7413) +- **decidim-elections**: Add support for ElectionGuard voting scheme [\#7454](https://github.com/decidim/decidim/pull/7454) +- **decidim-core**: Replace xls with xlsx [\#7421](https://github.com/decidim/decidim/pull/7421) +- **decidim-blogs**: Create blog posts as user group [\#7425](https://github.com/decidim/decidim/pull/7425) +- **decidim-meetings**: Custom message in meeting registration email [\#7416](https://github.com/decidim/decidim/pull/7416) +- **decidim-elections**: See remaining time for voting in election [\#7611](https://github.com/decidim/decidim/pull/7611) +- **decidim-elections**: Mockup design for Check participating rights in a voting [\#7623](https://github.com/decidim/decidim/pull/7623) +- **decidim-core**: Add proper ARIA roles for header and footer [\#7658](https://github.com/decidim/decidim/pull/7658) +- **decidim-comments**: Remove custom focus outlines/backgrounds from the comments elements [\#7656](https://github.com/decidim/decidim/pull/7656) +- **decidim-core**: Add reason fieldset to the report modal for accessibility [\#7665](https://github.com/decidim/decidim/pull/7665) +- **decidim-comments**, **decidim-core**: Add aria-atomic="true" to the alert role elements [\#7666](https://github.com/decidim/decidim/pull/7666) - **decidim-meetings**: Display map and link for hybrid meetings [\#7065](https://github.com/decidim/decidim/pull/7065) +- **decidim-budgets**, **decidim-comments**, **decidim-core**: Use comments counter cache instead of additional query [\#7627](https://github.com/decidim/decidim/pull/7627) +- **decidim-admin**, **decidim-core**, **decidim-system**: Add accessibility labels to the `