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

refactor: create tty copy handler #1485

Merged
merged 8 commits into from
Dec 5, 2024

Conversation

TerryHowe
Copy link
Member

@TerryHowe TerryHowe commented Aug 19, 2024

What this PR does / why we need it:

Create tty copy handler with new StartTracking and StopTracking methods.

Partial: #1542
Closes: #1548

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 83.92857% with 9 lines in your changes missing coverage. Please review.

Project coverage is 84.07%. Comparing base (0998ba4) to head (9c73682).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/oras/internal/display/status/tty.go 78.12% 5 Missing and 2 partials ⚠️
cmd/oras/root/cp.go 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1485      +/-   ##
==========================================
+ Coverage   83.98%   84.07%   +0.08%     
==========================================
  Files         119      119              
  Lines        5315     5325      +10     
==========================================
+ Hits         4464     4477      +13     
+ Misses        604      602       -2     
+ Partials      247      246       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TerryHowe TerryHowe force-pushed the tty-copy-handler branch 7 times, most recently from 9676775 to dca91a9 Compare August 22, 2024 13:32
Copy link

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale Inactive issues or pull requests label Nov 12, 2024
@TerryHowe TerryHowe removed the stale Inactive issues or pull requests label Nov 12, 2024
@wangxiaoxuan273
Copy link
Contributor

Thanks for the contribution @TerryHowe! We'll review it ASAP.

Copy link
Contributor

@qweeah qweeah left a comment

Choose a reason for hiding this comment

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

The overall implementation looks good. Just need to improve tty tests on validating more detailed content.

cmd/oras/internal/display/status/interface.go Outdated Show resolved Hide resolved
cmd/oras/internal/display/status/tty.go Outdated Show resolved Hide resolved
cmd/oras/internal/display/status/tty.go Outdated Show resolved Hide resolved
cmd/oras/internal/display/status/tty.go Outdated Show resolved Hide resolved
cmd/oras/internal/display/status/text.go Outdated Show resolved Hide resolved
cmd/oras/root/cp.go Outdated Show resolved Hide resolved
cmd/oras/root/cp.go Show resolved Hide resolved
cmd/oras/internal/display/status/tty_console_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@qweeah qweeah left a comment

Choose a reason for hiding this comment

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

I think the proposed design of tracking is better than what we have for now. We can further apply it to other commands.

cmd/oras/internal/display/status/tty.go Outdated Show resolved Hide resolved
cmd/oras/internal/display/status/tty.go Outdated Show resolved Hide resolved
cmd/oras/internal/display/status/tty.go Outdated Show resolved Hide resolved
cmd/oras/internal/display/status/tty.go Outdated Show resolved Hide resolved
@TerryHowe TerryHowe force-pushed the tty-copy-handler branch 2 times, most recently from b7a2ecb to 779e5d8 Compare December 4, 2024 00:38
cmd/oras/root/cp_test.go Outdated Show resolved Hide resolved
cmd/oras/root/cp_test.go Outdated Show resolved Hide resolved
@TerryHowe TerryHowe force-pushed the tty-copy-handler branch 2 times, most recently from 1f71707 to c939b42 Compare December 4, 2024 02:18
cmd/oras/root/cp.go Outdated Show resolved Hide resolved
Copy link
Contributor

@qweeah qweeah left a comment

Choose a reason for hiding this comment

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

LGTM

@TerryHowe TerryHowe merged commit 363dc2d into oras-project:main Dec 5, 2024
8 checks passed
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.

refactor oras cp to use handlers for command output
4 participants