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

Make #admin_domain private and fix DomainSubstitution deprecation warnings #3001

Merged
merged 14 commits into from Jul 19, 2022

Conversation

josemigallas
Copy link
Contributor

@josemigallas josemigallas commented Jun 29, 2022

TLDR (too long don't review)

  • admin_domain -> internal_admin_domain / external_admin_domain
  • self_domain -> internal_admin_domain / external_admin_domain
  • match_internal_self_domain? -> match_internal_admin_domain?
  • domain -> internal_domain / external_domain

"internal" domain reads directly from DB (internal use) whereas "external" domain is meant to be exposed in UI and API responses (external use)

@josemigallas josemigallas self-assigned this Jun 29, 2022
@josemigallas josemigallas force-pushed the deprecations/domain_substitution_account branch 2 times, most recently from f217251 to 2871f97 Compare June 30, 2022 08:36
@josemigallas josemigallas marked this pull request as ready for review June 30, 2022 16:09
@josemigallas josemigallas changed the title Fixes deprecation warnings from ThreeScale::DomainSubstitution Make #admin_domain private and fix DomainSubstitution deprecation warnings Jun 30, 2022
@josemigallas josemigallas force-pushed the deprecations/domain_substitution_account branch 8 times, most recently from cdd4b66 to bbd1a6c Compare July 4, 2022 10:38
lib/developer_portal/lib/liquid/drops/provider.rb Outdated Show resolved Hide resolved
doc/liquid/drops.html Outdated Show resolved Hide resolved
doc/liquid/drops.md Outdated Show resolved Hide resolved
lib/developer_portal/lib/liquid/drops/site.rb Outdated Show resolved Hide resolved
@@ -361,6 +361,7 @@ def setup

assert_equal "amazing-name-123.#{ThreeScale.config.superdomain}", account.domain
assert_equal "amazing-name-123-admin.#{ThreeScale.config.superdomain}", account.internal_admin_domain
assert_equal "amazing-name-123-admin.#{ThreeScale.config.superdomain}", account.external_admin_domain
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@akostadinov
Copy link
Contributor

I think lines ThreeScale::Deprecation.silence need to be removed from #external_admin_domain and #internal_admin_domain.

@josemigallas josemigallas force-pushed the deprecations/domain_substitution_account branch from e94c2e0 to b534f4c Compare July 5, 2022 07:09
app/controllers/partners/providers_controller.rb Outdated Show resolved Hide resolved
app/controllers/provider/domains_controller.rb Outdated Show resolved Hide resolved
app/events/domains/provider_domains_changed_event.rb Outdated Show resolved Hide resolved
app/mailers/notification_mailer.rb Outdated Show resolved Hide resolved
app/messengers/cinstance_messenger.rb Outdated Show resolved Hide resolved
app/messengers/plans_messenger.rb Outdated Show resolved Hide resolved
app/models/account/provider_domains.rb Outdated Show resolved Hide resolved
- #external_self_domain
- #internal_self_domain
- #self_domain
- #admin_domain
- #domain

in favor of:
- internal_admin_domain
- external_admin_domain
- internal_domain
- external_domain
@josemigallas josemigallas force-pushed the deprecations/domain_substitution_account branch from b534f4c to 47c5d55 Compare July 7, 2022 10:23
app/views/shared/_buyer_menu.html.erb Outdated Show resolved Hide resolved
app/workers/delete_account_hierarchy_worker.rb Outdated Show resolved Hide resolved
lib/developer_portal/lib/site_account_support.rb Outdated Show resolved Hide resolved
lib/routing_constraints.rb Outdated Show resolved Hide resolved
lib/three_scale/domain_substitution.rb Outdated Show resolved Hide resolved
lib/three_scale/domain_substitution.rb Outdated Show resolved Hide resolved
@@ -1,4 +1,4 @@
<% unless request.host == site_account.admin_domain %>
<% unless request.host == site_account.external_admin_domain%>
Copy link
Contributor

Choose a reason for hiding this comment

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

I doubt in this case, as I am not sure if request.host is supposed to be before or after substitution...
But on the other hand, I couldn't even find where this partial is used, I guess it might not be used anywhere.

Copy link
Contributor

@mayorova mayorova left a comment

Choose a reason for hiding this comment

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

LGTM 👍
If the domain substitution feature is ever going to be used in non-dev environment, it might be possible we will find some edge case that was not treated properly. But as there are no plans at the moment, I think it's good enough!

@josemigallas josemigallas merged this pull request into rails Jul 19, 2022
@josemigallas josemigallas deleted the deprecations/domain_substitution_account branch July 19, 2022 06:14
akostadinov pushed a commit that referenced this pull request Jul 19, 2022
…nings (#3001)

[domain_substitution] makes #admin_domain private and stop using self_domain/domain in favor of internal/external versions (THREESCALE-8523)
akostadinov pushed a commit that referenced this pull request Aug 5, 2022
…nings (#3001)

[domain_substitution] makes #admin_domain private and stop using self_domain/domain in favor of internal/external versions (THREESCALE-8523)
akostadinov pushed a commit that referenced this pull request Aug 8, 2022
…nings (#3001)

[domain_substitution] makes #admin_domain private and stop using self_domain/domain in favor of internal/external versions (THREESCALE-8523)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants