Skip to content

Conversation

@phalestrivir
Copy link
Contributor

This PR enables the CLI to still export partial exports to files in cases when errors would've normally prevented it. In other words, this PR addresses this issue.

See my PR in the library which makes changes there to enable the changes in this PR to work.

One thing I wasn't sure about was how we should handle error handling in the cases of partial exports. Currently, the way it handles errors is to first save any exports that were successful, then check if any errors occurred during export. If any error occurred during export, it will print out the error, and then the command will fail with status code 1. I feel like this could be sort of misleading however because the command didn't necessarily "fail" since it did export some configuration successfully, so I'm wondering if printing the error in these cases would be sufficient, or if this is a case where we want to return a specific status code instead of the generic error 1 code to indicate it was semi-successful.

Either way, I also updated the tests to check for the status code after an export is made to verify that it is what was expected. This change is what resulted in most of the changes in the different snapshots that were updated.

@phalestrivir phalestrivir force-pushed the feature/support-partial-exports branch from 53fda4a to 1c7cafa Compare May 12, 2025 17:55
@phalestrivir
Copy link
Contributor Author

phalestrivir commented May 12, 2025

I discovered that the tests for PromoteOps are broken. Currently, those tests are not passing. I'll push another commit shortly which makes a few fixes to the tests, but we're going to have to skip them for now since it will require new recordings to fix them entirely and at the moment the Frodo dev tenant is down, so we can't make new recordings.

Note that before they were passing mistakenly. I noticed when looking at the standard out/error output before the changes I made that there were missing recordings, but the tests weren't failing because we weren't recording the output in snapshots and because the error code was still 0. Now the error code is 1, causing the tests to fail properly, and in the new commit I will include the code that saves the output to snapshots.

@vscheuber vscheuber merged commit 3594465 into rockcarver:main Jun 17, 2025
4 checks passed
@phalestrivir phalestrivir deleted the feature/support-partial-exports branch July 15, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants