Fix output only json if using json output for ephemeral environment deprovisioning commands#566
Merged
stevencl840 merged 3 commits intomainfrom Nov 13, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the deprovisioning commands to only output status messages when using non-JSON output formats. Previously, messages were printed before calling the output function, which would interfere with JSON output. Now the message is passed as a parameter and conditionally printed based on the output format.
Key changes:
- Modified
OutputDeprovisionResultto accept amessageparameter - Message is now printed only for
basicandtable(default) output formats, not forjson
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
pkg/cmd/ephemeralenvironment/util/util.go |
Added message parameter to OutputDeprovisionResult and conditionally prints it only for non-JSON output formats |
pkg/cmd/ephemeralenvironment/deprovision-project/deprovision_project.go |
Removed direct message printing and now passes the message to OutputDeprovisionResult for conditional output |
pkg/cmd/ephemeralenvironment/deprovision-environment/deprovision_environment.go |
Removed direct message printing and now passes the message to OutputDeprovisionResult for conditional output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context 🌆
Ephemeral environments are temporary environments that developers can use to test changes. They are expected to come and go with the same cadence as a PR, created when the PR is opened and torn down when it is merged.
Users need to be able to deprovision a specific project in an ephemeral environment.
Details 🔍
We added some messages to our output to show the user what is happening with the deprovisioning command. These messages will mean that the user will not be able to parse the json output. I have removed these messages when the user has selected json output.
I have also updated the two commands to output automation commands.
After