From 0c9522f495fae09a8bafaf481b314d042c122683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Bol=C3=ADvar?= Date: Thu, 17 Oct 2024 11:42:53 +0200 Subject: [PATCH] CiviCRM API v4 compatibility (#126) * Use CiviCRM API v4 * Change secrets for develoment and test envs * Bump decidim-civicrm version * Fix CI * Bump decidim-civicrm version * Bump decidim-civicrm version --- .github/workflows/test.yml | 12 ++++++++++++ config/initializers/civicrm.rb | 3 ++- config/secrets.yml | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2b76fc..38eea02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,6 +53,18 @@ jobs: with: chrome-version: ${{ env.CHROME_VERSION }} + - name: List Chrome + shell: "bash" + run: apt list --installed | grep chrome + + - name: Remove Chrome + shell: "bash" + run: sudo apt remove google-chrome-stable + + - uses: browser-actions/setup-chrome@v1 + with: + chrome-version: 119.0.6045.105 + - name: Setup & create Database run: | bundle exec rails db:create db:schema:load diff --git a/config/initializers/civicrm.rb b/config/initializers/civicrm.rb index 3b6354d..e69acb5 100644 --- a/config/initializers/civicrm.rb +++ b/config/initializers/civicrm.rb @@ -5,7 +5,8 @@ config.api = { key: Rails.application.secrets.dig(:civicrm, :api, :key), secret: Rails.application.secrets.dig(:civicrm, :api, :secret), - url: Rails.application.secrets.dig(:civicrm, :api, :url) + url: Rails.application.secrets.dig(:civicrm, :api, :url), + version: Rails.application.secrets.dig(:civicrm, :api, :version) } # Configure omniauth secrets diff --git a/config/secrets.yml b/config/secrets.yml index 98a940c..140dcd6 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -180,6 +180,7 @@ default: &default url: <%= ENV["CIVICRM_VERIFICATION_URL"] %> key: <%= ENV["CIVICRM_VERIFICATION_API_KEY"] %> secret: <%= ENV["CIVICRM_VERIFICATION_SECRET"] %> + version: <%= ENV["CIVICRM_API_VERSION"] %> auto_sync_groups: [ 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 40, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149 ] private_processes: - slug: inscrites-alt-pirineu @@ -321,6 +322,7 @@ development: url: <%= ENV["CIVICRM_VERIFICATION_URL"] %> key: <%= ENV["CIVICRM_VERIFICATION_API_KEY"] %> secret: <%= ENV["CIVICRM_VERIFICATION_SECRET"] %> + version: <%= ENV["CIVICRM_API_VERSION"] %> auto_sync_groups: [40] private_processes: - slug: inscrites-alt-pirineu @@ -360,6 +362,7 @@ test: url: https://api.base key: api-key secret: secret + version: V3 elections: <<: *elections_default bulletin_board_server: <%= Decidim::Env.new("ELECTIONS_BULLETIN_BOARD_SERVER", 'http://bulletin-board.lvh.me:5017/api').to_s %>