Skip to content

Conversation

hosekpeter
Copy link
Contributor

@hosekpeter hosekpeter commented Apr 1, 2025

Jira: PSGO-1053

Changes:

  • Replaced assert.Equal with assert.Empty in multiple test cases for improved clarity.
  • Updated Go module dependencies to their latest versions.

https://golangci-lint.run/

@hosekpeter hosekpeter force-pushed the petr-hosek-PSGO-1053 branch 3 times, most recently from 69eeb53 to ea92271 Compare April 2, 2025 10:01
@hosekpeter hosekpeter marked this pull request as ready for review April 2, 2025 10:13
@hosekpeter hosekpeter requested a review from Copilot April 2, 2025 10:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates several test assertions for improved clarity and consistency, and upgrades Go module dependencies to the latest versions. Key changes include replacing direct assertions (using assert.Equal with an empty string) with more expressive assert.Empty calls, and refactoring several method calls to use updated naming conventions for paths and relations.

Reviewed Changes

Copilot reviewed 121 out of 123 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/pkg/mapper/variables/local_persist_test.go Updated assertions to verify unified handling of relations
internal/pkg/mapper/variables/local_persist.go Changed relation addition method from ConfigRowManifest to a direct method call on row
internal/pkg/mapper/transformation/local_save.go Updated naming method call from ObjectManifest.Path() to w.Path() for determining blocksDir
internal/pkg/mapper/transformation/local_load.go Refactored method calls to use updated path retrieval methods
internal/pkg/mapper/template/replacevalues/replace_test.go Replaced assert.Equal with assert.Empty for clearer intent in testing
internal/pkg/mapper/sharedcode/* Updated path retrieval calls for shared code file handling
internal/pkg/mapper/orchestrator/local_save.go Switched to new path retrieval functions for configPath and phasesDir
internal/pkg/mapper/corefiles/local_load_test.go Updated manifest records handling function call
internal/pkg/git/remote.go Fixed reference to base path in file removal
internal/pkg/fixtures/fixtures.go Corrected default branch field reference
internal/pkg/filesystem/* Minor lint comment updates and improved test assertions for empty values
internal/pkg/env/map_test.go, internal/pkg/encoding/jsonnet/placeholder_test.go, internal/pkg/encoding/json/schema/meta_test.go Updated assertions to assert.Empty for clarity
internal/pkg/diff/diff_test.go Updated state retrieval calls for remote and local states consistently
.github/actions/go-setup/action.yml Added a step to install golangci-lint v2.0.2
Files not reviewed (2)
  • Makefile: Language not supported
  • go.mod: Language not supported
Comments suppressed due to low confidence (2)

internal/pkg/mapper/variables/local_persist.go:144

  • Ensure that replacing 'row.ConfigRowManifest.AddRelation' with 'row.AddRelation' maintains the intended behavior for handling relations, as this change could affect test outcomes.
row.AddRelation(&model.VariablesValuesForRelation{})

internal/pkg/mapper/transformation/local_save.go:44

  • Verify that using 'w.Path()' instead of 'w.ObjectManifest.Path()' returns the correct directory for blocks, ensuring consistency with other path-retrieval methods across the codebase.
blocksDir := w.NamingGenerator().BlocksDir(w.Path())

Copy link
Contributor

@Matovidlo Matovidlo left a comment

Choose a reason for hiding this comment

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

LGTM

@hosekpeter hosekpeter force-pushed the petr-hosek-PSGO-1053 branch from ea92271 to 255168f Compare April 2, 2025 12:22
@hosekpeter hosekpeter force-pushed the petr-hosek-PSGO-1053 branch from 255168f to ba10077 Compare April 2, 2025 12:39
Copy link

github-actions bot commented Apr 2, 2025

Templates API Kubernetes Diff [CI]

Between base f6520d9 ⬅️ head 6a31dd3.

Expand
--- /tmp/artifacts/test-k8s-state.old.json.processed.kv	2025-04-02 15:04:49.886662139 +0000
+++ /tmp/artifacts/test-k8s-state.new.json.processed.kv	2025-04-02 15:04:50.052663764 +0000
@@ -197 +197 @@
-<Deployment/templates-api>.spec.template.spec.containers[0].image = "docker.io/keboola/templates-api:f6520d9-1743605810";
+<Deployment/templates-api>.spec.template.spec.containers[0].image = "docker.io/keboola/templates-api:6a31dd3-1743606034";
@@ -759,3 +759,3 @@
-<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:f6520d9-1743605810";
-<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:f6520d9-1743605810";
-<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:f6520d9-1743605810";
+<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:6a31dd3-1743606034";
+<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:6a31dd3-1743606034";
+<Pod/templates-api-<hash>>.spec.containers[0].image = "docker.io/keboola/templates-api:6a31dd3-1743606034";
@@ -1432 +1432 @@
-<ReplicaSet/templates-api-<hash>>.spec.template.spec.containers[0].image = "docker.io/keboola/templates-api:f6520d9-1743605810";
+<ReplicaSet/templates-api-<hash>>.spec.template.spec.containers[0].image = "docker.io/keboola/templates-api:6a31dd3-1743606034";
@@ -1503,0 +1504,12 @@
+<Secret/sh.helm.release.v1.templates-api-etcd.v2> = {};
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.apiVersion = "v1";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.data = {};
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.kind = "Secret";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata = {};
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.labels = {};
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.labels.name = "templates-api-etcd";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.labels.owner = "helm";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.labels.version = "2";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.name = "sh.helm.release.v1.templates-api-etcd.v2";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.metadata.namespace = "templates-api";
+<Secret/sh.helm.release.v1.templates-api-etcd.v2>.type = "helm.sh/release.v1";


(see artifacts in the Github Action for more information)

@hosekpeter hosekpeter merged commit cedb1bb into main Apr 2, 2025
13 checks passed
@hosekpeter hosekpeter deleted the petr-hosek-PSGO-1053 branch April 2, 2025 16:54
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.

3 participants