Skip to content

repo: abstract v1repoapi as interface #2542

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

xhebox
Copy link
Collaborator

@xhebox xhebox commented Jun 11, 2025

What problem does this PR solve?

Replace V1Repository into an interface, such that we can safely replace it with minimum effort.

Check List

Tests

  • Unit test
  • [] Integration test
  • [] Manual test (add detailed scripts or steps below)
  • [] No code

Code changes

  • [] Has exported function/method change
  • [] Has exported variable/fields change
  • [] Has interface methods change
  • [] Has persistent data change

Side effects

  • [] Possible performance regression
  • [] Increased code complexity
  • [] Breaking backward compatibility

Related changes

  • [] Need to cherry-pick to the release branch
  • [] Need to update the documentation

Release notes:

NONE

Copy link
Contributor

ti-chi-bot bot commented Jun 11, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xhebox for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot requested review from kaaaaaaang and nexustar June 11, 2025 03:39
@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 11, 2025
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 13, 2025
@xhebox xhebox changed the title env: clean up old code repo: abstract v1repoapi as interface Jun 13, 2025
}

// NewRepository returns repository
func NewRepository(os, arch string) (Repository, error) {
profile := localdata.InitProfile()
mirror := repository.NewMirror(environment.Mirror(), repository.MirrorOptions{
Progress: repository.DisableProgress{},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is one different change, DisableProgress behavior is introduced by 5b045ab

@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2025

Codecov Report

Attention: Patch coverage is 51.21951% with 20 lines in your changes missing coverage. Please review.

Project coverage is 53.81%. Comparing base (7b34205) to head (33e6053).

Current head 33e6053 differs from pull request most recent head c1cb5ec

Please upload reports for the commit c1cb5ec to get more accurate results.

Files with missing lines Patch % Lines
components/client/main.go 0.00% 8 Missing ⚠️
pkg/repository/v1_repository.go 60.00% 4 Missing ⚠️
pkg/exec/run.go 40.00% 2 Missing and 1 partial ⚠️
pkg/cluster/clusterutil/cluster.go 0.00% 2 Missing ⚠️
components/playground/main.go 0.00% 1 Missing ⚠️
pkg/environment/env.go 85.71% 0 Missing and 1 partial ⚠️
pkg/repository/clone_mirror.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2542      +/-   ##
==========================================
- Coverage   53.81%   53.81%   -0.00%     
==========================================
  Files         351      351              
  Lines       37425    37390      -35     
==========================================
- Hits        20137    20118      -19     
+ Misses      14872    14854      -18     
- Partials     2416     2418       +2     
Flag Coverage Δ
tiup 33.79% <70.00%> (-0.06%) ⬇️
unittest 18.06% <2.56%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants