Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation error for using install hook in mutable content package even if "allowHooksInMutableContent" is set to "true" #37

Open
simontunnat opened this issue Jan 30, 2025 · 0 comments

Comments

@simontunnat
Copy link

simontunnat commented Jan 30, 2025

I'm getting the following validation error for a content package which has a install hook configured:

Using install hooks in mutable content packages leads to deployment failures as the underlying service user on the publish does not have the right to execute those.

This install hook is only needed for local development and is only enabled by an Maven extra profile.
Therefore I tried to disable the error through the allowHooksInMutableContent property, but the error is still reported.

After checking the code it seem the following line is missing a check for the allowHooksInMutableContent variable:

It probably should look like this:

            if (PackageType.CONTENT.equals(packageType) && !allowHooksInMutableContent) {
                return Collections.singleton(new ValidationMessage(defaultSeverity, VIOLATION_MESSAGE_INSTALL_HOOK_IN_MUTABLE_PACKAGE));
            }

Also I don't understand the code enough, as it seems strange to me that there are three checks for the install hooks in the same file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant