Versioning artifacts in S-RAMP
eric.wittmann Mar 4, 2013 12:08 PMThe S-RAMP specification is somewhat silent when it comes to artifact versioning. There is a core property (attribute) on all artifacts named "version", but it is a simple free-form field that can be set by the client. The intention appears to defer artifact versioning to clients.
That said, there are two major aspects of versioning that we need to solve:
- Using the S-RAMP features to appropriately model artifact versioning
- Identifying when an artifact is unique vs. a new version of an existing artifact
For the first point, here is a simple proposal:
- Store the version number in the "version" core artifact property (duh)
- Each artifact instance can have "previousVersion" and "nextVersion" relationships (min-cardinality 0, max-cardinality 1)
- If no "previousVersion" relationship exists, then this is the first version
- If no "nextVersion" relationship exists, then this is the most recent version
We'll need to work through the requirements and use-cases to see if this model is appropriate.
On the second point (unique vs. new version of existing), things get a little tricky. Here is one proposal mentioned by Kurt:
"We should probably default to looking for "artifact in the repository" by checking the name, file size, version (if available) and hash key. If all three match, then link to that artifact rather than adding a new one."
This seems like a great starting point, but there are some considerations. I thought about these:
- If an artifact changes in a non-functional way (e.g. white-space) then we would see this as a new unique artifact.
- The name core property (attribute) is mutable, so if a user changes the name then the "new version detection" algorithm would break.
- The algorithm might need to be customized based on artifact type. For example, we probably want to use the targetNamespace property when dealing with WSDLs and XSDs.
- Should we use other contextual information such as the Maven GAV info, when available?
NOTE: In some cases, the UI can handle adding new versions via an explicite gesture in the interface. This discussion focuses on the more common case of attempting to automatically detect new versions of the same artifact.