Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-3180

Add ability to return a list of features in server's welcome message

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      This could be used to let users discover quickly the availability of some API or modes of operation.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user nickva opened a pull request:

          https://github.com/apache/couchdb-chttpd/pull/144

          Add ability to return "features" list in the server's welcome message.

          This could help users quickly discover the presence of an API or mode of
          operation.

          Jira: COUCHDB-3180

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/cloudant/couchdb-chttpd couchdb-3180-features-chttpd

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/couchdb-chttpd/pull/144.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #144


          commit 0e2b7510cd06c4667ccfe44ab8720438f49c4d2e
          Author: Nick Vatamaniuc <vatamane@apache.org>
          Date: 2016-10-05T16:51:37Z

          Add ability to return "features" list in the server's welcome message.

          This could help users quickly discover the presence of an API or mode of
          operation.

          Jira: COUCHDB-3180


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user nickva opened a pull request: https://github.com/apache/couchdb-chttpd/pull/144 Add ability to return "features" list in the server's welcome message. This could help users quickly discover the presence of an API or mode of operation. Jira: COUCHDB-3180 You can merge this pull request into a Git repository by running: $ git pull https://github.com/cloudant/couchdb-chttpd couchdb-3180-features-chttpd Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb-chttpd/pull/144.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #144 commit 0e2b7510cd06c4667ccfe44ab8720438f49c4d2e Author: Nick Vatamaniuc <vatamane@apache.org> Date: 2016-10-05T16:51:37Z Add ability to return "features" list in the server's welcome message. This could help users quickly discover the presence of an API or mode of operation. Jira: COUCHDB-3180
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user nickva commented on the issue:

          https://github.com/apache/couchdb-chttpd/pull/144

          Alright, good points, agree. If it's worth doing, it's worth doing right.

          Here is what I came with as first thing:

          • Don't add a new application, it would be silly.
          • Stick it in config application. It seems like a configuration-y thing.
          • 3 new functions. API looks like
          • `config:features() -> [<<"feature1">>, <<"feature2">>, ...].`
          • `config:feature_enable(<<"feature1">>).`
          • `config:feature_disable(<<"feature2">>).`
          • Applications enable features and disable them. Then `chttpd` reads list of features from config and shows them in the welcome message.
          • Behind the scenes it is really just writing to config "[features]" section a bunch of booleans. With persistence set to `false`.
          • Users can directly set "features" in the config file transparently.

          The advantage is it doesn't reinvent the world. Takes advantage of config server (so applications can monitor for changes and such if needed).

          ( Added same comment to https://issues.apache.org/jira/browse/COUCHDB-3180 )

          @rnewson I'll give this a try and see what it looks like

          Show
          githubbot ASF GitHub Bot added a comment - Github user nickva commented on the issue: https://github.com/apache/couchdb-chttpd/pull/144 Alright, good points, agree. If it's worth doing, it's worth doing right. Here is what I came with as first thing: Don't add a new application, it would be silly. Stick it in config application. It seems like a configuration-y thing. 3 new functions. API looks like `config:features() -> [<<"feature1">>, <<"feature2">>, ...] .` `config:feature_enable(<<"feature1">>).` `config:feature_disable(<<"feature2">>).` Applications enable features and disable them. Then `chttpd` reads list of features from config and shows them in the welcome message. Behind the scenes it is really just writing to config " [features] " section a bunch of booleans. With persistence set to `false`. Users can directly set "features" in the config file transparently. The advantage is it doesn't reinvent the world. Takes advantage of config server (so applications can monitor for changes and such if needed). ( Added same comment to https://issues.apache.org/jira/browse/COUCHDB-3180 ) @rnewson I'll give this a try and see what it looks like
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user nickva opened a pull request:

          https://github.com/apache/couchdb-config/pull/14

          Features API and implementation.

          Implement ability to enable, disable and query feature flags.

          Features are identified as binary strings. Usage intent is for
          various components in the system to enable features, then the HTTP API will
          expose those to the user. For example, features could indicate the presence
          of an optional component, a plugin or a new mode of operation.

          The API has 3 functions:

          • `config:features/0` : Return a sorted list of feature flags
          • `config:feature_enable/1` : Enables a feature. Feature argument could be a
            list, a binary or an atom.
          • `config:feature_disable/1` : Same as `feature_enable/1` but disables the
            feature.

          `feature_enable/1` and `feature_disable/1` are idempotent.

          Implementation is a thin wrapper around setting and deleting keys from the
          '[features]' config section. This means, users can also set their own features
          there via the .ini config files. Features set via the API are not persistent,
          so applications will have to set them every time they initialize.

          Jira: COUCHDB-3180

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/cloudant/couchdb-config couchdb-3180

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/couchdb-config/pull/14.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #14


          commit d811a5472a91016633e217a2992df4c9ea88b876
          Author: Nick Vatamaniuc <vatamane@apache.org>
          Date: 2016-10-06T02:08:51Z

          Features API and implementation.

          Implement ability to enable, disable and query feature flags.

          Features are identified as binary strings. Usage intent is for
          various components in the system to enable features, then the HTTP API will
          expose those to the user. For example, features could indicate the presence
          of an optional component, a plugin or a new mode of operation.

          The API has 3 functions:

          • `config:features/0` : Return a sorted list of feature flags
          • `config:feature_enable/1` : Enables a feature. Feature argument could be a
            list, a binary or an atom.
          • `config:feature_disable/1` : Same as `feature_enable/1` but disables the
            feature.

          `feature_enable/1` and `feature_disable/1` are idempotent.

          Implementation is a thin wrapper around setting and deleting keys from the
          '[features]' config section. This means, users can also set their own features
          there via the .ini config files. Features set via the API are not persistent,
          so applications will have to set them every time they initialize.

          Jira: COUCHDB-3180


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user nickva opened a pull request: https://github.com/apache/couchdb-config/pull/14 Features API and implementation. Implement ability to enable, disable and query feature flags. Features are identified as binary strings. Usage intent is for various components in the system to enable features, then the HTTP API will expose those to the user. For example, features could indicate the presence of an optional component, a plugin or a new mode of operation. The API has 3 functions: `config:features/0` : Return a sorted list of feature flags `config:feature_enable/1` : Enables a feature. Feature argument could be a list, a binary or an atom. `config:feature_disable/1` : Same as `feature_enable/1` but disables the feature. `feature_enable/1` and `feature_disable/1` are idempotent. Implementation is a thin wrapper around setting and deleting keys from the ' [features] ' config section. This means, users can also set their own features there via the .ini config files. Features set via the API are not persistent, so applications will have to set them every time they initialize. Jira: COUCHDB-3180 You can merge this pull request into a Git repository by running: $ git pull https://github.com/cloudant/couchdb-config couchdb-3180 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb-config/pull/14.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #14 commit d811a5472a91016633e217a2992df4c9ea88b876 Author: Nick Vatamaniuc <vatamane@apache.org> Date: 2016-10-06T02:08:51Z Features API and implementation. Implement ability to enable, disable and query feature flags. Features are identified as binary strings. Usage intent is for various components in the system to enable features, then the HTTP API will expose those to the user. For example, features could indicate the presence of an optional component, a plugin or a new mode of operation. The API has 3 functions: `config:features/0` : Return a sorted list of feature flags `config:feature_enable/1` : Enables a feature. Feature argument could be a list, a binary or an atom. `config:feature_disable/1` : Same as `feature_enable/1` but disables the feature. `feature_enable/1` and `feature_disable/1` are idempotent. Implementation is a thin wrapper around setting and deleting keys from the ' [features] ' config section. This means, users can also set their own features there via the .ini config files. Features set via the API are not persistent, so applications will have to set them every time they initialize. Jira: COUCHDB-3180
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit f62d553b337ce975edb0fb68772d22bdd3bf6490 in couchdb-config's branch refs/heads/master from Nick Vatamaniuc
          [ https://git-wip-us.apache.org/repos/asf?p=couchdb-config.git;h=f62d553 ]

          Features API and implementation.

          Implement ability to enable, disable and query feature flags.

          Features are identified as atoms. Usage intent is for various components in the
          system to enable features, then the HTTP API will expose those to the user.
          For example, features could indicate the presence of an optional component, a
          plugin or a new mode of operation.

          The API has 3 functions:

          • `config:features/0` : Return a sorted list of feature flags
          • `config:enable_feature/1` : Enables a feature. Feature argument could be a
            list, a binary or an atom.
          • `config:disable_feature/1` : Disables a feature.

          Implementation is a thin wrapper around setting and deleting keys from the
          '[features]' config section. This means, users can also set their own features
          there via the .ini config files. Features set via the API are not persistent,
          so applications will have to set them every time they initialize.

          COUCHDB-3180

          Show
          jira-bot ASF subversion and git services added a comment - Commit f62d553b337ce975edb0fb68772d22bdd3bf6490 in couchdb-config's branch refs/heads/master from Nick Vatamaniuc [ https://git-wip-us.apache.org/repos/asf?p=couchdb-config.git;h=f62d553 ] Features API and implementation. Implement ability to enable, disable and query feature flags. Features are identified as atoms. Usage intent is for various components in the system to enable features, then the HTTP API will expose those to the user. For example, features could indicate the presence of an optional component, a plugin or a new mode of operation. The API has 3 functions: `config:features/0` : Return a sorted list of feature flags `config:enable_feature/1` : Enables a feature. Feature argument could be a list, a binary or an atom. `config:disable_feature/1` : Disables a feature. Implementation is a thin wrapper around setting and deleting keys from the ' [features] ' config section. This means, users can also set their own features there via the .ini config files. Features set via the API are not persistent, so applications will have to set them every time they initialize. COUCHDB-3180
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 3dcdb6a2eb97241dce62615319a52affb9e792ed in couchdb-chttpd's branch refs/heads/master from Nick Vatamaniuc
          [ https://git-wip-us.apache.org/repos/asf?p=couchdb-chttpd.git;h=3dcdb6a ]

          Add ability to return a "features" list in the welcome message.

          This could help users quickly discover the presence of an API or mode of
          operation.

          Features are obtained from a new config API `config:features/0`

          System components can enable features via `config:enable_feature/1` API, or
          users can directly enable features in the .ini files, and those features
          should show up in the "Welcome" message.

          COUCHDB-3180

          Show
          jira-bot ASF subversion and git services added a comment - Commit 3dcdb6a2eb97241dce62615319a52affb9e792ed in couchdb-chttpd's branch refs/heads/master from Nick Vatamaniuc [ https://git-wip-us.apache.org/repos/asf?p=couchdb-chttpd.git;h=3dcdb6a ] Add ability to return a "features" list in the welcome message. This could help users quickly discover the presence of an API or mode of operation. Features are obtained from a new config API `config:features/0` System components can enable features via `config:enable_feature/1` API, or users can directly enable features in the .ini files, and those features should show up in the "Welcome" message. COUCHDB-3180
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/couchdb-chttpd/pull/144

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/couchdb-chttpd/pull/144
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit c7e7e8674426a591fc6d0c4bba398291e107d87a in couchdb's branch refs/heads/master from Nick Vatamaniuc
          [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=c7e7e86 ]

          Bump chttpd and config to add new features API

          Add ability to return a "features" list in the welcome message.

          This could help users quickly discover the presence of an API or mode of
          operation.

          Features are obtained from a new config API `config:features/0`

          System components can enable features via `config:enable_feature/1` API, or
          users can directly enable features in the .ini files, and those features
          should show up in the "Welcome" message.

          COUCHDB-3180

          Show
          jira-bot ASF subversion and git services added a comment - Commit c7e7e8674426a591fc6d0c4bba398291e107d87a in couchdb's branch refs/heads/master from Nick Vatamaniuc [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=c7e7e86 ] Bump chttpd and config to add new features API Add ability to return a "features" list in the welcome message. This could help users quickly discover the presence of an API or mode of operation. Features are obtained from a new config API `config:features/0` System components can enable features via `config:enable_feature/1` API, or users can directly enable features in the .ini files, and those features should show up in the "Welcome" message. COUCHDB-3180

            People

            • Assignee:
              Unassigned
              Reporter:
              vatamane Nick Vatamaniuc
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Development