-
Notifications
You must be signed in to change notification settings - Fork 437
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
Restrict teams features based on org status #2897
base: main
Are you sure you want to change the base?
Conversation
Uffizzi Ephemeral Environment
|
@@ -18,4 +18,5 @@ defmodule LivebookProto.AgentConnected do | |||
json_name: "appDeployments" | |||
|
|||
field :agents, 9, repeated: true, type: LivebookProto.Agent | |||
field :org_active, 10, type: :bool, json_name: "orgActive" |
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, we have a dependency issue here. We need to either:
- Deploy Teams with this before we publish a new Livebook version
- Rename field to
org_disabled : bool
or something likeorg_status : active | disabled
The reason is the default value for booleans is false
so if Teams is not sending this value it is considered false
which would block Teams features. The DSL allows a default: true
, which would be my preference, but that is not available on proto3.
I guess option 1 is fine, option 2 with :org_status
could be more future proof though. @jonatanklosko @josevalim @hugobarauna Thoughts?
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.
Making it an enum is probably going to be better in the long term?
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.
Lines 164 to 174 in 04a93c0
/** | |
* We're only using Enum in this case because | |
* the Client is the source of the information, | |
* and the Server will always be up-to-date. | |
* | |
* Otherwise, it shouldn't be used. | |
*/ | |
enum AppDeploymentStatusType { | |
preparing = 0; | |
available = 1; | |
} |
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 are going to deploy Teams first anyway (1.), otherwise the new Livebook release would probably have issues, 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.
Yes, correct. We always need to deploy Livebook Teams first before we release a new Livebook. But if anyone uses main or nightly build, then it will be fully broken saying they need to pay. That's why we may also want to have an enum with better defaults? Or the enum would be broken as well?
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 couldn't we return more values in the future? Is that Protobuf limitation or it's depend on us how we treat incoming values (e.g. exhaustive case/2 on exact values)?
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.
So let's ship with the inverse for now: inactive
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 couldn't we return more values in the future? Is that Protobuf limitation or it's depend on us how we treat incoming values (e.g. exhaustive case/2 on exact values)?
The protobuf library would keep an unknown value, but it would be an integer (see commit message in elixir-protobuf/protobuf@6b8f40f). Leaking the integer to the rest of the application is probably a bad idea, so we would need to account for the unknown value early. In some cases this could be as simple as picking a default value, but here I'm not sure if that's clear. Using strings has the benefit that it's safer to keep them around, but it mostly pushes the catch all and default behaviour problem to other parts of the app.
I don't remember if there was a specific scenario behind the AppDeploymentStatusType
comment though.
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.
Im gonna go with inactive bool flag then. Though if anyone prefers can call it disabled
, lmk. Thanks everyone!
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.
Sounds good to me!
7a654e8
to
05045c7
Compare
No description provided.