core icon indicating copy to clipboard operation
core copied to clipboard

Push Publishing: Force Push does not create a new PushedAssets history object

Open joseorsini opened this issue 10 years ago • 4 comments

Reproduced in 3.5. Follow-up to https://github.com/dotCMS/core/issues/9289 Ticket.

When a content is Force-Pushed to a Receiver environment, its Pushed Asset History is not created in DB, so there is no way if a Content was previously pushed to a Receiver environment.

Steps to reproduce:

  1. Create a content.
  2. Force-Push it to a Receiver environment.
  3. Check in Sender's Environment for its Push History. List is empty
screen shot 2016-07-01 at 11 48 39 am

In DB:

35dist=# select * from publishing_pushed_assets where asset_id ='3914c7c7-aac4-4a2c-8bd9-5d38e066e1bd';
 bundle_id | asset_id | asset_type | push_date | environment_id
-----------+----------+------------+-----------+----------------
(0 rows)

Another Scenario:

  1. Create a Content. Push it to a Receiver side (Force Push is Disabled).
  2. Edit the content in Sender side.
  3. Force Push it to a Receiver side.

Content Identifier is: 3c97c75d-f3e7-4648-bd09-6eab147fa11e Info on DB:

35dist=# select * from publishing_pushed_assets where asset_id = '3c97c75d-f3e7-4648-bd09-6eab147fa11e';
              bundle_id               |               asset_id               | asset_type |        push_date        |            environment_id
--------------------------------------+--------------------------------------+------------+-------------------------+--------------------------------------
 54280748-5835-4ab4-a26e-9929069343b2 | 3c97c75d-f3e7-4648-bd09-6eab147fa11e | content    | 2016-07-01 11:40:00.234 | c0302c54-4467-4d55-b91c-6ddcdf8b78a6
(1 row)

35dist=# select * from publishing_queue_audit where status_pojo like '%3c97c75d-f3e7-4648-bd09-6eab147fa11e%';
              bundle_id               | status |                           status_pojo                           |     status_updated      |       create_date
--------------------------------------+--------+-----------------------------------------------------------------+-------------------------+-------------------------
 54280748-5835-4ab4-a26e-9929069343b2 |      9 | <com.dotcms.publisher.business.PublishAuditHistory>            +| 2016-07-01 11:40:00.152 | 2016-07-01 11:40:00.152
                                      |        |   <endpointsMap>                                               +|                         |
                                      |        |     <entry>                                                    +|                         |
                                      |        |       <string>c0302c54-4467-4d55-b91c-6ddcdf8b78a6</string>    +|                         |
                                      |        |       <map>                                                    +|                         |
                                      |        |         <entry>                                                +|                         |
                                      |        |           <string>71c8aba5-748c-4533-8a0b-f773b1a0e87a</string>+|                         |
                                      |        |           <com.dotcms.publisher.business.EndpointDetail>       +|                         |
                                      |        |             <status>9</status>                                 +|                         |
                                      |        |             <info>Everything ok</info>                         +|                         |
                                      |        |           </com.dotcms.publisher.business.EndpointDetail>      +|                         |
                                      |        |         </entry>                                               +|                         |
                                      |        |       </map>                                                   +|                         |
                                      |        |     </entry>                                                   +|                         |
                                      |        |   </endpointsMap>                                              +|                         |
                                      |        |   <bundleStart>2016-07-01 15:40:00.298 UTC</bundleStart>       +|                         |
                                      |        |   <bundleEnd>2016-07-01 15:40:00.346 UTC</bundleEnd>           +|                         |
                                      |        |   <publishStart>2016-07-01 15:40:01.220 UTC</publishStart>     +|                         |
                                      |        |   <publishEnd>2016-07-01 15:40:01.993 UTC</publishEnd>         +|                         |
                                      |        |   <numTries>1</numTries>                                       +|                         |
                                      |        |   <assets>                                                     +|                         |
                                      |        |     <entry>                                                    +|                         |
                                      |        |       <string>3c97c75d-f3e7-4648-bd09-6eab147fa11e</string>    +|                         |
                                      |        |       <string>contentlet</string>                              +|                         |
                                      |        |     </entry>                                                   +|                         |
                                      |        |   </assets>                                                    +|                         |
                                      |        | </com.dotcms.publisher.business.PublishAuditHistory>            |                         |
 fbdc16f1-daad-4f74-a4b7-5fdd22cf5036 |      9 | <com.dotcms.publisher.business.PublishAuditHistory>            +| 2016-07-01 11:43:00.02  | 2016-07-01 11:43:00.02
                                      |        |   <endpointsMap>                                               +|                         |
                                      |        |     <entry>                                                    +|                         |
                                      |        |       <string>c0302c54-4467-4d55-b91c-6ddcdf8b78a6</string>    +|                         |
                                      |        |       <map>                                                    +|                         |
                                      |        |         <entry>                                                +|                         |
                                      |        |           <string>71c8aba5-748c-4533-8a0b-f773b1a0e87a</string>+|                         |
                                      |        |           <com.dotcms.publisher.business.EndpointDetail>       +|                         |
                                      |        |             <status>9</status>                                 +|                         |
                                      |        |             <info>Everything ok</info>                         +|                         |
                                      |        |           </com.dotcms.publisher.business.EndpointDetail>      +|                         |
                                      |        |         </entry>                                               +|                         |
                                      |        |       </map>                                                   +|                         |
                                      |        |     </entry>                                                   +|                         |
                                      |        |   </endpointsMap>                                              +|                         |
                                      |        |   <bundleStart>2016-07-01 15:43:00.125 UTC</bundleStart>       +|                         |
                                      |        |   <bundleEnd>2016-07-01 15:43:00.256 UTC</bundleEnd>           +|                         |
                                      |        |   <publishStart>2016-07-01 15:43:00.364 UTC</publishStart>     +|                         |
                                      |        |   <publishEnd>2016-07-01 15:43:00.990 UTC</publishEnd>         +|                         |
                                      |        |   <numTries>1</numTries>                                       +|                         |
                                      |        |   <assets>                                                     +|                         |
                                      |        |     <entry>                                                    +|                         |
                                      |        |       <string>3c97c75d-f3e7-4648-bd09-6eab147fa11e</string>    +|                         |
                                      |        |       <string>contentlet</string>                              +|                         |
                                      |        |     </entry>                                                   +|                         |
                                      |        |   </assets>                                                    +|                         |
                                      |        | </com.dotcms.publisher.business.PublishAuditHistory>            |                         |
(2 rows)

Info on the publishingqueue table does not match with that's stored on the publishingpushed_assets table. There should be two entries regarding the status of that content getting pushed to a specific environment.

joseorsini avatar Jul 01 '16 15:07 joseorsini

This can be reproduced on latest release. Anytime a Content is force pushed, it doesn't create a Pushed Assets history for it, so it's difficult to get an accurate audit trail of contents being pushed across different environments.

Reported by customer : https://dotcms.zendesk.com/agent/tickets/94957

joseorsini avatar Jan 25 '18 17:01 joseorsini

This block of code

https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotcms/publisher/util/DependencySet.java#L211-L223

needs to be outside this if block

https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotcms/publisher/util/DependencySet.java#L175

so we can get a PushedAsset object whether force push is set or not. This is a starting point for solving this issue.

joseorsini avatar Jan 25 '18 21:01 joseorsini

Passed QA. Push history now is showing entries in sender side when an asset was pushed 3 times to receiver: image

In database:

select * from publishing_pushed_assets where asset_id = 'ce5f4211-8f32-4365-a92a-0cf3f359890c'
              bundle_id               |               asset_id               | asset_type |        push_date        |            environment_id
--------------------------------------+--------------------------------------+------------+-------------------------+--------------------------------------
"0f8e17e5-4acb-45ef-99a4-ee0555ef7714"|"ce5f4211-8f32-4365-a92a-0cf3f359890c"|"content"	  |"2018-02-02 13:34:23.617"|"8b28395b-58c2-42fc-8557-091a6d90804f"
"0a37b1a6-899a-4d77-97fa-7b2de84215e2"|"ce5f4211-8f32-4365-a92a-0cf3f359890c"|"content"   |"2018-02-02 13:31:28.369"|"8b28395b-58c2-42fc-8557-091a6d90804f"
"1ada1019-460e-493c-aa4a-929aa04b955c"|"ce5f4211-8f32-4365-a92a-0cf3f359890c"|"content"   |"2018-02-02 12:58:27.031"|"8b28395b-58c2-42fc-8557-091a6d90804f"

Tested in master branch / Mac OS 10.10 / Postgres 9.6.6 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8.6

shaydotcms avatar Feb 02 '18 20:02 shaydotcms

Passed QA Tested on release-4.3.0 branch Mac OS 10.10 / Postgres 9.6.6 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8.6

shaydotcms avatar Feb 14 '18 20:02 shaydotcms