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

Go v1.24.0 migration #2850

Merged
merged 3 commits into from
Feb 14, 2025
Merged

Go v1.24.0 migration #2850

merged 3 commits into from
Feb 14, 2025

Conversation

kmrmt
Copy link
Contributor

@kmrmt kmrmt commented Feb 13, 2025

Description

add GODEBUG parameter for unit tests

Related Issue

Versions

  • Vald Version: v1.7.16
  • Go Version: v1.23.6
  • Rust Version: v1.83.0
  • Docker Version: v27.4.0
  • Kubernetes Version: v1.32.0
  • Helm Version: v3.16.3
  • NGT Version: v2.3.5
  • Faiss Version: v1.9.0

Checklist

Special notes for your reviewer

Summary by CodeRabbit

  • Tests
    • Enhanced test execution by applying new configurations that improve JSON formatted outputs.
  • Chores
    • Upgraded the core Go version from 1.23.6 to 1.24.0.
    • Updated multiple dependency versions to boost compatibility and stability.

Copy link
Contributor

coderabbitai bot commented Feb 13, 2025

📝 Walkthrough

Walkthrough

This pull request introduces the environment variable GODEBUG=gotestjsonbuildtext=1 to several test targets in Makefile.d/test.mk to modify the Go test output format. Additionally, it updates various module files by incrementing the Go version from 1.23.6 to 1.24.0 and upgrading multiple dependency versions, including adjustments in replace directives and version files. There are no changes to exported or public entities.

Changes

File(s) Change Summary
Makefile.d/test.mk Added GODEBUG=$(GODEBUG) to multiple test targets for modifying test execution behavior.
example/client/go.mod, example/client/go.mod.default Updated Go version (1.23.6 → 1.24.0) and bumped various dependency versions.
go.mod Upgraded Go version and several dependencies (e.g., cloud, AWS, golang.org modules) to their newer versions.
hack/go.mod.default Updated Go version (1.23.6 → 1.24.0) and modified dependency replacements (using upgrades or specific branches).
versions/GO_VERSION Bumped software version from 1.23.6 to 1.24.0.
Makefile Added variable GODEBUG := gotestjsonbuildtext=1 to enable specific debugging options for Go tests.

Possibly related PRs

Suggested labels

size/XXL

Suggested reviewers

  • vankichi

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e97fe0c and 5d099a9.

📒 Files selected for processing (2)
  • Makefile (1 hunks)
  • Makefile.d/test.mk (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Makefile.d/test.mk
🔇 Additional comments (1)
Makefile (1)

85-85:

✅ Verification successful

Verify the GODEBUG flag's behavior in Go 1.24.0.

The addition of GODEBUG=gotestjsonbuildtext=1 looks good, as it aligns with the PR's objective to modify test output formatting.

Let's verify if this flag is supported and understand its behavior in Go 1.24.0:


🌐 Web query:

What is the gotestjsonbuildtext flag in Go 1.24.0 GODEBUG? What does it do?

💡 Result:

The gotestjsonbuildtext flag in Go 1.24's GODEBUG environment variable controls whether build-related output during tests appears in structured JSON or traditional text format when using go test -json.

Key Details:

  • Default behavior:
    Go 1.24's go test -json interleaves both test results and build errors as structured JSON[1][4]. This helps tools parse output consistently.

  • Purpose of gotestjsonbuildtext:
    Setting GODEBUG=gotestjsonbuildtext=1 reverts build errors to plain text format while keeping test results in JSON[1][4]. This acts as a compatibility fallback for systems that struggle with mixed JSON/text streams.

Example Use Case:

# With default JSON build errors:
go test -json ./... 

# With text-format build errors:
GODEBUG=gotestjsonbuildtext=1 go test -json ./...

Implementation Notes:

  • Build failures will appear as raw text (like pre-1.24 behavior) while test results remain structured[2][4]
  • Part of broader improvements to JSON output consistency across go build, go install, and go test[1][2]
  • Does not affect standalone builds (go build -json) - only applies to builds triggered by tests[3]

This flag addresses transitional challenges for CI/CD systems adapting to Go's enhanced structured logging capabilities introduced in 1.24[2][4].

Citations:


GODEBUG Flag Verified and Approved

The GODEBUG=gotestjsonbuildtext=1 addition on line 85 in the Makefile is correct. Our verification confirms that in Go 1.24.0 this flag controls whether build errors during tests are output in plain text rather than JSON. This change aligns with the PR objectives by ensuring that test outputs remain compatible with systems requiring text output for build errors.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 13, 2025
@kmrmt kmrmt requested review from a team, vankichi and datelier and removed request for a team February 13, 2025 12:20
kpango
kpango previously approved these changes Feb 14, 2025
Copy link

cloudflare-workers-and-pages bot commented Feb 14, 2025

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5d099a9
Status: ✅  Deploy successful!
Preview URL: https://d957694b.vald.pages.dev
Branch Preview URL: https://bugfix-dependencies-go-updat.vald.pages.dev

View logs

vankichi
vankichi previously approved these changes Feb 14, 2025
@kmrmt kmrmt dismissed stale reviews from vankichi, kpango, and coderabbitai[bot] via 5d099a9 February 14, 2025 07:03
Copy link
Collaborator

@kpango kpango left a comment

Choose a reason for hiding this comment

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

LGTM

@vankichi vankichi merged commit 42b3221 into main Feb 14, 2025
193 of 194 checks passed
@vankichi vankichi deleted the bugfix/dependencies/go-update-migration branch February 14, 2025 08:48
vdaas-ci pushed a commit that referenced this pull request Feb 14, 2025
* add GODEBUG parameter

* centralized parameter management

---------

Co-authored-by: Kiichiro YUKAWA <kyukawa315@gmail.com>
vankichi added a commit that referenced this pull request Feb 14, 2025
* add GODEBUG parameter

* centralized parameter management

---------

Co-authored-by: Kosuke Morimoto <ksk@vdaas.org>
Co-authored-by: Kiichiro YUKAWA <kyukawa315@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants