decidim-vocdoni / decidim-module-vocdoni

(WIP) A module for Decidim that brings an elections component based on the Vocdoni SDK and API
GNU Affero General Public License v3.0
8 stars 0 forks source link

Allow to configure the module with ENV vars #63

Closed microstudi closed 1 year ago

microstudi commented 1 year ago

Thi PR allows to configure the module using ENV vars. Also documents that in the README:


By default, the module is configured to read the configuration from ENV variables.

Currently, the following ENV variables are supported:

ENV variable Description Default value
VOCDONI_API_ENDPOINT_ENV The environment of the Vocdoni API. Only two values are accepted: dev, stg. Read more on Vocdoni SDK Usage Environment stg
VOCDONI_MINUTES_BEFORE_START How many minutes should the setup be run before the election starts 10

It is also possible to configure the module using the decidim-vocdoni initializer:

Decidim::Vocdoni.configure do |config|
  config.api_endpoint_env = "stg"
  config.setup_minimum_minutes_before_start = 20
end
codecov[bot] commented 1 year ago

Codecov Report

Merging #63 (ad4447a) into main (487a6c0) will decrease coverage by 0.05%. The diff coverage is 87.50%.

:exclamation: Current head ad4447a differs from pull request most recent head 05c375f. Consider uploading reports for the commit 05c375f to get more accurate results

@@            Coverage Diff             @@
##             main      #63      +/-   ##
==========================================
- Coverage   92.09%   92.05%   -0.05%     
==========================================
  Files          84       84              
  Lines        1582     1585       +3     
==========================================
+ Hits         1457     1459       +2     
- Misses        125      126       +1     
Impacted Files Coverage Δ
lib/decidim/vocdoni.rb 94.11% <80.00%> (-5.89%) :arrow_down:
...trollers/concerns/decidim/vocdoni/has_vote_flow.rb 93.33% <100.00%> (ø)
app/forms/decidim/vocdoni/admin/setup_form.rb 100.00% <100.00%> (ø)
app/models/decidim/vocdoni/election.rb 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

microstudi commented 1 year ago

@andreslucena if you can look a this, should be quick. Spec failing is due a change in Vocdoni API it seems. We are trying to solve it in another PR (#61 )

andreslucena commented 1 year ago

Spec failing is due a change in Vocdoni API it seems. We are trying to solve it in another PR (#61 )

I've merged #64 that already solved the problem in the CI, can you merge with develop 🙏🏽 ? Thanks

andreslucena commented 1 year ago

Also, I forgot to mention that I tried it locally and it works well!!