Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the Figaro gem dependency #394

Open
malparty opened this issue Feb 23, 2023 · 6 comments
Open

Remove the Figaro gem dependency #394

malparty opened this issue Feb 23, 2023 · 6 comments

Comments

@malparty
Copy link
Member

malparty commented Feb 23, 2023

Why

In order to unlock #316 (Update Ruby 3.1).

  • The Figaro gem did not receive any update since 3 years and prevents us from updating the Ruby version
  • Rails 7 projects now use default fallback values in the database.yml file (in case the ENV variable is not set). See this example
  • We already have a .env file for other default non-sensitive variables (the application.yml is actually confusing)

Resources

See #400 as reference of a first tentative.

Who Benefits?

Developers will be less confused about where the ENV default should go. Developers with the future possibility of using the next Ruby versions.

@andyduong1920
Copy link
Member

@malparty any update on this issue

@malparty
Copy link
Member Author

malparty commented Jun 2, 2023

@andyduong1920 I'm struggling with tests, the containers won't build and I'm yet to understand why. Looking for debugging this when I have free time 🏃

@malparty
Copy link
Member Author

malparty commented Jun 6, 2023

@andyduong1920 Update: I'm still struggling. I moved forward as the tests can execute to a much further step. But I still get errors about containers not reachable (even if previous tests where working with these containers).

The 2 main issues:

     Docker::Error::ConflictError:
       {"message":"Container 7e1f7573816916e3985b90b670453c7417575c03cc97928c9baa03ecc06b50b5 is not running"}
       
     # ./spec/base/config/environments/development_spec.rb:15:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # Excon::Error::Conflict:
     #   Expected([200, 201, 202, 203, 204, 301, 304]) <=> Actual(409 Conflict)
     #   ./spec/base/config/environments/development_spec.rb:15:in `block (2 levels) in <top (required)>'
# ./spec/rails_helper.rb:13:in `<top (required)>'
# ./spec/codebase/codebase_spec.rb:3:in `require'
# ./spec/codebase/codebase_spec.rb:3:in `<top (required)>'
# ------------------
# --- Caused by: ---
# PG::ConnectionBad:
#   could not connect to server: Connection refused
#   	Is the server running on host "127.0.0.1" and accepting
#   	TCP/IP connections on port 5432?
#   could not connect to server: Cannot assign requested address
#   	Is the server running on host "::1" and accepting
#   	TCP/IP connections on port 5432?
#   /bundle/ruby/3.0.0/gems/pg-1.5.3/lib/pg/connection.rb:696:in `async_connect_or_reset'
No examples found.

I should admit that the current structure of the template (full containerized without a command to run this locally) makes debugging really time consuming 🥲

@andyduong1920
Copy link
Member

In case we merged the #419 which use the new Figaro fork version, not sure we would need to remove the Figaro gem or not ;)

@malparty
Copy link
Member Author

malparty commented Jul 4, 2023

@andyduong1920 as this forked version has no guarantee to be maintained and has only a few stars, I think it might be better to use DotEnv in the long run.

I see the forked version as a transient improvement only: it is much better than the old Figaro, yet it does not solve the root issue of poor maintenance and a small community.

@andyduong1920
Copy link
Member

@malparty yeah, we can remove the Figaro way @malparty 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants