Issue #6770 has been updated by Daniel Pittman.

I would strongly suggest we make the version information *mandatory*, not 
optional, at the "interface" layer.  If necessary, a special "always latest" 
value could be supplied to allow this to be an explicit request.

For the CLI we don't want to force an argument on people, so adding this in the 
wrapper that adapts the interface class loader to the CLI would make sense; 
perhaps even in other cases that might be reasonable, although I would try and 
discourage it.


If we have a default of "always the latest" then we are, in essence, suggesting 
to people that their code should just use that: a default is a very, very 
strong suggestion that this is reasonable behaviour for your code, unless you 
have a good reason to do otherwise.

That leads us right down the path to where interfaces without versioning get 
us: a place where we can't know if the caller is compatible with our new 
interface, or our old one, so we have to *guess* what they want, or avoid 
changing the interface to avoid disrupting users.

By making versioning explicit we demand that people encode their assumptions; 
we can easily provide support tools to identify "the current version", such as 
throwing it into our documentation, providing a CLI introspection tool, etc.  
This should keep the cost for users low, while still getting them the interface 
they need.

Then we have an explicit declaration: this code uses version one, not version 
two, and we can react appropriately.  If we had a "just gimme whatever" 
request, we couldn't do anything more reasonable than hope and pray.
----------------------------------------
Feature #6770: Interfaces don't support versioning
https://projects.puppetlabs.com/issues/6770

Author: Paul Berry
Status: Accepted
Priority: Normal
Assignee: 
Category: interfaces
Target version: 2.6.x
Affected Puppet version: 
Keywords: 
Branch: 


In order to provide for better backward compatibility if a specific interface 
changes in the future, we should have a versioning scheme for interfaces.

For example, the writer of an interface action should be able to specify which 
version of that action they are writing, e.g.:

    Puppet::Interface::Foo.action :bar, :version => '1.3.5' do |args|
      ...
    end

And, when calling an interface, the caller should be able to specify which 
version of the action they are trying to invoke:

    Puppet::Interface::Foo.bar('x', 'y', :version => '2.4')

* If the requested version cannot be found, it's a fatal error.
* If a different version exists, that should be noted in the error message.
* We should use semantic versioning (as per semver.org) as the default approach 
for specifying the versions of interface actions.   This would also allow us to 
permit version patterns for the callers (e.g. "give me anything in the 2.x 
series")
* Invoking an action without a version (including from the command line) always 
implicitly invokes the most recent version installed.

If we don't address versioning concerns from the outset, they will be difficult 
to address in the future, because users of the interface API will already exist 
in the field that do not specify their versions, and it will be difficult to be 
backward-compatible in any meaningful way.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to