Add support for --commit-message option in push:artifact.#1987
Add support for --commit-message option in push:artifact.#1987paweldxm wants to merge 1 commit intoacquia:mainfrom
Conversation
cbd61c9 to
6606d4f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1987 +/- ##
============================================
- Coverage 92.35% 92.22% -0.14%
- Complexity 1953 1956 +3
============================================
Files 123 123
Lines 7168 7186 +18
============================================
+ Hits 6620 6627 +7
- Misses 548 559 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/1987/acli.phar |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please remove the |
Motivation
There was no way to provide a custom commit message when using push:artifact.
In some CI/CD and release workflows, it is important to control the artifact commit message (e.g. for traceability, compliance, or linking deployments to external systems).
This change introduces a safe and optional way to override the default commit message via a CLI option.
Proposed changes
Proposed changes
Adds a new CLI option --commit-message to push:artifact
Allows users to override the default artifact commit message
Adds proper sanitization for user input: removes control characters, enforces single-line commit message, limits message length (255 chars), falls back to default message if input is empty after sanitization
Preserves existing behavior:
This change is fully backward compatible and does not require any migration steps.
Alternatives considered
Testing steps
Follow the contribution guide
to set up the environment or use a pre-built acli.phar.
If running from source, clear cache:
./bin/acli ckc
Build artifact with default behavior:
acli push:artifact
→ verify default commit message is unchanged
Test CLI override:
acli push:artifact --commit-message="Custom deployment message"
→ verify commit message reflects provided value
Test sanitization:
acli push:artifact --commit-message=$'bad\nmessage\x00test'
→ verify message is single-line and clean
Test fallback behavior:
acli push:artifact --commit-message=""
→ verify default message is used