Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

(#13429) refactor puppetral agent for telly compatibility #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cprice404
Copy link

R.I. (and anyone else interested): I'm not sure if you'll want to actually merge this or not, but it demonstrates how to make the puppetral agent code and specs compatible with Telly. It will break backwards compatibility with previous versions of puppet so that will obviously play a role in the decision of whether to merge as-is and establish a version-compatibility matrix, or whether to modify this commit with some backwards-compatibility hacks, or...


This commit includes:

  • Small change to puppetral agent to ensure puppet settings are
    initialized properly prior to use; this is necessary for
    compatibility with Telly
  • Add "puppet_spec_helper" (from puppetlabs_spec_helper project)
    to local spec_helper

This commit includes:

* Small change to puppetral agent to ensure puppet settings are
  initialized properly prior to use; this is necessary for
  compatibility with Telly
* Add "puppet_spec_helper" (from puppetlabs_spec_helper project)
  to local spec_helper
@cprice404
Copy link
Author

Oh, almost forgot to mention... this relies on changes in this puppet pull request:

puppetlabs/puppet#710

@ripienaar
Copy link
Contributor

Thanks, Yeah, I dont know this is interesting but the ral agent only being used by PE means someone else probably need to decide what the right thing is here. I am not sure who 'owns' live management so to speak.

As an aside I tend to avoid showing users the initialize/super thing, we have a few hooks in the agent life cycle in this case you'd do the setup in a method called pre_startup_hook

Why are you including the puppet_spec_helper? If possible I'd def want to avoid that.

We were talking about possibly using faces for this kind of thing, did you happen to look into that approach?

@cprice404
Copy link
Author

I meant to update the ticket w/rt faces, forgot to do so. Will do it now.

http://projects.puppetlabs.com/issues/13429

As for the initialize / super thing: excellent. I briefly scouted for a method like that and didn't find one so I just fell back to what I know. That sounds like an easy change.

w/rt puppet_spec_helper: there was much discussion on this topic recently:

http://projects.puppetlabs.com/issues/13595

We were having a lot of problems with test compatibility between various versions of external tools (which have a dependency on puppet) and various versions of puppet. It was decided that rather than wiring in version compatibility hacks into each external project, we should just maintain one single "bridge" project (puppetlabs_spec_helper) which is responsible for puppet's state setup/teardown during test runs. The version compatibility hacks are isolated in that project so that external projects (for the most part) can just "require" it and everything will work. I welcome input and ideas on that, but it has a good deal of momentum at this point.

@ripienaar
Copy link
Contributor

Thanks for the explanation, i think the spec_helper thing is fine just wanted to know why - we depend on puppet anyway so its not like the tests are getting any heavier or anything, was just curious

@cprice404
Copy link
Author

It is unfortunately adding a little weight--you need to have a clone of the puppetlabs_spec_helper project (master) and have it in your RUBYLIB in order to be able to run the tests. Hopefully that's not too big of a deal though.

@haus
Copy link

haus commented Apr 25, 2012

I think one of two things needs to happen.

  1. The change is modified to allow backwards compatibility in some way
  2. A new branch is made for 2.6.x/2.7.x so that backwards incompatible changes can be in master and maintenance can still happen against 2.6/2.7 versions of puppet

Thoughts?

@ripienaar
Copy link
Contributor

@haus there's some other discussion elsewhere - this agent is only used by PE so I think we can just remove it from the public repo and this should make targeting at versions much easier, we can just ship more or less the version proposed here when PE goes to puppet 3.0 and leave as is till then.

I think that'll just make it all easier to handle than trying to make this complex agent also still be backwards compat somehow

@MaxMartin
Copy link
Contributor

I am fine with RI's suggestion of the agent being removed from the public repo if that makes things easier..

@haus
Copy link

haus commented Apr 25, 2012

@ripienaar Good point.

@slippycheeze
Copy link
Contributor

The related pull request at puppetlabs/puppet#710 has been merged for Telly.

@puppetcla
Copy link

CLA Signed by cprice-puppet on 2012-02-14 21:00:00 -0800

@puppetcla
Copy link

Waiting for CLA signature by @cprice404

@cprice404 - We require a Contributor License Agreement (CLA) for people who contribute to Puppet, but we have an easy click-through license with instructions, which is available at https://cla.puppetlabs.com/

Note: if your contribution is trivial and you think it may be exempt from the CLA, please post a short reply to this comment with details. http://docs.puppetlabs.com/community/trivial_patch_exemption.html

@puppetcla
Copy link

CLA signed by all contributors.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants