-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Create an endpoint for telling the dashboard which features are available. #611
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
Comments
What if we do something like, |
Also, by default configuration is empty, but can contain whatever we want for other use cases. |
in JS non-existent means the same as false if you don't use |
But I don't think REST API should be impacted by language-specifics, right? |
Any language can detect a lack of keys or ignore keys it doesn't understand, it just happens to be really easy in JS (and python and ruby and most weakly typed languages. Of the strongly typed languages only Go does a half-decent job IMO, most other languages just use a Map<String,Object> or something similar and often detecting a missing key vs. a key set to null is not easy). There isn't actually much difference in what we are proposing anyway since the endpoint consumer will still have to detect a lack of keys. Essentially what we are discussing is 1) Should |
I think where I am coming from - in many languages it's actually easier to expect a single type compared to array or Boolean, so we might as well commit to having an empty configuration for when the feature is available, no feature and no configuration when it's not and custom key/values in the configuration of it needs it. Close close to ParseConfig architecture for REST or even generic Parse Object |
Thats true once the on-the-wire format has been parsed and validated. And parsing and validating an on-the-wire format while also attempting to keep both forwards and backwards compatibility isn't easy in strongly typed languages. You end up having to do way more validation in the parsing stage, write way more glue code that gets data from the on-the-wire format into your strong type, etc. |
The bigger point was actually about ParseConfig/ParseObject APIs, where this baby feel a little bit off. The approach is to purely generalize it. |
I had the object approach in mind as well. Something like this:
If a feature exists but is turned off we set What are your thoughts regarding backward compatibility and the long term use of this? This feature endpoint kind of feels like an experimentation end point where eventually you'll want to cleanup. For ex. always have scheduled and simple to be true for push. Since we have to make changes on both parse server and the dashboard for any schema change compatibility may not be a big deal. |
I would expect that some features will stay off forever for some users, eg. if we add support for scheduled push it will have to be optional in the push adapter for backwards compatibility. And some users will never switch to a push adapter that supports scheduled push because they just don't need it and don't want to change a working system. I agree somewhat about having to make changes on the server and dashboard simultaneously but I think it would be a good idea for us to get into the mindset that dashboard and server can evolve somewhat independently of one another, with non-linear additions of feature sets. Another use-case I think we should keep in mind is the one where you have an old app that doesn't have all the new features but you keep it running and apply patches, and a new app in active development, and you want to manage both of them from one dashboard. |
Updated Proposal: Parse Server:
Parse Dashboard:
I strongly believe we should separate out the UI from the parse server. Parse server simply returns the list of endpoints available and the version. Based on this information the dashboard can decide which features are possible. If [x, y, and z] are available we can then build feature A, otherwise it's not possible. On top of this the Dashboard has it's own config deciding which features are enabled. With this approach I think we'll be able to develop fairly independently. Addressing concerns: cc: @drew-gross any other community members we want to bring into the discussion? |
Where is the dashboard config stored? I don't think getting the version of the server solves the problem of people updating their push adapters though. Someone could be on the very latest version of the server and be using Urban Airship for push, but even the latest Urban Airship push adapter doesn't have scheduled push, then knowing the server version isn't enough to know if scheduled push is available. I agree with separating the UI from the server but I don't think endpoints alone is granular enough information for the dashboard to build the UI. I also disagree with sending the server version in the Breaking changes to the API should never happen. If they do happen, they can say so by reporting the feature as disabled, and the new API as enabled eg start with:
Then someone introduces a breaking change to the push API, and in the process updates the
|
The dashboard config will live in the dashboard repo. The options enables us to tell the dashboard what new features exist. It'll enable us to be granular enough in our description. Sending the version of the parse server would be more for info - not for feature detection. It could be used to check if the version expected is a major version off to consider updating their parse server just as example. We would not assume that version x.y.z has a specific set of features. Having In your push adapter example I'd propose something like this: Push:
On a side note I'm now starting to question weather we even need this endpoint. If we treat the server like an api. Our agreement of what is available should be through the rest guide of a specific version of parse server. Version 1.0.0 of Parse Dashboard supports version 2.1 of Parse Server. When we then support scheduled push: Version 1.1.0 of Parse Dashboard supports version 2.2 of Parse Server and etc. This approach runs into the issue of different versions of Parse Server which I think we can try solving a couple different ways and it removes any complexity of what this endpoint could turn into. |
Here is a gist with my new PoC format: https://gist.github.com/drew-gross/42639198fbd09a99c959
Why does it even need to exist then? Why not be in the code?
OK, this I can get behind
Yes we do want to avoid it, and we avoid it by not breaking backwards compatibility. It's like a major version in SemVer, but without the BS that comes from minor and patch versions.
Sure, that works
This is getting back into linear feature addition, which is exactly what I want to avoid. Parse Server doesn't support push. Parse Server, when configured with a push adapter, supports push. I think non-linear feature addition is something that we will really need to support, and using a single version number that only goes up means you are stuck with linear feature addition. |
Beautiful, format looks great. Also, in future dashboard might have feature support that are not there on the server, so gracefully handling missing feature and treating it as non-existent is probably required as well. |
Due to this I would say that |
Yes, please! I was proposing that from the beginning. Re: |
The gist looks good. The use of This is more of an implementation detail that could be addressed while keeping the |
Yeah I was assuming the endpoint would build the response by looking at what adapters exist/what experimental features are enabled/etc. |
Should be master-key-only.
My suggestion for the interface is to have it return an object of feature-config pairs, for good forward compatibility. For now it would mostly be simple on/off like this:
But an object leaves open the possibility of more complex config later:
The text was updated successfully, but these errors were encountered: