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

Simplify staging/preproduction environment files #4875

Merged
merged 3 commits into from
Jul 20, 2022
Merged

Conversation

javierm
Copy link
Member

@javierm javierm commented Jul 20, 2022

References

  • We applied some changes to the production environment file in commit eb36b7e which we forgot to add to the staging and preproduction
  • These changes will make pull request Upgrade to Rails 6.0 #4874 easier to implement

Objectives

  • Remove duplication between the preproduction and staging environment configuration files
  • Make the staging environment configuration consistent with the production environment one

Notes

After these changes, the staging and production environments are mostly identical, and we could simply require the production environment configuration in the staging.rb file. We aren't doing so because we're doing changes affecting the preproduction environment and, since Consul installations might have customized these files, it would be hard for them to deal with all those changes at once.

Release notes

⚠️ Other than the standard production, development and test environments, CONSUL offers the option to setup both staging and preproduction environments. If you're using the preproduction environment (which is not the staging environment), note we're now using the same configuration for preproduction and staging environments. If your config/environments/preproduction.rb is not identical to your config/environments/staging.rb, you'll have to change the former in order to include the differences (or you can also choose to base it on your production environment instead). If you're using the staging environment but not the preproduction one (or you aren't using either of them), ignore this warning.

We were already doing so by duplicating the code; now we're doing it
explicitly.

This is going to help because we're going to do a few changes in the
environment files, and this way we don't have to do everything twice.

Note that, after we're finished with these changes, the staging and
production environments will be mostly identical and we could simply
require the production environment configuration in the `staging.rb`
file. We aren't doing so because some Consul installations might have
customized these files and it'd be hard for them to deal with all these
changes at once. So, for now, they'll only have to deal with the
possible differences between their staging and preproduction
environments.

Changes to the preproduction environment that won't be applied to the
staging environment can be added like this:

require Rails.root.join("config", "environments", "staging")

Rails.application.configure do
  config.log_level = :warn
end
We removed the assets initializer in commit 91cd1ce.
We changed the structure of the production environment file in commit
eb36b7e, but forgot to do so for staging and preproduction.

We're also changing the comments in the production environment file so
they use double quotes, like we do everywhere else.

After these changes, the staging and production environments are mostly
identical, and we could simply require the production environment
configuration in the `staging.rb` file. We aren't doing so because we've
just done changes affecting the preproduction environment and, since
Consul installations might have customized these files, it might be hard
for them to deal with all these changes at once.
Consul Democracy automation moved this from Reviewing to Testing Jul 20, 2022
@javierm javierm merged commit 8a1b5d5 into master Jul 20, 2022
Consul Democracy automation moved this from Testing to Release 1.6.0 Jul 20, 2022
@javierm javierm deleted the unify_environments branch July 20, 2022 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants