Skip to content

Ability to use Environment Flag with Branch Environments #85

@homelinen

Description

@homelinen

From my testing and reading of https://github.com/github/octocatalog-diff/blob/master/doc/advanced-environments.md#preserving-the-environments it looks like it is not possible to use an environment other than 'production' when running octocatalog-diff.

The Puppet setup we have uses each branch as its own environment, and we currently manage 4 "production" like branches:

  • production
  • perftest
  • international
  • development

Our hiera hierarchy and a lot of code is dependant on the environment puppet variable so it is difficult to test our non-production branches.

So the ideal octocatalog-diff testing scenario would be to compare branch feature/my_improvement in environment 'perftest' against 'origin/production' in the 'perftest' environment. Optionally 'origin/perftest' in the perftest environment would also work.

This doesn't fit with the current requirement of preserve-environments having an environments folder in the repo, going by the example here: https://github.com/github/octocatalog-diff/blob/master/doc/advanced-environments.md#examples

The ability to specify an environment independent of the preserve-environments structure would be the best solution for my use case. I can see this is currently disabled here:

logger.warn '--environment is ignored unless --preserve-environments is used' unless logger.nil?
but haven't looked further into how that could be implemented.

I was going to look into the implementation of this for my use case but I wanted to raise a card to make sure there wasn't a strong reason not to implement something like this, or if it should be a separate set of command line options.

If I've totally misunderstood --preserve-environments I'd love to know how to achieve this use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions