Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-41

Establish better patterns for handling API versioning

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDB 2.1.0
    • Component/s: PE

      Description

      A quick tour through the current PuppetDB code base will reveal that we have kind of been making up our API versioning strategy as we go along.

      • We're not consistent in how we handle cases where some versions of the HTTP endpoints are best implemented by simply calling into the logic defined by other versions of the same endpoint.
      • We're not consistent in how we compile queries; there are v2 query functions that call into v1 implementations and/or vice-versa, and then the situation is compounded with v3. It's very hard to look at the code and get a clear understanding of the deltas between the versions.
      • We're really not consistent in how we test the different versions of the endpoints... some endpoints assume that since their implementation just calls into a different version of the same endpoint, then we don't need to duplicate all of the tests, and we can just assume that if they pass for the old version, they'll pass for the new version, etc.

      This problem is going to get worse over time, and since it sounds like we are already expecting to bump the query API version again (perhaps multiple times) in the near future, it'd be wise to get this cleaned up soon.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              chris Chris Price
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support