Skip to content

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

Description

@simontunnat

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions