Skip to content

feat: add progress tracking for transformation execution#1702

Merged
piotrjanik merged 3 commits into
open-component-model:mainfrom
piotrjanik:feat/801-transformation-logging
Feb 9, 2026
Merged

feat: add progress tracking for transformation execution#1702
piotrjanik merged 3 commits into
open-component-model:mainfrom
piotrjanik:feat/801-transformation-logging

Conversation

@piotrjanik

@piotrjanik piotrjanik commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Adds a new progress tracking and visualization package (cli/internal/render/progress) to provide user feedback during long-running operations like transfers.

Key components:

  • progress.Tracker - Generic event tracker that consumes raw events from a channel, maps them to progress events, and forwards to a visualizer. Handles context cancellation automatically.

  • bar.barVisualizer - Terminal progress bar with scrolling log. Shows recent items with status icons (⏳ running, ✓ completed, ✗ failed) above a progress bar that updates in place. Displays error summary after completion.

  • simple.SimpleVisualizer - Minimal line-by-line output for non-interactive terminals or logging scenarios.

  • Format utilities - Tree-style error formatting and customizable item name formatters.

  • Slog interception: The default slog logger is replaced with a bufferedHandler, allowing the bar visualizer to drain the buffer on each render cycle and print log lines as permanent output above the animated progress bar. Once tracking is complete, the original logger is restored.

  • Terminal detection: automatic selection between bar (interactive) and simple (piped) visualizers.

Fixes: open-component-model/ocm-project#801

@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/m Medium labels Feb 2, 2026
@piotrjanik piotrjanik force-pushed the feat/801-transformation-logging branch from 84bde3c to 3d0e7ef Compare February 3, 2026 23:01
@github-actions github-actions Bot added the size/l Large label Feb 3, 2026
@piotrjanik piotrjanik force-pushed the feat/801-transformation-logging branch 6 times, most recently from 6f384c8 to 776de87 Compare February 4, 2026 16:05
@github-actions github-actions Bot added the component/github-actions Changes on GitHub Actions or within `.github/` directory label Feb 4, 2026
@piotrjanik piotrjanik force-pushed the feat/801-transformation-logging branch from 776de87 to 4796407 Compare February 4, 2026 16:36
@piotrjanik piotrjanik marked this pull request as ready for review February 4, 2026 16:37
@piotrjanik piotrjanik requested a review from a team as a code owner February 4, 2026 16:37
@piotrjanik piotrjanik force-pushed the feat/801-transformation-logging branch 4 times, most recently from f833d19 to 07da6e8 Compare February 6, 2026 13:20

@jakobmoellerdev jakobmoellerdev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice interfaces!

Comment thread cli/cmd/transfer/component-version/cmd.go Outdated
Comment thread cli/internal/render/progress/tracker.go
Comment thread cli/internal/render/progress/bar/format_test.go Outdated
@piotrjanik piotrjanik force-pushed the feat/801-transformation-logging branch from 07da6e8 to 577fbbc Compare February 6, 2026 14:33
<!-- markdownlint-disable MD041 -->

Adds a new progress tracking and visualization package (`cli/internal/render/progress`) to provide user feedback during long-running operations like transfers.

**Key components:**

- **`progress.Tracker`** - Generic event tracker that consumes raw events from a channel, maps them to progress events, and forwards to a visualizer. Handles context cancellation automatically.

- **`bar.barVisualizer`** - Terminal progress bar with scrolling log. Shows recent items with status icons (⏳ running, ✓ completed, ✗ failed) above a progress bar that updates in place. Displays error summary after completion.

- **`simple.SimpleVisualizer`** - Minimal line-by-line output for non-interactive terminals or logging scenarios.

- **Format utilities** - Tree-style error formatting and customizable item name formatters.

- **Slog interception**: The default `slog` logger is replaced with a `bufferedHandler`, allowing the bar visualizer to drain the buffer on each render cycle and print log lines as permanent output above the animated progress bar. Once tracking is complete, the original logger is restored.

- **Terminal detection**: automatic selection between bar (interactive) and simple (piped) visualizers.

<!--
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Fixes: open-component-model/ocm-project#801
Signed-off-by: Piotr Janik <piotr.janik@sap.com>

# Conflicts:
#	cli/go.mod
#	cli/go.sum
#	cli/integration/go.mod
#	cli/integration/go.sum
@piotrjanik piotrjanik force-pushed the feat/801-transformation-logging branch from 577fbbc to 6444298 Compare February 6, 2026 14:46
@piotrjanik piotrjanik enabled auto-merge (squash) February 6, 2026 14:46
<!-- markdownlint-disable MD041 -->

Adds a new progress tracking and visualization package (`cli/internal/render/progress`) to provide user feedback during long-running operations like transfers.

**Key components:**

- **`progress.Tracker`** - Generic event tracker that consumes raw events from a channel, maps them to progress events, and forwards to a visualizer. Handles context cancellation automatically.

- **`bar.barVisualizer`** - Terminal progress bar with scrolling log. Shows recent items with status icons (⏳ running, ✓ completed, ✗ failed) above a progress bar that updates in place. Displays error summary after completion.

- **`simple.SimpleVisualizer`** - Minimal line-by-line output for non-interactive terminals or logging scenarios.

- **Format utilities** - Tree-style error formatting and customizable item name formatters.

- **Slog interception**: The default `slog` logger is replaced with a `bufferedHandler`, allowing the bar visualizer to drain the buffer on each render cycle and print log lines as permanent output above the animated progress bar. Once tracking is complete, the original logger is restored.

- **Terminal detection**: automatic selection between bar (interactive) and simple (piped) visualizers.

<!--
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Fixes: open-component-model/ocm-project#801
Signed-off-by: Piotr Janik <piotr.janik@sap.com>
@piotrjanik piotrjanik merged commit 5719af9 into open-component-model:main Feb 9, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/github-actions Changes on GitHub Actions or within `.github/` directory kind/feature new feature, enhancement, improvement, extension size/l Large size/m Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transformation Logging Visualization (in Terminal)

3 participants