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

feat: optionally hide multienv output #4422

Merged
merged 8 commits into from
May 29, 2024

Conversation

anryko
Copy link
Contributor

@anryko anryko commented Apr 12, 2024

what

Add a "full" configuration type for the multienv workflow step type identical to the run step type, to allow users to silence the output.

why

  • The multienv can contain a long list of variables that trashes the output.
  • Exported variable names might be security-sensitive.

tests

  • I have tested my changes by providing additional tests in the code and manually by passing the following repo config variable in my dev env.
ATLANTIS_REPO_CONFIG_JSON='
{
  "repos": [
    {
      "id": "/.*/",
      "apply_requirements": [
        "mergeable"
      ],
      "allowed_overrides": [
        "apply_requirements",
        "workflow"
      ],
      "allow_custom_workflows": true,
      "pre_workflow_hooks": [
        {
          "run": "echo \"HI IAM DEV INSTANCE\""
        }
      ]
    }
  ],
  "workflows": {
    "custom": {
      "plan": {
        "steps": [
          {
            "run": "echo \"PLAN THE STEP 1\""
          },
          {
            "multienv": {
                "command": "/atlantis/src/multienv_test.sh",
                "output": "hide"
            }
          },
          {
            "run": "echo \"PLAN THE STEP 2\""
          },
          {
            "multienv": {
                "command": "/atlantis/src/multienv_test.sh",
                "output": "show"
            }
          },
          {
            "run": "echo \"PLAN THE STEP 3\""
          },
          {
            "multienv": {
                "command": "/atlantis/src/multienv_test.sh"
            }
          },
          {
            "run": "echo \"PLAN THE STEP 4\""
          },
          {
            "multienv": "/atlantis/src/multienv_test.sh"
          }
        ]
      }
    }
  }
}'

references

@anryko anryko requested review from a team as code owners April 12, 2024 15:39
@anryko anryko requested review from GenPage, lukemassa and X-Guardian and removed request for a team April 12, 2024 15:39
@github-actions github-actions bot added docs Documentation go Pull requests that update Go code labels Apr 12, 2024
@jamengual jamengual added the waiting-on-review Waiting for a review from a maintainer label Apr 12, 2024
@Gabidiela
Copy link

Hi, do we have any plans for this solution to be implemented? I have a problem and I think this would help a lot.

@jamengual jamengual added this to the v0.28.0 milestone May 6, 2024
@chenrui333 chenrui333 added ready to merge and removed waiting-on-review Waiting for a review from a maintainer labels May 21, 2024
@chenrui333
Copy link
Member

chenrui333 commented May 21, 2024

not quite sure why e2e tests run on the merge commit

@chenrui333 chenrui333 modified the milestones: v0.28.0, v0.29.0 May 22, 2024
@chenrui333 chenrui333 added the feature New functionality/enhancement label May 29, 2024
@chenrui333 chenrui333 merged commit ded89a3 into runatlantis:main May 29, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation feature New functionality/enhancement go Pull requests that update Go code ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toggle to silence multienv output
4 participants