Skip to content

feat(internal/librarian/golang): add bump for Go libraries#4256

Merged
JoeWang1127 merged 33 commits intomainfrom
feat/bump-golang
Mar 3, 2026
Merged

feat(internal/librarian/golang): add bump for Go libraries#4256
JoeWang1127 merged 33 commits intomainfrom
feat/bump-golang

Conversation

@JoeWang1127
Copy link
Copy Markdown
Contributor

@JoeWang1127 JoeWang1127 commented Feb 28, 2026

Add bump for Go libraries

For #3616

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 82.75862% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.02%. Comparing base (c9868e4) to head (eace0e3).

Files with missing lines Patch % Lines
internal/librarian/bump.go 0.00% 2 Missing ⚠️
internal/librarian/golang/bump.go 90.90% 1 Missing and 1 partial ⚠️
internal/librarian/golang/generate.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4256   +/-   ##
=======================================
  Coverage   82.01%   82.02%           
=======================================
  Files          95       96    +1     
  Lines        7795     7821   +26     
=======================================
+ Hits         6393     6415   +22     
- Misses        975      978    +3     
- Partials      427      428    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 introduces version bumping functionality for Go libraries by adding a new golang package with Bump logic and integrating it into the main bump command. However, it introduces security concerns related to file path handling, specifically the lack of symbolic link checks which could lead to arbitrary file modification. Additionally, the review highlights areas for improving error handling during directory traversal and aligning test failure messages with doc/howwewritego.md.

Comment thread internal/librarian/golang/bump.go Outdated
Comment thread internal/librarian/golang/bump_test.go
Comment thread internal/librarian/golang/bump_test.go
@JoeWang1127 JoeWang1127 marked this pull request as ready for review February 28, 2026 23:02
@JoeWang1127 JoeWang1127 requested a review from a team as a code owner February 28, 2026 23:02
Comment thread internal/librarian/golang/bump.go Outdated
Comment thread internal/librarian/golang/bump.go Outdated
Comment thread internal/librarian/golang/bump.go Outdated
Comment thread internal/librarian/golang/bump.go Outdated
Comment thread internal/librarian/golang/bump.go Outdated
Comment thread internal/snippetmetadata/snippetmetadata.go Outdated
Comment thread internal/snippetmetadata/snippetmetadata.go Outdated
Comment thread internal/snippetmetadata/snippetmetadata.go Outdated
Comment thread internal/snippetmetadata/snippetmetadata.go Outdated
Comment thread internal/snippetmetadata/snippetmetadata.go Outdated
Comment thread internal/librarian/golang/module.go Outdated
Comment thread internal/librarian/golang/bump.go Outdated
@JoeWang1127
Copy link
Copy Markdown
Contributor Author

/gemini review

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 introduces bump functionality for Go libraries, updating internal version and snippet metadata files, and refactors shared logic for determining snippet directory paths. A security audit confirmed that the changes adhere to best practices and introduce no medium, high, or critical severity vulnerabilities, with safe command execution, path traversal protections, strict input validation for version strings, and secure data handling. However, the refactoring has introduced an inconsistency in how the new helper is used in existing code, which could lead to issues, as noted in comments for clean.go and generate.go. There is also a suggestion to improve code organization in bump.go.

Comment thread internal/librarian/golang/clean.go
Comment thread internal/librarian/golang/generate.go
Comment thread internal/librarian/golang/bump.go
@JoeWang1127 JoeWang1127 merged commit 8b1ebc2 into main Mar 3, 2026
27 of 28 checks passed
@JoeWang1127 JoeWang1127 deleted the feat/bump-golang branch March 3, 2026 03:04
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