This document describes the mandatory workflow for committing changes and releasing new versions of MySQLTuner. Following this process ensures quality, formatting consistency, version integrity, and metadata compliance.
Every contribution to MySQLTuner must pass through a strict formatting, code generation, testing, and commit linting pipeline before being pushed.
All changes (features, bug fixes, chore, etc.) MUST be done in a dedicated Git branch separated from master. Committing directly to the master branch is strictly prohibited.
Ensure that mysqltuner.pl matches the project formatting standard:
make tidyBehind the scenes: This formats the code with perltidy using the project's config .perltidy and cleans up file line endings with dos2unix.
To check if the formatting is correct without modifying the file:
make check-tidyIf your changes affect CLI options, documentation, vulnerability lists, or support metadata, run the appropriate generators before committing:
- Documentation (USAGE.md): Rebuild the markdown usage guide from the Perl POD:
make generate_usage
- Features List (FEATURES.md): Re-extract subroutines list:
make generate_features
- CVE Vulnerabilities (vulnerabilities.csv): Fetch the latest security vulnerability definitions:
make generate_cve
- End-of-Life Support Files (mysql_support.md, mariadb_support.md): Re-extract MySQL and MariaDB EOL dates:
make generate_eof_files
- Current Version File (CURRENT_VERSION.txt): Keep the version file in sync:
make generate_version_file
Validate your changes locally using both unit tests and multi-database lab testing:
- Unit & Regression Tests:
make unit-tests # or prove -r tests/ # (or perl build/audit_tests.pl)
- Laboratory Tests (Docker):
Ensure code executes correctly across multiple database versions (MySQL, MariaDB, Percona Server):
make test # or run all environments make test-all
All commits must follow the standard Conventional Commits specification:
- Allowed Types:
feat,fix,chore,docs,perf,refactor,style,test,ci - Format:
<type>(<scope>): <short summary>followed by optional body/footer. - Interactive Tool: To guarantee compliance, commit using:
npm run commit # or git cz
Husky enforces validation at commit time:
pre-commitHook: Automatically triggersnpm test(prove tests/*.t). If unit tests fail, the commit is blocked.commit-msgHook: Validates the commit message structure against Conventional Commit rules usingcommitlint.
The release lifecycle is governed by automated pre-flight checks and note generators to guarantee stability and release integrity.
Cut a release branch named after the target version (e.g., v2.8.42):
git checkout -b vX.XX.XXEnsure the target version is synchronized across all of the following locations:
- CURRENT_VERSION.txt
- mysqltuner.pl header (
# mysqltuner.pl - Version X.XX.XX) - mysqltuner.pl internal variable (
our $tunerversion = "X.XX.XX") - mysqltuner.pl POD Name (
MySQLTuner X.XX.XX - MySQL High Performance) - mysqltuner.pl POD Version (
Version X.XX.XX) - Changelog latest version header line (
X.XX.XX YYYY-MM-DD)
To update version strings automatically across the codebase, use one of:
make increment_sub_version # Bumps micro/sub version (e.g. 2.8.41 -> 2.8.42)
make increment_minor_version # Bumps minor version (e.g. 2.8.41 -> 2.9.0)
make increment_major_version # Bumps major version (e.g. 2.8.41 -> 3.0.0)- Add detailed bullet points in Changelog under the new version header, categorized by Conventional Commit types (
chore,feat,fix,test,ci, etc.). - Run the
/release-notes-genworkflow (or script directly) to analyze the changelog, delta indicator metrics, and generate/update the corresponding release notes file:Behind the scenes: This compiles the release summary, diagnostic growth statistics, commit differences, and CLI modifications into releases/ (e.g.,python3 build/release_gen.py
releases/v2.8.42.md).
Run the preflight checks to guarantee zero configuration mismatch and 100% compliance:
/release-preflightBehind the scenes: This workflow:
- Verifies version consistency across files (via tests/version_consistency.t).
- Verifies that release notes exist in
releases/v[VERSION].md. - Checks that all commit messages follow conventional commits since the last tag.
- Checks project documentation formatting and metadata compliance.
- Validates
mysqltuner.plcode formatting (make check-tidy). - Runs the smoke test suite (
make test).
The final tag and push sequences are automated by the /release-manager workflow:
- Verify you are on the release branch.
- Commit all synchronized documentation and release notes.
- Perform release tagging:
git tag -a vX.XX.XX -m "Release X.XX.XX" -m "Release notes contents..."
- Push the branch and release tag:
git push origin vX.XX.XX git push origin refs/tags/vX.XX.XX
- Merge back into
masterand ensure tags are force pushed to origin to sync the workspace.