Details
-
Task
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
Not Started
-
Engineering
-
-
Description
Issue
The heavy use of monkey patching is hindering development and introduces complexity, errors and bugs when testing in preview (OCP or VM)
Context
We use an obfuscated database of production for staging/preview.
However customer domains are not obfuscated and we would like it to stay like that for testing. investigation and bug fixing purpose.
In order to run the application in preview or locally, we modify request host on the fly:
https://github.com/3scale/porta/blob/ec3962a0b7de9357afa280bde39c90965a19e93b/app/lib/three_scale/dev_domain.rb
Any feature that relies on request.host should also know about this usage. Thus adding unrelated complexity to the feature:
Examples:
- https://github.com/3scale/porta/blob/ec3962a0b7de9357afa280bde39c90965a19e93b/app/lib/three_scale/oauth2/keycloak_client.rb#L84
- https://github.com/3scale/porta/blob/ec3962a0b7de9357afa280bde39c90965a19e93b/app/presenters/service_discovery_oauth_flow_presenter.rb#L26
- https://github.com/3scale/porta/blob/ec3962a0b7de9357afa280bde39c90965a19e93b/app/controllers/application_controller.rb#L223-L246
And many more ....
Also, it forbids some external library to work well in staging/preview preventing us to debug or test. sidekiq-web is not working well because of that.