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: render tables on stdout #3226

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat: render tables on stdout #3226

wants to merge 3 commits into from

Conversation

mkcp
Copy link
Contributor

@mkcp mkcp commented Nov 8, 2024

Description

This PR adjusts a hack from before, which made sure we still rendered tables even when message / pterm was disabled via feature flags.

Now, we render them to Stdout instead of rendering them on Stderr like diagnostic logs. There is a slightly insane hack here to retrieve the current writer from a new atomic package var, then reinitialize Pterm with os.Stdout, and finally initialize it back to the original value.

This hack should be addressed as soon as possible with output writers that can be defined and utilized locally and are threadsafe, at least a far as providing atomic stdout writes, if possible.

Related Issue

Finishes #3223
Relates to #2576

Checklist before merging

@mkcp mkcp added the bug 🐞 Something isn't working label Nov 8, 2024
@mkcp mkcp self-assigned this Nov 8, 2024
@mkcp mkcp requested review from a team as code owners November 8, 2024 23:32
Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 500147c
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/672e9f9c3d17d70008784e79

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 21.05263% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/package.go 0.00% 5 Missing ⚠️
src/cmd/common/table.go 0.00% 4 Missing ⚠️
src/pkg/message/connect.go 0.00% 3 Missing ⚠️
src/pkg/utils/yaml.go 0.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/cmd/connect.go 0.00% <ø> (ø)
src/cmd/dev.go 0.00% <ø> (ø)
src/cmd/root.go 0.00% <ø> (ø)
src/pkg/message/message.go 14.01% <100.00%> (+2.24%) ⬆️
src/pkg/message/connect.go 0.00% <0.00%> (ø)
src/pkg/utils/yaml.go 0.00% <0.00%> (ø)
src/cmd/common/table.go 0.00% <0.00%> (ø)
src/cmd/package.go 0.00% <0.00%> (ø)

@mkcp
Copy link
Contributor Author

mkcp commented Nov 12, 2024

Hold off on review or merge, I need to look over the failing e2e tests.

@mkcp mkcp mentioned this pull request Nov 12, 2024
20 tasks
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
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant