Add support for --commit-message option in push:artifact.#1987
Draft
paweldxm wants to merge 1 commit intoacquia:mainfrom
Draft
Add support for --commit-message option in push:artifact.#1987paweldxm wants to merge 1 commit intoacquia:mainfrom
paweldxm 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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