chore: standardize CI tooling with lefthook, goreleaser, and reusable workflows#5
Conversation
There was a problem hiding this comment.
Core Changes
- Introduced
lefthookfor pre-commit and commit-msg hooks, enforcinggofmt,govet, and Conventional Commits locally. - Migrated the release workflow to use
GoReleaser, streamlining the build, archiving, and GitHub Release creation process. - Added new GitHub Actions workflows for PR title validation (Conventional Commits),
structlintchecks, and a reusableReviewForgeworkflow. - Updated the
ReviewForgeaction to dynamically fetch the latest release tag instead of using a hardcoded version.
Concerns
release.yml workflow includes manual git tag and git push steps before invoking goreleaser-action. GoReleaser is designed to handle tag creation and pushing as part of its release process. These redundant steps can lead to conflicts or unexpected behavior if the tag already exists or if GoReleaser attempts to create/push the same tag.
.github/workflows/pr-title.yml and lefthook.yml. The lefthook.yml commit-msg hook regex does not include support for the optional breaking change indicator ! (e.g., feat!: description), which is present in the PR title validation. This will cause valid commit messages with breaking changes to fail the local pre-commit hook.
Verdict
Request Changes: The identified inconsistencies and redundancies in the CI/CD setup could lead to workflow failures and developer frustration. Addressing these issues will ensure a smoother and more reliable development experience.
Code review performed by GEMINI - gemini-2.5-flash.
|
|
||
| - name: Build binaries | ||
| run: VERSION=${{ github.event.inputs.tag }} make build | ||
| run: go test ./... -v |
There was a problem hiding this comment.
[WARNING] These git tag and git push commands are redundant and can conflict with goreleaser-action. GoReleaser is designed to handle the creation and pushing of tags as part of its release process. It's best to remove these lines and let GoReleaser manage the tagging.
| run: | | ||
| msg=$(cat {1}) | ||
| if ! echo "$msg" | grep -qE "^(feat|fix|docs|style|refactor|test|chore|build|ci|perf|revert)(\(.+\))?: .+"; then | ||
| echo "Error: Commit message must follow conventional commits format" |
There was a problem hiding this comment.
[WARNING] The Conventional Commits regex here ^(feat|fix|docs|style|refactor|test|chore|build|ci|perf|revert)(\(.+\))?: .+$ is missing the optional breaking change indicator ! (e.g., feat!: description). This creates an inconsistency with the PR title validation workflow (pr-title.yml) which does support it. Please update this regex to match the one in pr-title.yml to avoid local commit failures for valid breaking change commits.
0e1a430 to
cbb7ae1
Compare
✅ StructLint Validation
|
There was a problem hiding this comment.
Core Changes
- Introduced
lefthookfor client-side Git hooks, includinggofmt,govet, and conventional commit message validation. - Migrated the GitHub Release workflow to use
GoReleaserfor automated binary building, archiving, and release creation, replacing manual steps. - Added new GitHub Action workflows for PR title validation (Conventional Commits) and project structure validation (
structlint). Theaction.ymlwas also updated to dynamically fetch the latestReviewForgebinary version.
Verdict
Approve: The changes significantly improve CI/CD automation, standardization, and maintainability. No critical issues were found.
Code review performed by GEMINI - gemini-2.5-flash.
cbb7ae1 to
ff7fff1
Compare
There was a problem hiding this comment.
Core Changes
- Introduced
lefthookfor pre-commit and commit-msg hooks, enforcinggofmt,govet, and Conventional Commits. - Migrated the release workflow to use
GoReleaser, streamlining the build, archiving, and GitHub release creation process. - Added new PR workflows for validating PR titles against Conventional Commits, running
ReviewForgefor AI code review, andstructlintfor project structure validation. - Updated
action.ymlto dynamically fetch the latest release tag forReviewForgeinstead of using a hardcoded version.
Concerns
None.
Verdict
Approve: The changes introduce robust CI/CD tooling and code quality gates without any apparent issues.
Code review performed by GEMINI - gemini-2.5-flash.
ff7fff1 to
40776d3
Compare
There was a problem hiding this comment.
Core Changes
- Introduced
lefthook.ymlfor pre-commit and commit-msg hooks, enforcinggofmt,govet, and Conventional Commits. - Migrated the release workflow (
release.yml) to use GoReleaser, streamlining the build, archive, and release creation process. - Added a new PR workflow (
pr.yml) to validate PR titles against Conventional Commits and integrateReviewForgeandstructlintfor automated code and structure reviews. - Created a reusable
ReviewForgeworkflow (reviewforge.yml) for consistent AI code reviews across repositories. - Updated
action.ymlto dynamically fetch the latestReviewForgerelease tag instead of using a hardcoded version.
Concerns
release.yml workflow explicitly creates and pushes a Git tag before invoking GoReleaser. GoReleaser is designed to handle tag creation and pushing as part of its release process. This redundancy can lead to errors if the tag already exists or if GoReleaser attempts to create a tag that has already been pushed, potentially causing the workflow to fail.
Verdict
Request Changes: The redundant tagging in the release workflow needs to be addressed to prevent potential failures and ensure GoReleaser operates as intended.
Code review performed by GEMINI - gemini-2.5-flash.
|
|
||
| - name: Build binaries | ||
| run: VERSION=${{ github.event.inputs.tag }} make build | ||
| run: go test ./... -v |
There was a problem hiding this comment.
[CRITICAL] These git tag and git push origin commands are redundant and potentially problematic. GoReleaser is designed to create and push the tag as part of its release process. If the tag already exists or is pushed manually before GoReleaser runs, it can cause the GoReleaser action to fail. It's best to remove these lines and let GoReleaser manage the tag lifecycle.
40776d3 to
70f914e
Compare
There was a problem hiding this comment.
Core Changes
- Introduced new GitHub Actions workflows for PR validation, including conventional commit title checks,
reviewforgefor AI code reviews, andstructlintfor project structure validation. - Migrated the release process from a manual build script to
GoReleaserfor automated binary building, archiving, and GitHub releases, including automatic version bumping. - Standardized Go setup in CI workflows (
test.yml,release.yml) to usesetup-go@v5with caching and updated thereviewforgecomposite action to dynamically fetch the latest release tag. - Added
lefthookconfiguration for pre-commit (gofmt, govet) and commit-msg (conventional commit linting) hooks to enforce code quality and commit hygiene locally.
Concerns
None. The changes appear to be well-implemented and enhance the project's CI/CD and development practices without introducing critical issues.
Verdict
Approve: The changes significantly improve the project's automation, code quality enforcement, and release process. All new configurations and workflow updates are correctly implemented.
Code review performed by GEMINI - gemini-2.5-flash.
70f914e to
36a025e
Compare
There was a problem hiding this comment.
Core Changes
- Introduced
lefthook.ymlfor local git hooks, enforcinggofmt,govet, and conventional commit messages. - Refactored the release workflow (
release.yml) to utilizeGoReleaserfor automated binary building, archiving, and GitHub releases, integrating withreleaseforgefor version bumping and release note generation. - Added new GitHub workflows for PR validation (
pr.yml) including conventional commit title checks, AI-powered code review viareviewforge, and structural linting withstructlint. - Created a reusable
reviewforge.ymlworkflow to standardize AI code review across repositories. - Updated
action.ymlto dynamically fetch the latestreviewforgerelease tag instead of using a hardcoded version.
Verdict
Approve: The changes significantly improve the project's CI/CD pipeline, automation, and code quality enforcement. All new configurations and workflow updates are well-implemented and enhance the development process without introducing critical issues.
Code review performed by GEMINI - gemini-2.5-flash.
36a025e to
c2c5b71
Compare
There was a problem hiding this comment.
Core Changes
- Introduced
lefthookfor client-side Git hooks (gofmt, govet, conventional commit message validation). - Implemented new GitHub Actions workflows for PR validation (conventional commit titles,
reviewforge,structlint) and a reusablereviewforgeworkflow. - Migrated the release process to use
goreleaserandreleaseforgeactions, enhancing automation and standardizing binary builds and releases. - Updated
action.ymlto dynamically fetch the latestreviewforgeversion, removing a hardcoded dependency.
Verdict
Approve: The changes introduce robust CI/CD tooling and automation, improving code quality checks and release processes. No critical issues or regressions were identified.
Code review performed by GEMINI - gemini-2.5-flash.
Summary
Test plan
go test ./...passes