Skip to content

Conversation

@erastusndico
Copy link
Contributor

No description provided.

@erastusndico erastusndico requested a review from a team as a code owner November 20, 2025 11:18
Copilot AI review requested due to automatic review settings November 20, 2025 11:18
@github-actions
Copy link

Coverage report for ./CoreRuntime

St.
Category Percentage Covered / Total
🟢 Statements 86.58% 1135/1311
🟡 Branches 70.31% 450/640
🟢 Functions 86.62% 123/142
🟢 Lines 87.35% 1119/1281

Test suite run success

276 tests passing in 31 suites.

Report generated by 🧪jest coverage report action from af8dc11

@github-actions
Copy link

🔒 CodeQL Security Analysis Results

CodeQL analysis has been completed for this pull request.

Language: javascript
Status: success

📊 View detailed results: Check the Security tab for complete findings.

💡 Next steps:

  • Review any security findings in the Security tab
  • Address high/critical severity issues before merging
  • Consider the recommendations for code quality improvements

This comment was generated automatically by CodeQL Analysis

@erastusndico erastusndico merged commit 294a2c7 into main Nov 20, 2025
12 checks passed
Copy link
Contributor

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 adds conventional commit validation hooks to enforce standardized commit message format across the repository. The hooks validate commit messages locally before they're pushed, while the CI/CD workflow validates them during deployment to ensure consistency with semantic versioning.

Key Changes:

  • Added Git hooks (commit-msg) to validate conventional commit format locally
  • Updated deployment workflow to enforce conventional commit format in CI/CD
  • Added installation scripts for both Unix-like systems and Windows

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
hooks/install-hooks.sh Installation script for Git hooks on Linux/macOS/Git Bash
hooks/install-hooks.bat Installation script for Git hooks on Windows Command Prompt
hooks/commit-msg Git hook that validates commit messages against conventional commit format
hooks/README.md Documentation for the Git hooks, installation instructions, and commit message format
.github/workflows/deploy-to-dev.yaml Updated deployment workflow to validate conventional commits and fail if commits don't follow the required format

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

commit_msg=$(cat "$commit_msg_file")

# Conventional commit pattern
conventional_pattern='^(feat|fix|docs|chore|refactor|test|perf|ci|build|style|revert)(\(.+\))?!?: .{1,}'
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The commit-msg hook accepts commit types perf, ci, build, and style, but the semantic-release configuration in the workflow (lines 47-53 of deploy-to-dev.yaml) doesn't include these types in its release rules. This means commits with these types will pass the local hook validation but won't trigger a version bump, causing the CI/CD pipeline to fail with the error "Conventional commits found but semantic-release did not generate a version."

Either add these types to the semantic-release configuration or remove them from this pattern.

Copilot uses AI. Check for mistakes.
MINOR=$((MINOR + 1))
PATCH=0
# Check if any commit follows conventional commit format
if echo "$COMMITS_SINCE_TAG" | grep -qE "^(feat|fix|docs|chore|refactor|test|perf|ci|build|style)(\(.+\))?:"; then
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The regex pattern is missing the revert type that is included in the commit-msg hook (line 11 of hooks/commit-msg) and documentation (line 46 of hooks/README.md). This creates an inconsistency where commits with type revert would pass the local hook validation but fail this check.

Add |revert to the pattern if revert should be supported, or remove it from the hook and documentation if it shouldn't be.

Suggested change
if echo "$COMMITS_SINCE_TAG" | grep -qE "^(feat|fix|docs|chore|refactor|test|perf|ci|build|style)(\(.+\))?:"; then
if echo "$COMMITS_SINCE_TAG" | grep -qE "^(feat|fix|docs|chore|refactor|test|perf|ci|build|style|revert)(\(.+\))?:"; then

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +34
echo "Allowed types:"
echo " feat: A new feature (minor version bump)"
echo " fix: A bug fix (patch version bump)"
echo " docs: Documentation only changes (patch version bump)"
echo " chore: Changes that don't modify src or test files (patch version bump)"
echo " refactor: A code change that neither fixes a bug nor adds a feature (patch version bump)"
echo " test: Adding missing tests or correcting existing tests (patch version bump)"
echo " perf: A code change that improves performance (patch version bump)"
echo " ci: Changes to CI configuration files and scripts (patch version bump)"
echo " build: Changes that affect the build system or dependencies (patch version bump)"
echo " style: Changes that don't affect code meaning (white-space, formatting) (patch version bump)"
echo " revert: Reverts a previous commit (patch version bump)"
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The commit-msg hook lists 11 commit types (including revert, perf, ci, build, style) that will pass validation, but the semantic-release configuration in the workflow only supports 6 types. This means commits using the additional types will pass the local hook but fail in CI/CD with the error "Conventional commits found but semantic-release did not generate a version."

Update this help text to only list the commit types that are configured in semantic-release (feat, fix, docs, chore, refactor, test) or add the missing types to the semantic-release configuration.

Copilot uses AI. Check for mistakes.
commit_msg=$(cat "$commit_msg_file")

# Conventional commit pattern
conventional_pattern='^(feat|fix|docs|chore|refactor|test|perf|ci|build|style|revert)(\(.+\))?!?: .{1,}'
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The regex pattern .{1,} will match any single character (including just whitespace), which allows commits like feat: or fix: x with minimal or no meaningful description. Consider using a more restrictive pattern like .{3,} or [^\s].{2,} to ensure a minimum meaningful description length.

Suggested change
conventional_pattern='^(feat|fix|docs|chore|refactor|test|perf|ci|build|style|revert)(\(.+\))?!?: .{1,}'
conventional_pattern='^(feat|fix|docs|chore|refactor|test|perf|ci|build|style|revert)(\(.+\))?!?: [^\s].{2,}'

Copilot uses AI. Check for mistakes.
echo "Example: 'feat: add new authentication feature'"
echo ""
echo "Recent commits:"
echo "$COMMITS_SINCE_TAG"
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The variable COMMITS_SINCE_TAG should be quoted when used in the echo on line 98 to preserve newlines and formatting. Change to echo "$COMMITS_SINCE_TAG" to ensure multiline commit messages are displayed correctly.

Copilot uses AI. Check for mistakes.

# Optional: Check minimum description length
description=$(echo "$commit_msg" | head -n 1 | sed -E 's/^[^:]+: //')
if [ ${#description} -lt 10 ]; then
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The syntax ${#description} for getting string length is a bash-ism that may not work in pure POSIX sh on some systems. Since the shebang is #!/bin/sh, this could cause the script to fail on systems where /bin/sh is not bash (e.g., dash on Debian/Ubuntu).

Either change the shebang to #!/bin/bash or use a POSIX-compatible approach: if [ $(echo "$description" | wc -c) -lt 10 ]; then

Suggested change
if [ ${#description} -lt 10 ]; then
if [ $(echo "$description" | wc -c) -lt 10 ]; then

Copilot uses AI. Check for mistakes.
- **ci**: CI/CD configuration changes (triggers patch version bump)
- **build**: Build system or dependency changes (triggers patch version bump)
- **style**: Code style changes (formatting, semicolons, etc.) (triggers patch version bump)
- **revert**: Reverting a previous commit (triggers patch version bump)
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The documentation lists revert as an allowed commit type (line 46), but the semantic-release configuration in the workflow (lines 47-53 of deploy-to-dev.yaml) doesn't include revert in its release rules. This inconsistency means commits with type revert will pass validation but won't trigger a version bump in the CI/CD pipeline.

Either add revert to the semantic-release configuration or remove it from the documentation.

Suggested change
- **revert**: Reverting a previous commit (triggers patch version bump)

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +45
- **perf**: Performance improvements (triggers patch version bump)
- **ci**: CI/CD configuration changes (triggers patch version bump)
- **build**: Build system or dependency changes (triggers patch version bump)
- **style**: Code style changes (formatting, semicolons, etc.) (triggers patch version bump)
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The documentation lists commit types perf, ci, build, and style (lines 42-45), but the semantic-release configuration in the workflow (lines 47-53 of deploy-to-dev.yaml) doesn't include these types in its release rules. This inconsistency means commits with these types will pass validation but won't trigger a version bump in the CI/CD pipeline.

Either add these types to the semantic-release configuration or remove them from the documentation.

Suggested change
- **perf**: Performance improvements (triggers patch version bump)
- **ci**: CI/CD configuration changes (triggers patch version bump)
- **build**: Build system or dependency changes (triggers patch version bump)
- **style**: Code style changes (formatting, semicolons, etc.) (triggers patch version bump)

Copilot uses AI. Check for mistakes.
MINOR=$((MINOR + 1))
PATCH=0
# Check if any commit follows conventional commit format
if echo "$COMMITS_SINCE_TAG" | grep -qE "^(feat|fix|docs|chore|refactor|test|perf|ci|build|style)(\(.+\))?:"; then
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The semantic-release configuration only includes 6 commit types (feat, fix, docs, chore, refactor, test) but the validation logic checks for 10 types (feat, fix, docs, chore, refactor, test, perf, ci, build, style). Commits with types perf, ci, build, or style will pass the validation check but won't trigger a version bump from semantic-release, leading to the confusing error "Conventional commits found but semantic-release did not generate a version."

Either add these types to the semantic-release configuration in lines 47-53, or remove them from the validation pattern on line 81.

Suggested change
if echo "$COMMITS_SINCE_TAG" | grep -qE "^(feat|fix|docs|chore|refactor|test|perf|ci|build|style)(\(.+\))?:"; then
if echo "$COMMITS_SINCE_TAG" | grep -qE "^(feat|fix|docs|chore|refactor|test)(\(.+\))?:"; then

Copilot uses AI. Check for mistakes.
commit_msg=$(cat "$commit_msg_file")

# Conventional commit pattern
conventional_pattern='^(feat|fix|docs|chore|refactor|test|perf|ci|build|style|revert)(\(.+\))?!?: .{1,}'
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The commit-msg hook accepts revert as a valid commit type, but the semantic-release configuration in the workflow (lines 47-53 of deploy-to-dev.yaml) doesn't include revert in its release rules. This means commits with type revert will pass the local hook validation but won't trigger a version bump, causing the CI/CD pipeline to fail with a confusing error message.

Either add revert to the semantic-release configuration or remove it from this pattern.

Copilot uses AI. Check for mistakes.
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