Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-40768

Jenkins client-side HTML5 storage API

    Details

    • Similar Issues:
    • Epic Link:

      Description

      Not specifically related to Blue Ocean, but it is driving the requirements for it atm.

      Problem:

      HTML5 localStorage is great for storing per-domain name/value pairs, but it's a totally flat and untyped structure. The lack of hierarchy/namespacing makes it difficult to perform operations on subsets of data stored in localStorage e.g. to clear out (invalidate) a subset of localStorage NVPs when a new instance of Jenkins is installed, or to group a subset of NVPs and have APIs that allow the client code to just navigate those properties only e.g. log categories.

      Requirements:

      1. Support for NVP namespacing so that we can perform operations on a subset of NVPs i.e.
        1. set and get in the namespace.
        2. clear all NVPs in a namespace. Obviously, should not remove NVPs in other namespaces. This will e.g. allow us to clear all NVPs associated with a Jenkins "instance" after a new instance is installed, or plugins have ben added/removed/updated.
        3. iterate all NVPs in a namespace.
      2. Support more than just string values e.g. boolean, number, object. Not function though, obviously.
      3. Support subspaces i.e. namespaces inside namespaces e.g. you could have the "log-gategory" namespace inside the "jenkins-instance" namespace i.e. "jenkins-instance/log-gategory". Another one might be "jenkins-instance/classes-info" for storing classes metadata Vs the client UI contantly firing REST API calls to get it (see JENKINS-40080).
      4. Support get fallback options whereby you can configure the get to look in parent namespaces, or if using a dot separated key in the name (the N part of the NVP) that it can be configured to check back along the "dot parent path" e.g. if "org.jenkins.a.b" has no value, then fallback and check "org.jenkins.a" etc. This would be useful for e.g. log categories.

        Attachments

          Activity

          Hide
          tfennelly Tom FENNELLY added a comment -

          I did some playing with this over my xmas vacation. See https://github.com/tfennelly/jenkins-js-storage.

          Examples of how the namespace and subspacing APIs might work can be seen in spec/StorageNamespace.js tests.

          Examples of how the typing APIs might work can be seen in spec/types.js tests.

          Show
          tfennelly Tom FENNELLY added a comment - I did some playing with this over my xmas vacation. See https://github.com/tfennelly/jenkins-js-storage . Examples of how the namespace and subspacing APIs might work can be seen in spec/StorageNamespace.js tests. Examples of how the typing APIs might work can be seen in spec/types.js tests.
          Hide
          tfennelly Tom FENNELLY added a comment -

          I'm working on this in the background in my spare time, so marking it as in-progress.

          Show
          tfennelly Tom FENNELLY added a comment - I'm working on this in the background in my spare time, so marking it as in-progress.

            People

            • Assignee:
              tfennelly Tom FENNELLY
              Reporter:
              tfennelly Tom FENNELLY
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: