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

feat: auto detect repositoryType #384

Merged
merged 1 commit into from
Oct 26, 2023
Merged

feat: auto detect repositoryType #384

merged 1 commit into from
Oct 26, 2023

Conversation

zqq454224016
Copy link
Collaborator

@zqq454224016 zqq454224016 commented Oct 23, 2023

What type of PR is this?

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #362

Special notes for your reviewer

@zqq454224016 zqq454224016 temporarily deployed to Dev October 24, 2023 02:24 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 24, 2023 02:24 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #384 (b844336) into main (3c8d014) will decrease coverage by 0.21%.
Report is 4 commits behind head on main.
The diff coverage is 3.09%.

@@            Coverage Diff             @@
##             main     #384      +/-   ##
==========================================
- Coverage   27.30%   27.10%   -0.21%     
==========================================
  Files          37       37              
  Lines        4509     4546      +37     
==========================================
+ Hits         1231     1232       +1     
- Misses       3175     3211      +36     
  Partials      103      103              
Files Coverage Δ
api/v1alpha1/condition.go 100.00% <ø> (ø)
controllers/repository_controller.go 44.69% <100.00%> (+0.31%) ⬆️
api/v1alpha1/repository.go 59.84% <0.00%> (-15.39%) ⬇️
controllers/rating_controller.go 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zqq454224016 zqq454224016 requested a review from bjwswang October 26, 2023 02:56
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 02:59 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 02:59 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 03:36 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 03:36 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 03:55 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 03:55 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 05:35 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 05:35 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 requested a review from bjwswang October 26, 2023 05:51
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 08:49 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 08:49 — with GitHub Actions Inactive
@@ -142,7 +142,7 @@ func (r *RepositoryReconciler) checkInitial(ctx context.Context, logger logr.Log
}

if v, ok := instanceDeepCopy.Labels[corev1alpha1.RepositoryTypeLabel]; !ok || v != instanceDeepCopy.Spec.RepositoryType {
instanceDeepCopy.Labels[corev1alpha1.RepositoryTypeLabel] = instanceDeepCopy.Spec.RepositoryType
instanceDeepCopy.Labels[corev1alpha1.RepositoryTypeLabel] = string(instanceDeepCopy.GetRepoType(r.Client))
Copy link
Collaborator

Choose a reason for hiding this comment

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

currType := string(instanceDeepCopy.GetRepoType(r.Client))

if v := instanceDeepCopy.Labels[corev1alpha1.RepositoryTypeLabel];v != currType {
   instanceDeepCopy.Labels[corev1alpha1.RepositoryTypeLabel]
   update = true
}

@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 10:16 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 10:16 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 10:26 — with GitHub Actions Inactive
@zqq454224016 zqq454224016 temporarily deployed to Dev October 26, 2023 10:26 — with GitHub Actions Inactive
@bjwswang bjwswang merged commit 2b04f6a into kubebb:main Oct 26, 2023
19 of 20 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
4 participants