Skip to content

Add progress output - #29

Merged
davidnewhall merged 4 commits into
mainfrom
dn2_progress
Aug 24, 2026
Merged

Add progress output#29
davidnewhall merged 4 commits into
mainfrom
dn2_progress

Conversation

@davidnewhall

Copy link
Copy Markdown
Contributor

Print extraction progress.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds extraction progress output to the xt CLI by wiring golift.io/xtractr progress updates into the existing job-driven extraction flow, along with dependency and CI/workflow updates to support the new behavior.

Changes:

  • Add progress reporting via an xtractr.Progress channel on Job and pass it into xtractr.XFile updates during extraction.
  • Update Go module dependencies/tooling and GitHub workflows to newer versions and to use go.mod as the Go version source.
  • Minor supporting tweaks (log output stream, linter config, license year bump).

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/xt/xt.go Initializes progress reporting and passes update channel into per-archive extraction.
pkg/xt/job.go Adds a progress channel to Job for progress updates.
pkg/xt/filemode.go Adjusts FileMode type declaration (affects lint behavior).
main.go Routes log output to stdout (aligning with stdout-based progress output).
LICENSE Updates copyright year.
go.mod Bumps Go version and updates/extends dependencies (adds golang.org/x/term, updates xtractr).
go.sum Refreshes dependency checksums after module changes.
.golangci.yml Updates golangci-lint config (disables additional linters).
.github/workflows/release.yml Updates action versions and switches to go-version-file.
.github/workflows/codetests.yml Updates action versions and golangci-lint version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/xt/xt.go
Comment on lines 23 to 25
job.fixModes()
job.setupProgress()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Progress now starts only when there is at least one archive and debug is off. The printer channel is closed (and we wait for the goroutine) when the job finishes, so an empty run cannot leak a blocked printer.

Comment thread pkg/xt/xt.go Outdated
Comment on lines +62 to +70
isTerm := term.IsTerminal(int(os.Stdout.Fd()))
if isTerm {
every = 0.1
}

if !j.DebugLog { // Only print progress if debug is off.
j.progress = make(chan xtractr.Progress)
go xtractr.ArchiveProgress(every, j.progress, term.IsTerminal(int(os.Stdout.Fd())), false)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reused isTerm for both the update interval and ArchiveProgress.

Comment thread pkg/xt/filemode.go
Skip starting it when there is nothing to extract (or debug is on), close
the channel when the job finishes, and reuse the TTY check Copilot flagged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@davidnewhall
davidnewhall merged commit 0b20f06 into main Aug 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants