-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add namespace level capabilities #341
Add namespace level capabilities #341
Conversation
@@ -45,6 +45,14 @@ message NamespaceInfo { | |||
// A key-value map for any customized purpose. | |||
map<string, string> data = 5; | |||
string id = 6; | |||
// All capabilities the namespace supports. | |||
Capabilities capabilities = 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.
Can you confirm whether cloud supports DescribeNamespace
and therefore can also add capabilities here? If not, is this intentionally OSS only?
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.
Cloud supports DescribeNamespace
. This feature should work in OSS and Cloud.
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.
Can you confirm with cloud team before merging that this is acceptable to them?
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.
cloud does not censor the namespaceInfo object. Don't see a reason to censor capabilities at this point in time, so LGTM
@@ -45,6 +45,14 @@ message NamespaceInfo { | |||
// A key-value map for any customized purpose. | |||
map<string, string> data = 5; | |||
string id = 6; | |||
// All capabilities the namespace supports. | |||
Capabilities capabilities = 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.
Do all SDKs make a describe namespace call so they can get this kind of information? What if there are client capabilities? Even in the Go SDK doesn't call this until workers are created correct? I wonder if there are better ways to relay namespace-specific capabilities (maybe accepting a namespace
on GetSystemInfo
?)
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.
Currently GetSystemInfo
is not a namespace call. I think we'd need server and cloud to chime in on the scope of making it conditionally authorized by namespace.
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.
My fear is that not all SDKs make this call, and the ones that do only do it before worker start not at client dial time (because we allow people to use another namespace on the same client connection without any network calls in between). I think we can call this WorkerCapabilities
and feel a bit safer if whatever idea you have for putting in this field are worker specific.
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 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 don't expect the SDK to invoke this call.
I expect applications to use it though.
One of the use cases I had in mind is our features repo or other test frameworks that are designed to work with arbitrary server to disable certain tests when features are not implemented by the targeted server.
The UI is another example, it can use these capabilities to as feature flags.
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 that was my expectation 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.
👍 If we add those initial three capabilities listed later, that works for me.
|
||
// Namespace capability details. Should contain what features are enabled in a namespace. | ||
message Capabilities { | ||
} |
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.
You can already add eager_workflow_start, sync_update and async_update as the first set of capabilities.
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.
To confirm, it is ok if the SDK never calls this?
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.
Yeah, the SDK will get errors if it tries to use these APIs, the capabilities are meant to be used at the application layer.
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.
LGTM, but can you confirm with cloud that this is ok with them?
b5733db
to
31e523e
Compare
// Whether scheduled workflows are supported on this namespace. This is only needed | ||
// temporarily while the feature is experimental, so we can give it a high tag. |
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 one was an attempt at starting a list of capabilities. Maybe it should be moved into the new structure?
Also do we want to include versioning apis also? (we can have two fields for "v1" and "v2" since we're changing them)
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 don't think it is worth moving it at this point
I can include versioning APIs, but the items I have in this PR are just initial features we can always add more
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.
Okay. Looks good for now then
// Whether scheduled workflows are supported on this namespace. This is only needed | ||
// temporarily while the feature is experimental, so we can give it a high tag. |
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.
Okay. Looks good for now then
31e523e
to
368b973
Compare
Add a message to
NamespaceInfo
to include namespace level capabilities. Different then thecapabilities
returned byGetSystemInfoResponse
because those are scoped to a cluster where these are scoped to a namespace. I included the field inNamespaceInfo
since that is exposed for all users already and is already been used for similar feature flags in a less general way. This is scoped to server configs, not to include cloud account level configs.Is this intended to work in OS and Cloud
Yes
Who is intended to use this
Applications like UI (Not the SDKs internally)