Skip to content

chore: add lefthook, PR workflows, and CI standardization#1

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

chore: add lefthook, PR workflows, and CI standardization#1
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 PR review workflow (reviewforge) for automated code review
  • Add structlint validation workflow for PRs
  • Add PR title validation for conventional commits (squash merge support)
  • Standardize test.yml with setup-go@v5 and caching

Test plan

  • Verify go test ./... passes
  • Check workflows render correctly in GitHub Actions tab

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

github-actions bot commented Mar 8, 2026

✅ StructLint Validation

Metric Count
Checks passed 49
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

  • Introduces lefthook for pre-commit (gofmt, govet) and commit-msg (conventional commit validation) hooks.
  • Adds GitHub Actions workflows for PR title validation, automated code review (reviewforge), and project structure validation (structlint).
  • Standardizes the test.yml workflow to run only on main branch pushes and pull requests targeting main.

Concerns

⚠️ The lefthook.yml commit message validation regex does not fully align with the Conventional Commits specification, specifically missing support for the breaking change indicator (!). This will cause valid commit messages to fail locally.
⚠️ The test.yml workflow's scope has been narrowed from "**" to main for push events and from all PRs to only PRs targeting main. This is a breaking change in terms of test coverage for other development branches.

Verdict

Request Changes due to the identified logical error in the lefthook.yml regex and the significant change in test workflow coverage.


Code review performed by GEMINI - gemini-2.5-flash.

on:
push:
branches: ["**"]
branches:
Copy link

Choose a reason for hiding this comment

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

[CRITICAL] The push event's branches filter has been changed from "**" to main. This means pushes to any branch other than main will no longer trigger the test workflow. This is a breaking change in workflow coverage and might not be intended if feature branches are expected to run tests on push.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed — push now triggers on all branches, pull_request on main only.

branches: ["**"]
branches:
- main
pull_request:
Copy link

Choose a reason for hiding this comment

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

[CRITICAL] The pull_request event's branches filter has been added to main. This means pull requests targeting branches other than main will no longer trigger the test workflow. This is a breaking change in workflow coverage and might not be intended if feature branches are expected to run tests on PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed — push now triggers on all branches, pull_request on main only.

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.

[CRITICAL] The Conventional Commits regex ^(feat|fix|docs|style|refactor|test|chore|build|ci|perf|revert)(\(.+\))?: .+$ is missing the optional breaking change indicator ! after the scope. A commit message like feat!: add breaking change would be valid Conventional Commit but would fail this local hook. This regex should be consistent with the one used in .github/workflows/pr-title.yml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed — regex now includes (!)? for breaking change indicator.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from a153cfd to 16da5bc Compare March 8, 2026 14:32
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 Pull Request validation, including Conventional Commit title checks, AI-powered code review (reviewforge), and structural linting (structlint).
  • Standardized the test.yml workflow to run on main branch pushes and PRs targeting main, and updated Go setup.
  • Added lefthook configuration for pre-commit (gofmt, govet) and commit-msg (conventional commit linting) hooks.
  • Defined project structure and file naming conventions using .structlint.yaml.

Concerns

  • ⚠️ The commit-msg hook in lefthook.yml uses a Conventional Commits regex that does not account for the optional breaking change marker (!), leading to an inconsistency with the PR title validation workflow.

Verdict

Request Changes: The inconsistency in Conventional Commit regex between lefthook.yml and pr.yml is a logical error that will cause valid commit messages to be rejected by the local hook, even if they would pass the PR title check. This needs to be fixed.


Code review performed by GEMINI - gemini-2.5-flash.

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.

[CRITICAL] The regex ^(feat|fix|docs|style|refactor|test|chore|build|ci|perf|revert)(\(.+\))?: .+$ used here for commit message validation does not include the optional breaking change marker ! (e.g., feat!: description). This is inconsistent with the PR title validation in .github/workflows/pr.yml (line 22) which correctly includes (!)?:. Please update this regex to match the more complete one, allowing for breaking changes in commit messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed — regex now includes (!)? for breaking change indicator.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from 16da5bc to a84a1b7 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 new GitHub Actions workflows for PR validation, including Conventional Commits title checks, AI-powered code review (ReviewForge), and project structure validation (StructLint).
  • Added lefthook configuration for client-side Git hooks, enforcing gofmt, govet, and Conventional Commits for commit messages.
  • Standardized the test.yml workflow by updating step names and modifying the trigger to run only on pull requests targeting the main branch.

Concerns

⚠️ The change in test.yml to trigger only on pull_request events targeting main significantly reduces test coverage compared to the previous configuration which ran on all push events to all branches. This means pushes to feature branches or direct pushes to main will no longer trigger tests, potentially degrading the existing functionality of the CI pipeline.


Verdict

Request Changes: The change in the test.yml workflow's trigger condition is a significant functional alteration that reduces test coverage. This needs to be explicitly addressed to ensure it aligns with the project's testing strategy and does not inadvertently introduce regressions by skipping tests on certain code changes.


Code review performed by GEMINI - gemini-2.5-flash.

on:
push:
branches: ["**"]
pull_request:
Copy link

Choose a reason for hiding this comment

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

[WARNING] The change from push: branches: ["**"] to pull_request: branches: [main] means that tests will no longer run on pushes to feature branches or direct pushes to main. This significantly reduces the scope of CI testing. If the intention is to only run tests on PRs targeting main, this is a functional change that should be explicitly acknowledged. Otherwise, it could lead to a degradation of test coverage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed — push now triggers on all branches, pull_request on main only.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from a84a1b7 to d52fc98 Compare March 8, 2026 14:39
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.
  • Added .github/workflows/pr.yml to validate PR titles against Conventional Commits, run reviewforge for AI code review, and structlint for project structure validation.
  • Created .github/workflows/releaseforge.yml as a reusable workflow for ReleaseForge operations (bump, generate).
  • Added action.yml as a composite GitHub Action for ReleaseForge, handling binary download and command execution.
  • Introduced .structlint.yaml to define and enforce project directory structure and file naming conventions.

Concerns

⚠️ The test.yml workflow has been modified to remove the push trigger for all branches and restrict pull_request triggers to only the main branch. This significantly reduces test coverage, as tests will no longer run on pushes to any branch or on PRs targeting non-main branches. This change is not mentioned in the PR description and could lead to undetected issues in feature branches or direct pushes.


Verdict

Request Changes: The change to test.yml is a critical regression in CI coverage and needs to be addressed or explicitly justified and documented. If this change was unintentional, it should be reverted. If intentional, the rationale should be provided, and alternative testing strategies for other branches should be considered.


Code review performed by GEMINI - gemini-2.5-flash.

@@ -2,18 +2,20 @@ name: Test

on:
push:
Copy link

Choose a reason for hiding this comment

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

[CRITICAL] The on: push: trigger has been removed, and pull_request is now restricted to branches: - main. This means tests will no longer run on pushes to any branch or on pull requests targeting branches other than main. This is a significant reduction in CI coverage and could lead to issues being introduced without immediate detection. Please clarify if this change is intentional. If not, the original branches: ["**"] for push and an unrestricted pull_request trigger should be restored, or a more comprehensive testing strategy for all branches should be implemented.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed — push now triggers on all branches, pull_request on main only.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from d52fc98 to ac8429f 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

  • Introduces new GitHub Actions workflows for PR validation, including Conventional Commits title checks, AI-powered code review, and project structure validation with structlint.
  • Enhances the release workflow to support automatic version bumping based on Conventional Commits, making the tag input optional.
  • Adds lefthook configuration for pre-commit hooks (gofmt, govet) and commit-msg hooks (Conventional Commits validation).
  • Standardizes the test.yml workflow trigger to run only on pull requests targeting the main branch.

Concerns

⚠️ The test.yml workflow's trigger has been changed from push on all branches to pull_request on the main branch only. This significantly reduces test coverage as pushes to feature branches or other non-main branches will no longer trigger tests. This could lead to issues being introduced on branches that are not directly PR'd to main.


Verdict

Request Changes: The change in the test.yml workflow's trigger is a breaking change in CI coverage that needs to be confirmed as intentional or adjusted to ensure adequate testing across all relevant branches.


Code review performed by GEMINI - gemini-2.5-flash.

@@ -2,18 +2,20 @@ name: Test

on:
push:
Copy link

Choose a reason for hiding this comment

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

[WARNING] The on: push trigger for all branches has been removed, and on: pull_request is now limited to the main branch. This means pushes to feature branches or other non-main branches will no longer trigger tests. Please confirm this reduction in test coverage for non-main branches is intentional. If testing is still required for pushes to other branches, the push trigger should be re-added or adjusted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed — push now triggers on all branches, pull_request on main only.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from ac8429f to fa262e7 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 new GitHub Actions workflows for Pull Request (PR) validation, including conventional commit title checks, AI-powered code review (reviewforge), and structural linting (structlint).
  • Enhanced the release workflow (release.yml) to automate version bumping and AI-powered release notes generation using the releaseforge tool, making the tag input optional for auto-detection.
  • Added lefthook.yml for pre-commit and commit-msg hooks, enforcing gofmt, govet, and conventional commit message format locally.

Concerns

⚠️ The test.yml workflow has been modified to only trigger tests on pull_request events targeting the main branch, and on push events to any branch. This means PRs targeting branches other than main will no longer automatically run tests, which could lead to reduced test coverage for feature or release branches.


Verdict

Request Changes: The change in test.yml significantly reduces test coverage for pull requests not targeting the main branch. This is a functional change that could lead to regressions or issues being merged without proper testing. It should be addressed to ensure all PRs are adequately tested.


Code review performed by GEMINI - gemini-2.5-flash.

push:
branches: ["**"]
pull_request:
branches:
Copy link

Choose a reason for hiding this comment

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

[WARNING] The pull_request event is now configured to only trigger for PRs targeting the main branch. This means that pull requests opened against other branches (e.g., feature branches, release branches) will no longer automatically run tests. This significantly reduces test coverage and could allow issues to be introduced into non-main branches without being caught by CI. Consider removing the branches: - main filter to ensure all pull requests run tests, or explicitly define the desired branches if this reduction in coverage is intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed — push now triggers on all branches, pull_request on main only.

@machado144 machado144 force-pushed the chore/standardize-ci-tooling branch from fa262e7 to 6066328 Compare March 8, 2026 14:49
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.
  • Added a new GitHub Actions workflow (pr.yml) to validate PR titles against Conventional Commits, run reviewforge for AI code review, and structlint for project structure validation.
  • Enhanced the release.yml workflow to support automatic version bumping and AI-powered release note generation using releaseforge, making the tag input optional.
  • Created a reusable GitHub Action (action.yml) for releaseforge to simplify its integration into other workflows.

Verdict

Approve: The changes introduce robust CI/CD practices, automate versioning and release notes, and enforce code quality standards. All new configurations and workflow logic appear sound and correctly implemented.


Code review performed by GEMINI - gemini-2.5-flash.

@machado144 machado144 merged commit 79f5761 into main Mar 8, 2026
5 checks passed
@machado144 machado144 deleted the chore/standardize-ci-tooling branch March 8, 2026 14:51
machado144 added a commit that referenced this pull request Mar 8, 2026
## Summary
- Add lefthook.yml with gofmt, govet, and conventional commit hooks
- Add PR review workflow (reviewforge) for automated code review
- Add structlint validation workflow for PRs
- Add PR title validation for conventional commits (squash merge
support)
- Standardize test.yml with setup-go@v5 and caching

## Test plan
- [ ] Verify `go test ./...` passes
- [ ] Check workflows render correctly in GitHub Actions tab
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