Skip to content

chore: Update Golang version to 1.26.1 for v2.5.0 release#4602

Open
kislaykishore wants to merge 3 commits intov2.5.0_releasefrom
v2.5.0_go_1_26_1
Open

chore: Update Golang version to 1.26.1 for v2.5.0 release#4602
kislaykishore wants to merge 3 commits intov2.5.0_releasefrom
v2.5.0_go_1_26_1

Conversation

@kislaykishore
Copy link
Copy Markdown
Collaborator

Upgrade the Golang version to 1.26.1. Includes fixes for go vet compatibility.

@kislaykishore kislaykishore requested a review from a team as a code owner April 8, 2026 04:56
@kislaykishore kislaykishore requested review from vadlakondaswetha and removed request for a team April 8, 2026 04:56
@kislaykishore kislaykishore added execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket. labels Apr 8, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the project's Golang dependency to version 1.26.1 in preparation for the v2.5.0 release. In addition to the version bump, the changes include necessary code adjustments to ensure compatibility with stricter Go vet checks, specifically addressing improper formatting arguments in logging and error reporting.

Highlights

  • Golang Version Upgrade: Upgraded the project's Golang version from 1.23.0 to 1.26.1 across all Dockerfiles, configuration files, and CI/CD scripts.
  • Go Vet Compatibility Fixes: Refactored various code snippets to resolve 'go vet' warnings, primarily by removing redundant fmt.Sprintf calls in logging and error handling functions.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/ci.yml
    • .github/workflows/flake-detector.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@kislaykishore kislaykishore changed the title Update Golang version to 1.26.1 for v2.5.0 release chore: Update Golang version to 1.26.1 for v2.5.0 release Apr 8, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Go version to 1.26.1 across the repository, including Dockerfiles, go.mod, and various setup scripts. It also refactors logging and error handling by removing redundant fmt.Sprintf calls within functions like fmt.Errorf and log.Printf. Feedback was provided to further optimize ExecuteGcloudCommandf calls by passing arguments directly to the function instead of pre-formatting the command string and using a "%s" format specifier.

Comment on lines 85 to +86
gcloudProvidePermissionCmd := fmt.Sprintf("alpha storage managed-folders set-iam-policy gs://%s/%s %s", bucket, managedFolderPath, localIAMPolicyFilePath)
_, err = operations.ExecuteGcloudCommandf(gcloudProvidePermissionCmd)
_, err = operations.ExecuteGcloudCommandf("%s", gcloudProvidePermissionCmd)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Instead of pre-formatting the command string with fmt.Sprintf and then passing it to ExecuteGcloudCommandf with a "%s" format, you can pass the arguments directly to ExecuteGcloudCommandf. This is cleaner and avoids redundant formatting.

Suggested change
gcloudProvidePermissionCmd := fmt.Sprintf("alpha storage managed-folders set-iam-policy gs://%s/%s %s", bucket, managedFolderPath, localIAMPolicyFilePath)
_, err = operations.ExecuteGcloudCommandf(gcloudProvidePermissionCmd)
_, err = operations.ExecuteGcloudCommandf("%s", gcloudProvidePermissionCmd)
_, err = operations.ExecuteGcloudCommandf("alpha storage managed-folders set-iam-policy gs://%s/%s %s", bucket, managedFolderPath, localIAMPolicyFilePath)
References
  1. In integration tests, it is acceptable to use exec.Command to call external tools if the test's explicit purpose is to verify the system's behavior when interacting with that specific external tool.

Comment on lines 93 to +95
gcloudRevokePermissionCmd := fmt.Sprintf("alpha storage managed-folders remove-iam-policy-binding gs://%s/%s --member=%s --role=%s", bucket, managedFolderPath, serviceAccount, iamRole)

_, err := operations.ExecuteGcloudCommandf(gcloudRevokePermissionCmd)
_, err := operations.ExecuteGcloudCommandf("%s", gcloudRevokePermissionCmd)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The command can be passed directly to ExecuteGcloudCommandf without an intermediate fmt.Sprintf call.

Suggested change
gcloudRevokePermissionCmd := fmt.Sprintf("alpha storage managed-folders remove-iam-policy-binding gs://%s/%s --member=%s --role=%s", bucket, managedFolderPath, serviceAccount, iamRole)
_, err := operations.ExecuteGcloudCommandf(gcloudRevokePermissionCmd)
_, err := operations.ExecuteGcloudCommandf("%s", gcloudRevokePermissionCmd)
_, err := operations.ExecuteGcloudCommandf("alpha storage managed-folders remove-iam-policy-binding gs://%s/%s --member=%s --role=%s", bucket, managedFolderPath, serviceAccount, iamRole)
References
  1. In integration tests, it is acceptable to use exec.Command to call external tools if the test's explicit purpose is to verify the system's behavior when interacting with that specific external tool.

Comment on lines 60 to +61
gcloudSecretAccessCmd := fmt.Sprintf("secrets versions access latest --secret %s", CredentialsSecretName)
creds, err := operations.ExecuteGcloudCommandf(gcloudSecretAccessCmd)
creds, err := operations.ExecuteGcloudCommandf("%s", gcloudSecretAccessCmd)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Simplify the command execution by passing the format string and arguments directly to ExecuteGcloudCommandf.

Suggested change
gcloudSecretAccessCmd := fmt.Sprintf("secrets versions access latest --secret %s", CredentialsSecretName)
creds, err := operations.ExecuteGcloudCommandf(gcloudSecretAccessCmd)
creds, err := operations.ExecuteGcloudCommandf("%s", gcloudSecretAccessCmd)
creds, err := operations.ExecuteGcloudCommandf("secrets versions access latest --secret %s", CredentialsSecretName)
References
  1. In integration tests, it is acceptable to use exec.Command to call external tools if the test's explicit purpose is to verify the system's behavior when interacting with that specific external tool.

Comment on lines 93 to +94
cmd := fmt.Sprintf("storage buckets remove-iam-policy-binding gs://%s --member=serviceAccount:%s --role=roles/storage.%s", bucket, serviceAccount, permission)
_, err := operations.ExecuteGcloudCommandf(cmd)
_, err := operations.ExecuteGcloudCommandf("%s", cmd)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Avoid redundant formatting by passing the arguments directly to ExecuteGcloudCommandf.

Suggested change
cmd := fmt.Sprintf("storage buckets remove-iam-policy-binding gs://%s --member=serviceAccount:%s --role=roles/storage.%s", bucket, serviceAccount, permission)
_, err := operations.ExecuteGcloudCommandf(cmd)
_, err := operations.ExecuteGcloudCommandf("%s", cmd)
_, err := operations.ExecuteGcloudCommandf("storage buckets remove-iam-policy-binding gs://%s --member=serviceAccount:%s --role=roles/storage.%s", bucket, serviceAccount, permission)
References
  1. In integration tests, it is acceptable to use exec.Command to call external tools if the test's explicit purpose is to verify the system's behavior when interacting with that specific external tool.

Comment on lines 173 to +175
gcloudDeleteManagedFolderCmd := fmt.Sprintf("alpha storage rm -r gs://%s/%s", bucket, managedFolderPath)

_, err := ExecuteGcloudCommandf(gcloudDeleteManagedFolderCmd)
_, err := ExecuteGcloudCommandf("%s", gcloudDeleteManagedFolderCmd)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Simplify by passing the format string and arguments directly to ExecuteGcloudCommandf.

Suggested change
gcloudDeleteManagedFolderCmd := fmt.Sprintf("alpha storage rm -r gs://%s/%s", bucket, managedFolderPath)
_, err := ExecuteGcloudCommandf(gcloudDeleteManagedFolderCmd)
_, err := ExecuteGcloudCommandf("%s", gcloudDeleteManagedFolderCmd)
_, err := ExecuteGcloudCommandf("alpha storage rm -r gs://%s/%s", bucket, managedFolderPath)
References
  1. In integration tests, it is acceptable to use exec.Command to call external tools if the test's explicit purpose is to verify the system's behavior when interacting with that specific external tool.

Comment on lines 182 to +184
gcloudCreateManagedFolderCmd := fmt.Sprintf("alpha storage managed-folders create gs://%s/%s", bucket, managedFolderPath)

_, err := ExecuteGcloudCommandf(gcloudCreateManagedFolderCmd)
_, err := ExecuteGcloudCommandf("%s", gcloudCreateManagedFolderCmd)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Simplify by passing the format string and arguments directly to ExecuteGcloudCommandf.

Suggested change
gcloudCreateManagedFolderCmd := fmt.Sprintf("alpha storage managed-folders create gs://%s/%s", bucket, managedFolderPath)
_, err := ExecuteGcloudCommandf(gcloudCreateManagedFolderCmd)
_, err := ExecuteGcloudCommandf("%s", gcloudCreateManagedFolderCmd)
_, err := ExecuteGcloudCommandf("alpha storage managed-folders create gs://%s/%s", bucket, managedFolderPath)
References
  1. In integration tests, it is acceptable to use exec.Command to call external tools if the test's explicit purpose is to verify the system's behavior when interacting with that specific external tool.

Comment on lines 191 to +193
gcloudCopyFileCmd := fmt.Sprintf("alpha storage cp %s gs://%s/%s/", srcfilePath, bucket, destFilePath)

_, err := ExecuteGcloudCommandf(gcloudCopyFileCmd)
_, err := ExecuteGcloudCommandf("%s", gcloudCopyFileCmd)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Simplify by passing the format string and arguments directly to ExecuteGcloudCommandf.

Suggested change
gcloudCopyFileCmd := fmt.Sprintf("alpha storage cp %s gs://%s/%s/", srcfilePath, bucket, destFilePath)
_, err := ExecuteGcloudCommandf(gcloudCopyFileCmd)
_, err := ExecuteGcloudCommandf("%s", gcloudCopyFileCmd)
_, err := ExecuteGcloudCommandf("alpha storage cp %s gs://%s/%s/", srcfilePath, bucket, destFilePath)
References
  1. In integration tests, it is acceptable to use exec.Command to call external tools if the test's explicit purpose is to verify the system's behavior when interacting with that specific external tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

execute-integration-tests Run only integration tests execute-integration-tests-on-zb To run E2E tests on zonal bucket.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant