Skip to content

Instantly share code, notes, and snippets.

@sminnee
Created August 30, 2018 22:58
Show Gist options
  • Select an option

  • Save sminnee/66554977f20d58b240cfd01eccc79cd5 to your computer and use it in GitHub Desktop.

Select an option

Save sminnee/66554977f20d58b240cfd01eccc79cd5 to your computer and use it in GitHub Desktop.
Tracking support timeframes

Tracking support timeframes

Goals

  • Provide a way for the sitesummariser SilverStripe module to query the support timeframes of SilverStripe packages

Stretch goals

  • Get the rest of the SilverStripe ecosystem using this
  • Get the rest of the packagist ecosystem using this

Package format

Bundle a .support-timeframe.json into packages that provides support timeframe metadata.

Sample

{
  "^4": {
    "description": "SilverStripe 4 is LTS until 2022ish",
    "url": "https://www.silverstripe.org/roadmap",
    "support-periods": [
        { "level": "full", "description": "Full support", "until": "2021-06-06" }
        { "level": "partial", "description": "Security/critical fixes only", "until": "2022-06-06" }
     ]
  },
  "~4.1.0": {
    "description": "SilverStripe 4.1 is supported for 6 months. For longer support we recommend ^4",
    "url": "https://www.silverstripe.org/roadmap",
    "support-periods": [
        { "level": "partial", "description": "Security/critical fixes", "until": "2018-21-31" }
     ]
  },
}

Spec:

  • Top level keys are composer version strings. Each entry describes support for 1 period:
    • "support-periods": an array of 1 or more support periods.
      • "level": "full" or "partial". Can be used to show support in green or yellow, for example. More than 1 of each can be supplied, with different descriptions.
      • "description": Project-specific identifier of this level of support.
      • "until": End-date of the support.
    • "description": A summary statement about support.
    • "url": An url to find out more details.

Server to support this

Addons.SilverStripe.org is already downloading and scanning all the SilverStripe modules. A step can be added to this to cache .support-timeframe.json files.

A simple API for getting support details of 1 package:

GET /api/support-timeframe/(vendor)/(package).json HTTP/1.1
Host: addons.silverstripe.org
Accept: application/json

Or fetch many:

GET /api/support-timeframe/packages.json HTTP/1.1
Host: addons.silverstripe.org
Accept: application/json
Content-type: application.json

[
  "(vendor)/(package)",
  "(vendor)/(package)",
  "(vendor)/(package)"
]

Or look up the support coverge for the version you have specified in your composer.json.

GET /api/support-timeframe/assess-packages.json HTTP/1.1
Host: addons.silverstripe.org
Accept: application/json
Content-type: application.json

{
  "(vendor)/(package)": "version-string",
  "(vendor)/(package)": "version-string",
  "(vendor)/(package)": "version-string"
}

Sitesummariser updates

  • Call /api/support-timeframe/assess-packages.json
  • Get the result
  • Add into the UI. Green for full support, yellow for partial support, red for no support. Show the support message, provide links where appropriate.

Logic of assess-packages

  • TBC. Need a way of calculating the "overlap" of version strings.
@chillu
Copy link
Copy Markdown

chillu commented Aug 31, 2018

I'd probably leave out the description field, since that'd be duplicated across a gazillion composer.json files. Just link to the roadmap, and have a simple lookup for our particular keys relevant to our release process within addons somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment