-
Notifications
You must be signed in to change notification settings - Fork 74
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
Display a deprecated message when Service uses plugin deployment #1391
Conversation
9d47b95
to
0a41e06
Compare
Codecov Report
@@ Coverage Diff @@
## master #1391 +/- ##
==========================================
+ Coverage 89.77% 92.05% +2.28%
==========================================
Files 2185 2392 +207
Lines 67076 76259 +9183
==========================================
+ Hits 60215 70203 +9988
+ Misses 6861 6056 -805
Continue to review full report at Codecov.
|
0a41e06
to
f6c5bef
Compare
f6c5bef
to
a8a2f91
Compare
c1d0fb8
to
9c3db75
Compare
app/models/service.rb
Outdated
|
||
# TODO: Remove this when no one use plugins | ||
def deployment_option | ||
return 'hosted' if plugin_deployment? |
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 think it should be self_managed
People using plugin do not really have any apicast in front. It would enforce them to have one hosted
Also zync will create a route automatically in OpenShift if it is hosted
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’d say the logical setting is what you get out of the box when you install 3scale. That would be 3scale managed. Other question is if it would work.
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.
OK but anyway there are many references to deployment_option in the code
I'd prefer just updating the database and remove the plugins from the code.
For example, I do not know if we will show the policies or the mapping rules because of this change.
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.
This is an effort to have something for 2.7.
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.
Yes, everything is shown as if 3scale managed APIcast was being used. And when the customer clicks ok, setting will actually be updated in db. I agree this is not the final solution but it is kind of a nice in between with heads up to customer. Next step is remove all of it.
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.
We can remove the code later but a data migration (DML) should be done IMO
Anyway plugins are not shown anymore right?
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.
They are still shown (I just verified), deprecation notice was already issued long time ago. This is adding more work and has really unknown behaviours
Also this undesirable behaviour is worse than leaving it there: Zync will just create routes if it is hosted unlike before while it was still plugin.
If we just display the message and not touch the deployment_option
method I would merge the PR.
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.
Why is it wrong that zync creates the routes? If they change to apicast because they want to that would also happen, no?
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.
It is a change of behaviour without notice zync will create tons of routes ...
Not to mention that some users reported that already 3scale/zync#236
If they want to use the hosted gateway yes, but they might also want to use the self managed gateway or the service mesh.
Agree that it makes sense to have default to hosted but I'd say the timing is pretty bad to take this decision ...
EDIT: in fact I would make it self_managed
instead of hosted
because plugins are in a sense self managed by the customer.
@@ -0,0 +1,7 @@ | |||
- if @service&.plugin_deployment? |
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 do not get why the nil check
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.
There were some controllers Api::MetricsController
that used this layout but didn't loaded the service in the variable.
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.
This smells then :)
app/models/service.rb
Outdated
# TODO: Remove this when no one use plugins | ||
def plugin_deployment? | ||
deployment = self[:deployment_option] | ||
DeploymentOption.plugins.include?(deployment) |
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.
And here I thought Rubysts were allergic to parenthesis!
DeploymentOption.plugins.include?(deployment) | |
DeploymentOption.plugins.include? deployment |
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 hate to omit the parenthesis
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.
Let's make this PR about updating the deprecation message only and send another one for the actual removal of the code, which may not fit 2.7 release.
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.
Please just show the message and do not touch the deployment_option
method.
Quoted from Hery:
|
THREESCALE-2395 Our plugin deployment option is deprecated. To avoid needing some data migration in database, this commit sets the deployment option as hosted if the current option is set to plugins and also displays a message to the user to update their configuration.
THREESCALE-2395 Our plugin deployment option is deprecated. To avoid needing some data migration in database, this commit sets the deployment option as hosted if the current option is set to plugins and also displays a message to the user to update their configuration.
9f6d191
136fb60
to
9f6d191
Compare
THREESCALE-2395
Our plugin deployment option is deprecated. To avoid needing some data migration in database, this commit sets the deployment option as hosted if the current option is set to plugins and also displays a message to the user to update their configuration.