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
Use My Society's Mapit when running locally #1994
Conversation
GOV.UK hosts it's own version of Mapit. Unfortunately, that is only accessibly via the production and test environments, not locally. Until we can access Mapit locally, add a work around to make it possibly to manually test changes.
def mapit | ||
return GdsApi.mapit unless Rails.env.development? | ||
|
||
GdsApi::Mapit.new("https://mapit.mysociety.org/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to do this on a global level? ie. inside of the GDS API adapter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept it like that so it would still throw the same GdsApi errors, i.e. GdsApi::HTTPNotFound and GdsApi::HTTPClientError, otherwise that bit of the code will stop working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong but wouldn't it still keep these errors as we'll be instantiating with the same class?
Anyways, I think, for now, we can localise the change until we have something better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! sorry! I mis-read! You meant, put this inside of the gem! 🤦 Yes, it should be possible to do that, but I only envisioned this as a stop-gap. There's a bigger problem around how do we access Mapit data locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker but should we make this an environment variable?
Could do, but I'm not convinced it's worth the effort at the moment. |
GOV.UK hosts it's own version of Mapit. Unfortunately, that is only accessibly via the production
and test environments, not locally. Until we can access Mapit locally, add a work around to make it
possibly to manually test changes.
Merged changes are automatically deployed to staging and production.
Make sure you follow the guidance for deployments before you merge.
Check your branch is being deployed in the Release app, after merging.