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

Override time_zone to be UTC in publishing-api #2786

Conversation

richardTowers
Copy link
Contributor

@richardTowers richardTowers commented Jun 26, 2024

Note the target branch for this PR is the dependabot govuk_app_config upgrade branch - we should merge that after this.

govuk_app_config sets the timezone to London in an initializer, on the theory that it should be London in all GOV.UK apps. However, as an API, publishing-api pretty much always wants to render times in UTC, and never in the London timezone. So the default of London doesn't feel correct here. An attempt was made at being explicit about using UTC everywhere in #2781, but it felt very fragile and overcomplicated.

It's a bit tricky to override the default set by govuk_app_config, because the code needs to run between the initializer govuk_app_config defines, and the active_support initializer which actually sets the timezone. In future we might want to make this a bit easier with a change to govuk_app_config, but it's not immediately clear how to do that, and for now this code should be a reliable way of keeping UTC in publishing-api.

Most of the other apps (including APIs) have already switched to the London timezone without issue. So it seems like publishing-api might be the only exception. There are a few apps with one or two failing tests, but those should be fixable (example - alphagov/content-data-api#2113).

https://trello.com/c/9EFyZapD

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

@richardTowers richardTowers marked this pull request as ready for review June 27, 2024 14:37
@dependabot dependabot bot deleted the branch dependabot/bundler/govuk_app_config-9.12.0 June 28, 2024 19:27
@dependabot dependabot bot closed this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants