feat: support multi-step deployment hooks in project config schema#1109
Merged
Conversation
Deployment hooks (pre, post, pre-install, post-install, pre-update,
post-update) previously accepted only a single script string. They can
now also be defined as a list of steps, each either a plain script
string or a { title, script } object, matching the new format in the
deployment-helper.
- Introduce ConfigDeploymentHook / ConfigDeploymentHookStep types with a
custom UnmarshalYAML that accepts a string, a list of step objects, or
a shorthand list of script strings (and errors on anything else).
- Add a JSONSchema() method emitting oneOf[string, array] so editor
validation accepts both the old and new forms.
- Regenerate internal/shop/config_schema.json.
Companion to shopware/deployment-helper#89.
Code Coverage OverviewLanguages: Go Go / code-coverage/go-testThe overall coverage in the branch remains at 54%, unchanged from the branch. Show a code coverage summary of the most impacted files.
Updated |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 132cc242b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
Su (sushmangupta)
added a commit
to shopware/docs
that referenced
this pull request
Jun 18, 2026
* docs: document multi-step deployment hooks
Deployment hooks can now be defined as a list of steps, each either a
{ title, script } object or a plain script string, in addition to the
existing single-script form. Document both forms in the Deployment
Helper configuration guide.
Companion to shopware/deployment-helper#89 and shopware/shopware-cli#1109.
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Su <112690947+sushmangupta@users.noreply.github.com>
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.
What
Update the
.shopware-project.ymlconfig schema so deployment hooks (pre,post,pre-install,post-install,pre-update,post-update) accept both the existing single-script form and the new multi-step form.Why
The deployment-helper now allows a hook to be defined as a list of titled steps that are executed individually, for clearer per-step output. This PR keeps shopware-cli's schema and config parsing in sync so the new form validates in editors and doesn't break
ReadConfig.Companion to shopware/deployment-helper#89.
Supported forms
How
ConfigDeploymentHook/ConfigDeploymentHookSteptypes ininternal/shop/config.go.UnmarshalYAMLaccepts a string, a list of{title, script}objects, or a shorthand list of script strings; errors on anything else. This matters becauseReadConfigunmarshals the project config, so a plainstringfield would fail on the new list form.JSONSchema()emitsoneOf: [string, array<oneOf: [string, {title, script}]>], mirroring the existing custom-schema pattern used byConfigDeploymentOverrides.internal/shop/config_schema.jsonviascripts/schema.go.Backwards compatibility
Fully backwards compatible — string hooks parse and validate exactly as before.
Testing
internal/shop/config_hook_test.gocovers string, empty string, step list, string-list shorthand, and the invalid case.go test ./internal/shop/,go vet, andgofmtall clean. Schema regeneration is stable.