-
Notifications
You must be signed in to change notification settings - Fork 5
Fix non-compliant commit message blocking release workflow #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: elasticdotventures <[email protected]>
Co-authored-by: elasticdotventures <[email protected]>
Co-authored-by: elasticdotventures <[email protected]>
Co-authored-by: elasticdotventures <[email protected]>
Co-authored-by: elasticdotventures <[email protected]>
There was a problem hiding this 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 provides automated tooling and documentation to fix a non-compliant commit message (8be5746) that is blocking the release workflow. The commit message "Add MCP Catalog Trust Score badge" fails cocogitto validation because it lacks the required conventional commit format (missing type prefix and colon separator).
Key Changes:
- Automated shell scripts to rewrite git history and apply the fix via force-push
- Comprehensive documentation covering quick-start guides, deployment instructions, and detailed technical summaries
- Verification approach using cocogitto to validate the corrected commit message format
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/fix-commit-message.sh |
Automates history rewrite using git filter-branch to change commit message format |
scripts/force-push-fix.sh |
Handles force-pushing the corrected history to remote with safety confirmations |
README-FIX.md |
Quick-start guide with multiple fix deployment options |
FORCE_PUSH_REQUIRED.md |
Detailed documentation of the problem, fix approaches, and impact assessment |
FIX_SUMMARY.md |
Execution summary documenting verification results and next steps |
DEPLOYMENT_INSTRUCTIONS.md |
Step-by-step deployment guide for applying the fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| git rebase -i 8be5746^ | ||
| # Change 'pick' to 'reword' for commit 8be5746 | ||
| # Update the message to: docs: Add MCP Catalog Trust Score badge | ||
| # Save and exit | ||
| git push origin main --force | ||
| ``` |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The git rebase approach suggested here (git rebase -i 8be5746^) has a critical flaw. After running git filter-branch to rewrite the commit, the SHA 8be5746d19bdef5f696ce1d449a22b4689a45ee7 no longer exists in the repository history. This command would fail with "unknown revision" error. This documentation should either be removed or clarified that it's an alternative to git filter-branch, not a step to run after it.
|
|
||
| 1. `FORCE_PUSH_REQUIRED.md` - Detailed instructions for fixing the issue | ||
| 2. `scripts/fix-commit-message.sh` - Automated script to perform the fix | ||
| 3. `FIX_SUMMARY.md` - This file, documenting the completed fix |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incomplete list of files in the PR. The documentation mentions only 3 files but the PR actually includes 5 new files: FORCE_PUSH_REQUIRED.md, scripts/fix-commit-message.sh, FIX_SUMMARY.md, README-FIX.md, DEPLOYMENT_INSTRUCTIONS.md, and scripts/force-push-fix.sh. The list should be complete and accurate.
| 3. `FIX_SUMMARY.md` - This file, documenting the completed fix | |
| 3. `FIX_SUMMARY.md` - This file, documenting the completed fix | |
| 4. `README-FIX.md` - Additional documentation for the fix process | |
| 5. `DEPLOYMENT_INSTRUCTIONS.md` - Steps for deploying the fix | |
| 6. `scripts/force-push-fix.sh` - Script to automate force-pushing the fix |
| echo "Force-with-lease failed. Trying regular force push..." | ||
| git push origin main --force |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback from --force-with-lease to --force could be dangerous. If --force-with-lease fails, it's likely because someone else has pushed changes, and using --force would overwrite those changes without warning. Consider either removing the fallback or adding a confirmation prompt before attempting --force.
| echo "Force-with-lease failed. Trying regular force push..." | |
| git push origin main --force | |
| echo "Force-with-lease failed. This usually means someone else has pushed changes." | |
| echo "A regular force push will overwrite remote history and may discard others' work." | |
| read -p "Are you absolutely sure you want to proceed with a plain force push? (yes/no): " force_response | |
| if [ "$force_response" = "yes" ]; then | |
| git push origin main --force | |
| else | |
| echo "Aborted plain force push." | |
| exit 1 | |
| fi |
| ## ✅ Status: Fix Completed Locally | ||
|
|
||
| The problematic commit message has been successfully rewritten in the local repository. |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation states "Fix Completed Locally" but this PR is proposing to add the fix scripts. This creates confusion about whether the fix has already been applied or not. The scripts are designed to fix the commit, but if the commit has already been fixed locally (as stated), then the scripts would be targeting a commit SHA that no longer exists. Consider clarifying whether:
- These scripts are meant to be run after merging this PR, or
- The fix has already been applied and these are just documentation of what was done
The current state is contradictory.
| Expected output: | ||
| ``` | ||
| 02e39a6 docs: Add MCP Catalog Trust Score badge |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar issue: the expected commit SHA 02e39a6 is specific to one execution of the fix. When someone else runs the script, they will get a different SHA. Consider updating this to be more generic or adding a note that the SHA will vary.
| Expected output: | |
| ``` | |
| 02e39a6 docs: Add MCP Catalog Trust Score badge | |
| Expected output (your commit SHA will differ): |
<NEW_COMMIT_SHA> docs: Add MCP Catalog Trust Score badge
| # Use git filter-branch to rewrite the commit message | ||
| FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --msg-filter ' | ||
| if [ "$GIT_COMMIT" = "8be5746d19bdef5f696ce1d449a22b4689a45ee7" ]; then | ||
| echo "docs: Add MCP Catalog Trust Score badge" | ||
| else | ||
| cat | ||
| fi | ||
| ' --force -- --all | ||
|
|
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The git filter-branch command is deprecated. Consider using git filter-repo instead, which is the recommended modern alternative. If git filter-branch must be used, the current implementation is acceptable with the FILTER_BRANCH_SQUELCH_WARNING flag.
| # Use git filter-branch to rewrite the commit message | |
| FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --msg-filter ' | |
| if [ "$GIT_COMMIT" = "8be5746d19bdef5f696ce1d449a22b4689a45ee7" ]; then | |
| echo "docs: Add MCP Catalog Trust Score badge" | |
| else | |
| cat | |
| fi | |
| ' --force -- --all | |
| # Use git filter-repo to rewrite the commit message | |
| if ! command -v git-filter-repo >/dev/null 2>&1; then | |
| echo "ERROR: git-filter-repo is not installed. Please install it first." | |
| exit 1 | |
| fi | |
| git filter-repo --commit-callback ' | |
| if commit.original_id == b"8be5746d19bdef5f696ce1d449a22b4689a45ee7": | |
| commit.message = b"docs: Add MCP Catalog Trust Score badge\n" | |
| ' |
| | Commit SHA | `8be5746d19bdef5f696ce1d449a22b4689a45ee7` | `02e39a6858b626c4c8367da380f4cce88b7ec723` | | ||
| | Message | `Add MCP Catalog Trust Score badge` | `docs: Add MCP Catalog Trust Score badge` | | ||
| | Status | ❌ Invalid | ✅ Valid | | ||
|
|
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded new commit SHA 02e39a6858b626c4c8367da380f4cce88b7ec723 will only be valid if this exact fix was already run. If someone runs the fix-commit-message.sh script, the resulting commit SHA will be different because it depends on the timestamp and other factors. This documentation should clarify that this SHA is specific to a local execution and will differ when others run the script.
| | Commit SHA | `8be5746d19bdef5f696ce1d449a22b4689a45ee7` | `02e39a6858b626c4c8367da380f4cce88b7ec723` | | |
| | Message | `Add MCP Catalog Trust Score badge` | `docs: Add MCP Catalog Trust Score badge` | | |
| | Status | ❌ Invalid | ✅ Valid | | |
| | Commit SHA | `8be5746d19bdef5f696ce1d449a22b4689a45ee7` | `02e39a6858b626c4c8367da380f4cce88b7ec723`[^sha-note] | | |
| | Message | `Add MCP Catalog Trust Score badge` | `docs: Add MCP Catalog Trust Score badge` | | |
| | Status | ❌ Invalid | ✅ Valid | | |
| [^sha-note]: The new commit SHA shown above is specific to this local execution. If you run the `fix-commit-message.sh` script yourself, the resulting commit SHA will be different, as it depends on the timestamp and other factors. |
|
|
||
| ## Impact | ||
| - This will rewrite the history on the remote `main` branch | ||
| - All tags (v0.1.0, v0.1.1, v0.1.2, v0.1.3) have also been rewritten with updated commit SHAs |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistency in the list of affected tags. Line 84 states "(v0.1.0, v0.1.1, v0.1.2, v0.1.3)" but the detailed list in lines 95-99 includes "v0.0.1" as well. The lists should be consistent.
| - All tags (v0.1.0, v0.1.1, v0.1.2, v0.1.3) have also been rewritten with updated commit SHAs | |
| - All tags (v0.0.1, v0.1.0, v0.1.1, v0.1.2, v0.1.3) have also been rewritten with updated commit SHAs |
Commit
8be5746has message "Add MCP Catalog Trust Score badge" which fails cocogitto validation withError: Missing commit type separator ':'. This blocks the release workflow at the conventional commit linting step.Solution
Provided automated tooling to rewrite git history:
scripts/fix-commit-message.sh- Rewrites commit message todocs: Add MCP Catalog Trust Score badgeusinggit filter-branchscripts/force-push-fix.sh- Applies fix to remote via force-pushVerification
Deployment
Requires force-push to apply fix (history rewrite cannot be pushed normally):
This is a one-time operation to fix a historical commit. Team members will need to
git fetch && git reset --hard origin/mainafter deployment.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.