alphagov / trade-tariff-backend

Enabling the population and distribution via API of UK Customs tariffs and duties
MIT License
7 stars 6 forks source link

Remove FACTER_govuk_platform #181

Closed samjsharpe closed 10 years ago

samjsharpe commented 10 years ago

This environment variable is set by puppet. It should not be used by applications and it is being removed from our environment.

I have:

This fixes #179

matthewford commented 10 years ago

@samjsharpe If this is going - I am happy to merge this just sad :panda_face: as then we will not be able to distinguish sync error email by platform.

samjsharpe commented 10 years ago

You can't do that anyway... In all our environments except development and ci, govuk_platform is already set to 'production' so from the application perspective .platform is almost always production.

samjsharpe commented 10 years ago

I audited the current value of FACTER_govuk_platform in all our environments: https://github.com/alphagov/whitehall/commit/08c124743701b0019d0fce88e245c1c2e523351c

There are ways to distinguish environments, as the ORGANISATION env var is available on the deploy jenkins machines as that's how we can specify different initializers per organisation.

I think that's actually how you are currently distinguishing between emails:

[alphagov-deployment/trade-tariff-backend:master●]$ grep MAILER_ENV initializers_by_organisation/*/mailer_env.rb
initializers_by_organisation/preview/mailer_env.rb:MAILER_ENV="preview"
initializers_by_organisation/production/mailer_env.rb:MAILER_ENV="production"
initializers_by_organisation/staging/mailer_env.rb:MAILER_ENV="staging"
matthewford commented 10 years ago

@samjsharpe I've rebased your branch - we can merge this in as we now store the sync errors in the db to be viewed in the admin interface, so the platform is less of an issue. Typically if there is a problem it is happening on all envs anyway.

Ideally we replace this with a constant that is set on alphagov-deployment for clarity.

matthewford commented 10 years ago

Just reread the comment about MAILER_ENV so ignore that last part of my previous comment