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

Force Push always pushes Rules even when Rules are excluded in Push Publishing filter #19648

Closed
yolabingo opened this issue Dec 3, 2020 · 8 comments

Comments

@yolabingo
Copy link
Contributor

Describe the bug
Rules are included in Push Publishing bundles when using "Force Push Everything" filter, even when excluded in the Force Push filter:
publishing-filters/ForcePush.yml excludeDependencyClasses: [Rule]

To Reproduce

  1. Exclude "Rule" as dependencies in Push Publishing filters - see publishing-filters.zip
  2. Create a Rule on PP sender
  3. Edit any contentlet on the sender and Push Publish it with "Force Push Everything" filter
  4. The Rule will be included in the bundle with the contentlet and Push Published to the receiver

Similarly, deleting the rule on the sender then Force Pushing any content will delete the Rule on the receiver

Expected behavior
ForcePush.yml: excludeDependencyClasses: [Rule] should prevent Rules from being added to Push Publish bundles for contentlets

Screenshots
https://drive.google.com/file/d/1lii-geQvhXrjOEAIRIxQkD7iBLB0mZ0A/view?usp=sharing

Additional context
Tested on 5.3.8.2

@yolabingo
Copy link
Contributor Author

@wezell wezell added this to the Maintenance Sprint milestone Dec 3, 2020
@wezell
Copy link
Contributor

wezell commented Dec 8, 2020

related #19679

@nollymar nollymar self-assigned this Dec 15, 2020
@nollymar
Copy link
Contributor

PR Enterprise: https://github.com/dotCMS/enterprise/pull/767

@nollymar nollymar modified the milestones: Maintenance Sprint, Scout Current Jan 4, 2021
@nollymar
Copy link
Contributor

Important to consider: If you set excludeDependencyClasses: [Rule] and the property PUSH_PUBLISHING_RULES_OVERWRITE=true (by default, it is set to true), rules will be wipped out after pushing. For that reason, we suggest to turn off PUSH_PUBLISHING_RULES_OVERWRITE first.

@fabrizzio-dotCMS
Copy link
Contributor

I turned off the flag PUSH_PUBLISHING_RULES_OVERWRITE=false on the receiver so Rules can be updated
Also turned had the ForcePush.yml to include Rules like this:

title: Force Push Everything
default: false
roles: DOTCMS_BACK_END_USER
filters:
   ## Lucene query that exclude content to be added to the bundle
   excludeQuery: ""
   ## list of classes that should never be pushed: ContentType, Template, Containers, Folder, Host, Links, Workflow, Language, Rule, Contentlet, Category, User, OSGI
   excludeClasses: []
   ## check for any dependency that the pushed asset may need (if false will not look for any dependency or relationship)
   dependencies: true
   ## Lucene query that exclude content to be added to the bundle as a dependency
   excludeDependencyQuery: ""
   ##  list of classes that should never be pushed as dependencies: ContentType, Template, Containers, Folder, Host, Links, Workflow, Language, Rule, Contentlet, Category
   excludeDependencyClasses: [Rule]
   ## force push as always worked, if true will push regardless the pushed asset history
   forcePush: true
   ## check for relationships (if false neither the Relationship object nor the related content nor the related content type will be pushed)
   relationships: true

It is important to notice that there can be files under two different locations
WEB-INF/publishing-filters and
assets/server/publishing-filters
Being the latest the one that takes precedence

o this test was carried out modifying the file under assets/server/publishing-filters

@john-thomas-dotcms
Copy link
Contributor

So what happens if you do push a rule (not filtering it out), and have PUSH_PUBLISHING_RULES_OVERWRITE=false?

Does just the rule you pushed get updated/overwritten?

@nollymar
Copy link
Contributor

@john-thomas-dotcms when PUSH_PUBLISHING_RULES_OVERWRITE=false, existing rules get updated. Otherwise, they are deleted and created again when PUSH_PUBLISHING_RULES_OVERWRITE=true

@nollymar nollymar modified the milestones: 011921_SCOUT, Scout Current Jan 26, 2021
@bryanboza
Copy link
Member

Fixed, tested on release-21.02 // Postgres // FF

@bryanboza bryanboza removed the Needs QA label Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants