Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the default workflow in server side yaml does not work. #860

Closed
ShaneNalezyty-sf opened this issue Nov 26, 2019 · 1 comment · Fixed by #862
Closed

Setting the default workflow in server side yaml does not work. #860

ShaneNalezyty-sf opened this issue Nov 26, 2019 · 1 comment · Fixed by #862
Labels
bug Something isn't working

Comments

@ShaneNalezyty-sf
Copy link

Brief overview:

Naming a workflow default in server side configuration does not change the default for all repos running on Atlantis.

Detail:

At my organization we attempted to change the default workflow for all repositories by using server side configuration. We named the work flow default as specified in the documentation. However, we know this flow is not being executed due to our prod condition not executing.

Atlantis version: v0.10.1

Here is our server side configuration:

repos:
  # All Repos
  - id: /.*/
    apply_requirements: [approved]
    allow_custom_workflows: true
    allowed_overrides: [workflow]

workflows:
  default:
    plan:
      steps:
        - init
        - plan
    apply:
      steps:
        - run: if [ "$WORKSPACE" == "prod" ] ; then echo "Atlantis is not used to apply to prod.  Merge code first and use the CI/CD pipelines!" ; exit 1; fi
        - apply

Renaming the workflow from default, and setting the workflow under repos does fix the issue.

repos:
  # All Repos
  - id: /.*/
    apply_requirements: [approved]
    allow_custom_workflows: true
    workflow: thecustomwf
    allowed_overrides: [workflow]

workflows:
  thecustomwf:
    plan:
      steps:
        - init
        - plan
    apply:
      steps:
        - run: if [ "$WORKSPACE" == "prod" ] ; then echo "Atlantis is not used to apply to prod.  Merge code first and use the CI/CD pipelines!" ; exit 1; fi
        - apply

We did leave allow workflow override on, because we needed to allow our hundreds of projects time to migrate. I'm wondering if allowing the override is causing Atlantis to use the repos default workflow over the servers.

@lkysow lkysow added the bug Something isn't working label Nov 26, 2019
@lkysow
Copy link
Member

lkysow commented Nov 26, 2019

Looks like a bug of some sort. The logic around naming the workflow default but not referencing it again in the repos config:

repos:
- id: /.*/
  workflow: default # you don't have this

May be at fault. I know this is in the docs so sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants