Skip to content

chore: standardize CI tooling with lefthook, goreleaser, and reusable workflows#5

Merged
machado144 merged 1 commit intomainfrom
chore/standardize-ci-tooling
Mar 8, 2026
Merged

chore: standardize CI tooling with lefthook, goreleaser, and reusable workflows#5
machado144 merged 1 commit intomainfrom
chore/standardize-ci-tooling

Conversation

@machado144
Copy link
Contributor

Summary

  • Add lefthook.yml with gofmt, govet, and conventional commit hooks
  • Add .goreleaser.yml and migrate release workflow from manual build to GoReleaser
  • Fix action.yml to fetch latest release instead of hardcoded v1.5.0
  • Add reusable workflow (reviewforge.yml) for other repos
  • Add PR title validation for conventional commits (squash merge support)
  • Add structlint validation workflow for PRs
  • Standardize test.yml with setup-go@v5 and caching

Test plan

  • Verify go test ./... passes
  • Check workflows render correctly in GitHub Actions tab
  • Test action.yml latest version resolution

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Core Changes

  • Introduced lefthook for pre-commit and commit-msg hooks, enforcing gofmt, 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), structlint checks, and a reusable ReviewForge workflow.
  • Updated the ReviewForge action to dynamically fetch the latest release tag instead of using a hardcoded version.

Concerns

⚠️ The 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.

⚠️ There is an inconsistency in the Conventional Commits regex between the new .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
Copy link

Choose a reason for hiding this comment

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

[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"
Copy link

Choose a reason for hiding this comment

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

[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.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from 0e1a430 to cbb7ae1 Compare March 8, 2026 14:30
@github-actions
Copy link

github-actions bot commented Mar 8, 2026

✅ StructLint Validation

Metric Count
Checks passed 54
Violations 0

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Core Changes

  • Introduced lefthook for client-side Git hooks, including gofmt, govet, and conventional commit message validation.
  • Migrated the GitHub Release workflow to use GoReleaser for 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). The action.yml was also updated to dynamically fetch the latest ReviewForge binary 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.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from cbb7ae1 to ff7fff1 Compare March 8, 2026 14:33
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Core Changes

  • Introduced lefthook for pre-commit and commit-msg hooks, enforcing gofmt, 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 ReviewForge for AI code review, and structlint for project structure validation.
  • Updated action.yml to dynamically fetch the latest release tag for ReviewForge instead 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.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from ff7fff1 to 40776d3 Compare March 8, 2026 14:34
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Core Changes

  • Introduced lefthook.yml for pre-commit and commit-msg hooks, enforcing gofmt, 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 integrate ReviewForge and structlint for automated code and structure reviews.
  • Created a reusable ReviewForge workflow (reviewforge.yml) for consistent AI code reviews across repositories.
  • Updated action.yml to dynamically fetch the latest ReviewForge release tag instead of using a hardcoded version.

Concerns

⚠️ Redundant Tagging in Release Workflow: The 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
Copy link

Choose a reason for hiding this comment

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

[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.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from 40776d3 to 70f914e Compare March 8, 2026 14:40
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Core Changes

  • Introduced new GitHub Actions workflows for PR validation, including conventional commit title checks, reviewforge for AI code reviews, and structlint for project structure validation.
  • Migrated the release process from a manual build script to GoReleaser for automated binary building, archiving, and GitHub releases, including automatic version bumping.
  • Standardized Go setup in CI workflows (test.yml, release.yml) to use setup-go@v5 with caching and updated the reviewforge composite action to dynamically fetch the latest release tag.
  • Added lefthook configuration 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.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from 70f914e to 36a025e Compare March 8, 2026 14:45
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Core Changes

  • Introduced lefthook.yml for local git hooks, enforcing gofmt, govet, and conventional commit messages.
  • Refactored the release workflow (release.yml) to utilize GoReleaser for automated binary building, archiving, and GitHub releases, integrating with releaseforge for version bumping and release note generation.
  • Added new GitHub workflows for PR validation (pr.yml) including conventional commit title checks, AI-powered code review via reviewforge, and structural linting with structlint.
  • Created a reusable reviewforge.yml workflow to standardize AI code review across repositories.
  • Updated action.yml to dynamically fetch the latest reviewforge release 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.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from 36a025e to c2c5b71 Compare March 8, 2026 14:56
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Core Changes

  • Introduced lefthook for 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 reusable reviewforge workflow.
  • Migrated the release process to use goreleaser and releaseforge actions, enhancing automation and standardizing binary builds and releases.
  • Updated action.yml to dynamically fetch the latest reviewforge version, 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.

@machado144 machado144 merged commit b5fb174 into main Mar 8, 2026
5 checks passed
@machado144 machado144 deleted the chore/standardize-ci-tooling branch March 8, 2026 15:01
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.

1 participant