8000 feat: live output action command logs by AustinAbro321 · Pull Request #3901 · zarf-dev/zarf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: live output action command logs #3901

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

Merged
merged 6 commits into from
Jun 10, 2025
Merged

Conversation

AustinAbro321
Copy link
Contributor
@AustinAbro321 AustinAbro321 commented Jun 9, 2025

Description

This PR changes actions to log the cmd output to the users terminal while the command is running. The command stdout/stdin is still outputted in a structured log at the debug level, but is no longer outputted in a structured log at the info level.

This is most useful for actions that take a while to run.
Given the below example:

    - cmd: |
        echo "multiline!"
        sleep 2
        echo "updates!"
        sleep 2
        echo "in!"
        sleep 2
        echo "realtime!"
        sleep 2

On the current version of Zarf the entire log will output after the command is completed (8 second difference between timestamps)
image
After this PR the output looks like this and happens as the command goes:
image

Above example is contrived, but plenty of CLI programs or script can take a while to run and getting real time feedback from these is valuable.

Checklist before merging

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
@AustinAbro321 AustinAbro321 requested review from a team as code owners June 9, 2025 13:34
Copy link
netlify bot commented Jun 9, 2025

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit a0ad7a6
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/6846fcefd86ca00008f2c431

@AustinAbro321 AustinAbro321 changed the title feat: print action command output to std while cmd is running feat: print action command output to std while command is running Jun 9, 2025
@AustinAbro321 AustinAbro321 changed the title feat: print action command output to std while command is running feat: live action command output logs to std Jun 9, 2025
@AustinAbro321 AustinAbro321 changed the title feat: live action command output logs to std feat: live output action command logs to std Jun 9, 2025
Copy link
codecov bot commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/internal/packager2/actions/actions.go 0.00% 6 Missing ⚠️
Files with missing lines Coverage Δ
src/internal/packager2/actions/actions.go 16.66% <0.00%> (+0.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
@AustinAbro321 AustinAbro321 changed the title feat: live output action command logs to std feat: live output action command logs Jun 9, 2025
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Copy link
Contributor
@mkcp mkcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AustinAbro321 AustinAbro321 added this pull request to the merge queue Jun 10, 2025
Merged via the queue into main with commit 6858fcf Jun 10, 2025
27 checks passed
@AustinAbro321 AustinAbro321 deleted the print-to-std-during-command branch June 10, 2025 15:07
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
0