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

Update rails 7.1.2 #737

Merged
merged 13 commits into from Dec 13, 2023
Merged

Update rails 7.1.2 #737

merged 13 commits into from Dec 13, 2023

Conversation

alexdesi
Copy link
Contributor

Jira link

https://transformuk.atlassian.net/browse/HOTT-4624

What?

Update Rails from 7.0 to 7.1.2

NOTE: even though, raise_on_missing_translations was set to true on Rails 7.0,
it was not raising exceptions in case of missing translations.
@alexdesi alexdesi changed the title Hott 4624 update rails 7.1 Update rails 7.1.2 Dec 13, 2023
config/environments/test.rb Outdated Show resolved Hide resolved
jebw
jebw previously requested changes Dec 13, 2023
Copy link
Contributor

@jebw jebw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - couple of minor points to address and I think you need clarity on why force_ssl got turned off originally

Gemfile Show resolved Hide resolved
# config.assume_ssl = true

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config.force_ssl = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexdesi This is the same as frontend? If you're using this option, you'll need to enable assume_ssl I think ?

@willfish @amberstarlight I'm not familiar on why this wasn't working before but it does appear to be working without assume_ssl????

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This caused issues with the apply-terraform workflow, which uses the health check endpoint.
By the way, it is passing now, I'll check with @amberstarlight, in the FE I guess we need to coordinate the update and deployment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CDN and load balancer terminate SSL and reverse proxy onto the apps, yeah.

The deployment will fail with force_ssl = true and we should instead be using assume_ssl = true

https://github.com/trade-tariff/trade-tariff-platform-aws-terraform/blob/main/environments/common/application-load-balancer/alb.tf#L26-L36

The load balancer checks the health of the apps via these endpoints over http:

locals {
  services = {
    admin = {
      host             = ["admin.*"]
      healthcheck_path = "/healthcheckz"
    }

    signon = {
      host             = ["signon.*"]
      healthcheck_path = "/healthcheck/live"
    }

    backend_uk = {
      paths            = ["/uk/api/beta/*"]
      healthcheck_path = "/healthcheckz"
    }

    backend_xi = {
      paths            = ["/xi/api/beta/*"]
      healthcheck_path = "/healthcheckz"
    }

    duty_calculator = {
      paths            = ["/duty-calculator/*"]
      healthcheck_path = "/healthcheckz"
    }

    search_query_parser = {
      paths            = ["/api/search/*"]
      healthcheck_path = "/healthcheckz"
    }

    frontend = {
      paths            = ["/*"]
      healthcheck_path = "/healthcheckz"
    }
  }
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also set
config.assume_ssl = true
for the TT Admin

config/environments/test.rb Outdated Show resolved Hide resolved
Comment on lines +34 to +37
footnote_suffix = if uk_only
I18n.t("row_to_ni_measure_type_footnotes_suffixes.#{category}.uk_only.#{option.source}_html",
uk_only_text: uk_only_text_for(category, option, uk_option))
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a tiny refactor to make the row shorter and readable.

@alexdesi alexdesi merged commit 9d3a4de into main Dec 13, 2023
15 checks passed
@alexdesi alexdesi deleted the HOTT-4624-update-rails-7.1 branch December 13, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants