Fail deployment when static content deployment fails#539
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3e3820740
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Error output (stderr): | ||
| {{ magento_scd_error_output | default('(no stderr output)', true) }} | ||
| when: | ||
| - (magento_scd_error_output | default('') | trim | length) > 0 |
There was a problem hiding this comment.
Avoid treating any stderr bytes as deployment failure
This condition aborts the deployment whenever setup:static-content:deploy writes anything to stderr, even if the command exits successfully (rc=0). In environments where PHP/Magento emits non-fatal notices or deprecation warnings to stderr, successful builds will now be blocked, which is a production-impacting regression from the prior behavior that only failed on command failure.
Useful? React with 👍 / 👎.
| {{ magento_scd_error_output | default('(no stderr output)', true) }} | ||
| when: | ||
| - (magento_scd_error_output | default('') | trim | length) > 0 | ||
| or (magento_scd_output | default('') is search('(?i)(error|exception|fatal)')) |
There was a problem hiding this comment.
Narrow stdout error matching to avoid false failures
The regex marks the run as failed if stdout contains error, exception, or fatal anywhere, which can trigger on benign summaries like “0 errors” or informational text and turn successful deployments into failures. This check should be constrained to known failure patterns (or structured status) rather than raw substring presence.
Useful? React with 👍 / 👎.
f3e3820 to
d974dda
Compare
d974dda to
f68b020
Compare
Currntly if deploy static throw error is not visible during deploy and deployment pass without any warning. This PR change this behaviour and in case of error throw error before bake ami. This allow to catch issues before it can broke frontend.