Uploaded image for project: 'R10K'
  1. R10K
  2. RK-378

Add "environment" getter to DSL

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Ready for Engineering
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:
    • Epic Link:
    • Story Points:
      2
    • Zendesk Ticket IDs:
      45486
    • Zendesk Ticket Count:
      1
    • QA Risk Assessment:
      Needs Assessment

      Description

       Customer runs into a problem where they're using the private API of an older version of r10k in their Puppetfile like this:

      We use the puppet_environment variable to set the default branch. For example:
       
      puppet_environment = File.basename(@librarian.basedir)
      default_branch = case puppet_environment
      when/^feature_/
      'development'
      else
      puppet_environment.split('_').first
      end
       
      Then for our repos we use the default_branch parameter
      :default_branch => default_branch
      

      It's been suggested that we add an environment or environment_name to get this functionality back ("So it looks like they want the "basedir" so they can get the name of the current environment so they can have a particular default_branch when doing feature branches. I think it would be a valid workflow (feature branch specifics are hard because you want them one way in the PR, but different when they're merged). I'd be happy to add an environment or environment_name getter to the DSL if other's are okay with it." - Justin Stoller)

      Outcomes

      • Add back the basedir getter
      • Add a deprecation warning for using basedir
      • Add an environment getter
      • Open a ticket for removing basedir in 4.0.0
      • Update docs in the r10k repo

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            eric.putnam Eric Putnam
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support