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

Fix updatecli config for klipper and helm-controller #11290

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

manuelbuil
Copy link
Contributor

@manuelbuil manuelbuil commented Nov 12, 2024

Proposed Changes

Modify the updatecli config so that it updates the version based on latest tag and not based on date

Types of Changes

Bugfix

Verification

Wait for the script to be executed by updatecli in the next run

Testing

Linked Issues

User-Facing Change


Further Comments

@manuelbuil manuelbuil requested a review from a team as a code owner November 12, 2024 15:22
@manuelbuil manuelbuil requested review from macedogm and removed request for a team November 12, 2024 15:22
dereknola
dereknola previously approved these changes Nov 12, 2024
@macedogm
Copy link
Member

FYI I'm testing locally, as I believe that there is another way to do the same directly with Updatecli syntax.

brandond
brandond previously approved these changes Nov 12, 2024
Copy link
Member

@macedogm macedogm left a comment

Choose a reason for hiding this comment

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

I tested locally and I believe that Updatecli's actual behavior is right. The problem is that we are using the wrong filter. Probably my fault when I first proposed this automation.

The versionfilter in the following lines:

versionfilter:
kind: "latest"

versionfilter:
kind: "latest"

Is getting the latest version based on the date:

image

We should actually use typefilter to look for the latest tag.

diff --git a/updatecli/updatecli.d/klipper-helm-and-controller.yaml b/updatecli/updatecli.d/klipper-helm-and-controller.yaml
index e62e9cb..52456fe 100644
--- a/updatecli/updatecli.d/klipper-helm-and-controller.yaml
+++ b/updatecli/updatecli.d/klipper-helm-and-controller.yaml
@@ -46,8 +46,8 @@ sources:
       repository: "{{ .helm_controller.repo }}"
       branch: "{{ .helm_controller.branch }}"
       token: "{{ requiredEnv .github.token }}"
-      versionfilter:
-        kind: "latest"
+      typefilter:
+        latest: true
   klipper-helm:
     name: "Get Klipper Helm latest release version"
     kind: "githubrelease"
@@ -56,8 +56,8 @@ sources:
       repository: "{{ .klipper_helm.repo }}"
       branch: "{{ .klipper_helm.branch }}"
       token: "{{ requiredEnv .github.token }}"
-      versionfilter:
-        kind: "latest"
+      typefilter:
+        latest: true
   get-pwd:
     name: "Run Updatecli execution directory"
     kind: "shell"

With this change we can drop the fix that you proposed and use Updatecli's proper syntax.

@manuelbuil
Copy link
Contributor Author

I tested locally and I believe that Updatecli's actual behavior is right. The problem is that we are using the wrong filter. Probably my fault when I first proposed this automation.

The versionfilter in the following lines:

versionfilter:
kind: "latest"

versionfilter:
kind: "latest"

Is getting the latest version based on the date:

image

We should actually use typefilter to look for the latest tag.

diff --git a/updatecli/updatecli.d/klipper-helm-and-controller.yaml b/updatecli/updatecli.d/klipper-helm-and-controller.yaml
index e62e9cb..52456fe 100644
--- a/updatecli/updatecli.d/klipper-helm-and-controller.yaml
+++ b/updatecli/updatecli.d/klipper-helm-and-controller.yaml
@@ -46,8 +46,8 @@ sources:
       repository: "{{ .helm_controller.repo }}"
       branch: "{{ .helm_controller.branch }}"
       token: "{{ requiredEnv .github.token }}"
-      versionfilter:
-        kind: "latest"
+      typefilter:
+        latest: true
   klipper-helm:
     name: "Get Klipper Helm latest release version"
     kind: "githubrelease"
@@ -56,8 +56,8 @@ sources:
       repository: "{{ .klipper_helm.repo }}"
       branch: "{{ .klipper_helm.branch }}"
       token: "{{ requiredEnv .github.token }}"
-      versionfilter:
-        kind: "latest"
+      typefilter:
+        latest: true
   get-pwd:
     name: "Run Updatecli execution directory"
     kind: "shell"

With this change we can drop the fix that you proposed and use Updatecli's proper syntax.

Thanks Gui

@manuelbuil manuelbuil dismissed stale reviews from brandond and dereknola via 27e9805 November 12, 2024 18:57
@manuelbuil manuelbuil requested a review from macedogm November 12, 2024 18:57
@manuelbuil manuelbuil changed the title Avoid go mod updating to lower versions Fix updatecli config for klipper and helm-controller Nov 12, 2024
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 13.64%. Comparing base (0c29696) to head (dfd247e).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (0c29696) and HEAD (dfd247e). Click for more details.

HEAD has 18 uploads less than BASE
Flag BASE (0c29696) HEAD (dfd247e)
inttests 11 0
e2etests 7 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #11290       +/-   ##
===========================================
- Coverage   46.97%   13.64%   -33.33%     
===========================================
  Files         179      176        -3     
  Lines       18587    18513       -74     
===========================================
- Hits         8731     2527     -6204     
- Misses       8497    15684     +7187     
+ Partials     1359      302     -1057     
Flag Coverage Δ
e2etests ?
inttests ?
unittests 13.64% <ø> (ø)

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.

Signed-off-by: manuelbuil <mbuil@suse.com>
@manuelbuil manuelbuil merged commit b93fd98 into k3s-io:master Nov 13, 2024
30 checks passed
@manuelbuil manuelbuil deleted the gomodupdate branch November 13, 2024 08:58
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.

4 participants