sensu / bonsai

Apache License 2.0
1 stars 7 forks source link

Enhancement: Expose Deprecation status in api endpoint #217

Closed jspaleta closed 5 years ago

jspaleta commented 5 years ago

Example:

jspaleta/sensu-plugin-chec is listed as deprecated in web ui. https://bonsai.sensu.io/assets/jspaleta/sensu-plugins-chef

But nothing indicating deprecation in the api endpoint: https://bonsai.sensu.io/api/v1/assets/jspaleta/sensu-plugins-chef

Need something in the api information here to indicated its deprecated and to point to api endpoint for the preferred replacementL

This would allow client side tools using the api to look for new versions to detect deprecation and provide user feedback on steps to take to switch repositories.

Strawman

add top level attributes in api json information

deprecated: boolean
substitute_asset hash including:
  name: 
  name_space: 
  url : web_ui url for deprecation redirect
  api_url: api url for depercation redirect
pzupan commented 5 years ago
{
    "name": "jspaleta/sensu-plugins-chef",
    "description": "This plugin provides native instrumentation for monitoring Chef, including service health checks (via chef-server-ctl) and chef node status, and a Sensu handler for removing stale Sensu clients.",
    "url": "http://10.1.10.140:3000/api/v1/assets/jspaleta/sensu-plugins-chef",
    "github_url": "https://github.com/jspaleta/sensu-plugins-chef",
    "download_url": "http://10.1.10.140:3000/assets/jspaleta/sensu-plugins-chef/download",
    "deprecated": true,
    "replacement": {
        "name": "sensu-plugins/sensu-plugins-chef",
        "url": "http://10.1.10.140:3000/assets/sensu-plugins/sensu-plugins-chef",
        "api_url": "http://10.1.10.140:3000/api/v1/assets/sensu-plugins/sensu-plugins-chef"
    },
    "versions": [...
jspaleta commented 5 years ago

:+1: