Skip to content

Switch from Rails.application.secrets to Rails.application.credentials#13220

Closed
alecslupu wants to merge 8 commits intodevelopfrom
chore/migrate-credentials
Closed

Switch from Rails.application.secrets to Rails.application.credentials#13220
alecslupu wants to merge 8 commits intodevelopfrom
chore/migrate-credentials

Conversation

@alecslupu
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu commented Jul 27, 2024

🎩 What? Why?

This PR converts all Rails.application.secrets to Rails.application.credentials, in order to avoid displaying deprecation warnings once the upgrade to rails 7.1 is performed.

Testing

  1. All the pipeline should be green
  2. Using this branch, create a new development application
  3. Boot the application
  4. See everything works as intended.

♥️ Thank you!

github-actions[bot]
github-actions bot previously approved these changes Jul 27, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 27, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 27, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 27, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 27, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 27, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 27, 2024
@andreslucena
Copy link
Copy Markdown
Member

Hi! As we've talked in chat, we will not move forward with this one, as I don't think the Credentials API is useful for the Decidim use-case. Basically I think we should move forward with having a Decidim installation work better wtih a docker image, and for that we should keep moving to the ENV VAR configurations style (basically what is described at https://12factor.net/config)

Why I don't like Credentials for Decidim: As far as I understand how credentials work, it's adding more complexity to deployments. For us (developers) is not a problem, but for others (more junior developers, implementers that don't know much about Linux) they can be difficult to understand and work with. If the instructions say:

EDITOR=vim ./bin/rails credentials:edit --environment production

Then you need to explain people how to work with vim. There are lots of memes why vim isn't intuitive for newcomers ("how to exit vim" and such), so it's making the barrier of entry higher.

If we need to drop the Secrets API for the update, I'll think in the best way for an update path that's compatible with what we have:

  1. Using ENV VARs so we can keep things like https://docs.decidim.org/en/v0.28/configure/environment_variables
  2. Moving from Rails.application.secrets.decidim to another API but made by us. Maybe calling Decidim::Env directly in config/initializers/decidim.rb could be enough?

@alecslupu
Copy link
Copy Markdown
Contributor Author

Clsoing in favor of #13268

@alecslupu alecslupu closed this Aug 11, 2024
@alecslupu alecslupu deleted the chore/migrate-credentials branch August 11, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants