Skip to content

Conversation

@hyp3rd
Copy link
Contributor

@hyp3rd hyp3rd commented Jul 17, 2025

Replace deprecated gopkg.in/yaml.v3 import path with the new canonical go.yaml.in/yaml/v3 path across the codebase. This migration ensures compatibility with modern Go toolchain and dependency management.

Changes include:

  • Update yaml import path in discovery, generate-gnostic, and tools
  • Upgrade Go version from 1.12 to 1.24.5
  • Update dependencies: protobuf (1.36.6), gnostic-models (0.7.0), go-cmp (0.6.0)
  • Modernize code style with implicit struct literals and short variable declarations
  • Regenerate protobuf code with latest protoc-gen-go (1.36.6) and protoc (5.29.3)
  • Add performance optimizations using unsafe package in generated code

This maintains backward compatibility while adopting the supported import path for yaml.v3 library going forward.

Replace deprecated gopkg.in/yaml.v3 import path with the new canonical
go.yaml.in/yaml/v3 path across the codebase. This migration ensures
compatibility with modern Go toolchain and dependency management.

Changes include:
- Update yaml import path in discovery, generate-gnostic, and tools
- Upgrade Go version from 1.12 to 1.24.5
- Update dependencies: protobuf (1.36.6), gnostic-models (0.7.0), go-cmp (0.6.0)
- Modernize code style with implicit struct literals and short variable declarations
- Regenerate protobuf code with latest protoc-gen-go (1.36.6) and protoc (5.29.3)
- Add performance optimizations using unsafe package in generated code

This maintains backward compatibility while adopting the supported import path
for yaml.v3 library going forward.
@hyp3rd hyp3rd requested a review from a team as a code owner July 17, 2025 14:47
@google-cla
Copy link

google-cla bot commented Jul 17, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

hyp3rd and others added 3 commits July 17, 2025 16:51
- Use proper format string in fmt.Fprintf to prevent format string vulnerabilities
- Update file permissions to modern octal syntax (0755 -> 0o755)
- Fix comment spacing to follow Go style conventions

These changes address static analysis warnings and improve code maintainability
while maintaining the same functionality.
Copilot AI review requested due to automatic review settings August 11, 2025 20:31
Copy link

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 migrates the codebase from the deprecated gopkg.in/yaml.v3 import path to the new canonical go.yaml.in/yaml/v3 path to ensure compatibility with modern Go toolchain and dependency management. Additionally, it upgrades Go and dependencies while regenerating protobuf code with the latest tools.

  • Updates yaml import paths across 14 files to use the new canonical path
  • Upgrades Go version from 1.12 to 1.24.5 and updates dependencies (protobuf 1.36.6, gnostic-models 0.7.0, go-cmp 0.6.0)
  • Regenerates protobuf code with latest protoc-gen-go (1.36.6) and protoc (5.29.3) including performance optimizations

Reviewed Changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
go.mod Updates Go version and dependencies, adds new canonical yaml import
tools/j2y2j/main.go Updates yaml import path to new canonical location
openapiv3/OpenAPIv3.go Updates yaml import path to new canonical location
openapiv2/OpenAPIv2.go Updates yaml import path to new canonical location
surface/surface.pb.go Regenerated protobuf code with latest tools and performance optimizations
plugins/plugin.pb.go Regenerated protobuf code with latest tools and performance optimizations
plugins/environment.go Updates format strings and file permissions to use octal literals
metrics/vocabulary.pb.go Regenerated protobuf code with latest tools and performance optimizations
metrics/sourceinfo/sourceinfo.go Updates yaml import path to new canonical location
metrics/complexity.pb.go Regenerated protobuf code with latest tools and performance optimizations
lib/gnostic.go Updates yaml import path and minor code improvements
jsonwriter/writer_test.go Updates yaml import path to new canonical location
jsonwriter/writer.go Updates yaml import path to new canonical location
jsonschema/writer.go Updates yaml import path to new canonical location
jsonschema/reader.go Updates yaml import path to new canonical location
jsonschema/models.go Updates yaml import path to new canonical location
generate-gnostic/main.go Updates yaml import path and modernizes variable declarations
generate-gnostic/generate-extension.go Updates yaml import path and modernizes struct literals
discovery/discovery.go Updates yaml import path to new canonical location

hyp3rd added 2 commits August 11, 2025 23:38
- Remove unnecessary fmt.Sprintf calls for static error messages in OpenAPIv3
- Replace deprecated strings.Replace(-1) with strings.ReplaceAll for clarity
- Simplify string formatting where no placeholders are used

These changes improve code readability, performance, and follow modern Go
best practices while maintaining identical functionality.
Update Go dependencies to latest versions:
- golang.org/x/tools: v0.35.0 → v0.36.0
- google.golang.org/protobuf: v1.36.6 → v1.36.7
- google.golang.org/genproto: updated to 20250811160224
- golang.org/x/mod: v0.26.0 → v0.27.0
- golang.org/x/net: v0.42.0 → v0.43.0
- golang.org/x/text: v0.27.0 → v0.28.0

Regenerate protobuf files with protoc-gen-go v1.36.7 to reflect
the updated dependency versions.

This maintenance update ensures the project uses the latest stable
versions of its dependencies with security fixes and improvements.
Copy link
Collaborator

@Jefftree Jefftree left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thank you!

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.

2 participants