Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370766 - Auto publish will not triggered for structure changes
Summary: Auto publish will not triggered for structure changes
Status: RESOLVED FIXED
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.2   Edit
Assignee: Elson Yuen CLA
QA Contact: Elson Yuen CLA
URL:
Whiteboard: PMC
Keywords:
Depends on:
Blocks: 370832
  Show dependency tree
 
Reported: 2012-02-06 15:40 EST by Jason Duan CLA
Modified: 2012-02-08 14:56 EST (History)
3 users (show)

See Also:
eyuen7: pmc_approved? (david_williams)
eyuen7: pmc_approved? (raghunathan.srinivasan)
eyuen7: pmc_approved? (naci.dai)
eyuen7: pmc_approved? (deboer)
eyuen7: pmc_approved? (neil.hauge)
kaloyan: pmc_approved+
cbridgha: pmc_approved+


Attachments
v1.0 (927 bytes, patch)
2012-02-06 16:16 EST, Jason Duan CLA
eyuen7: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Duan CLA 2012-02-06 15:40:22 EST
Build Identifier: 3.2.maintance

I am looking at the code below in the Server.ResouceChangeJob#run().  It appears to me that a publish will not happen after the structure change if there is no module file changed.  A structure change can be recorded in a .XXX file in the project but it doesn't need to be a part of the module.  I think it should be published.


			// run the visitor
			visit(visitor, null);
			
			if (getServerPublishInfo().hasStructureChanged(modules2)) {
				int newState = getServerPublishState() == IServer.PUBLISH_STATE_FULL ? IServer.PUBLISH_STATE_FULL : IServer.PUBLISH_STATE_INCREMENTAL;
				setServerPublishState(newState);
			}
			
			if (!changed[0])
				return Status.OK_STATUS;
			
			if (getServerState() != IServer.STATE_STOPPED && behaviourDelegate != null)
				behaviourDelegate.handleResourceChange();
			
			if (getServerState() == IServer.STATE_STARTED)
				autoPublish(event);
			
			return Status.OK_STATUS;


Reproducible: Always
Comment 1 Jason Duan CLA 2012-02-06 16:16:53 EST
Created attachment 210620 [details]
v1.0

a potential fix.
Comment 2 Jason Duan CLA 2012-02-06 17:32:38 EST
Without the fix, the tools may fail to do an auto publish when it is needed.  The server in server view is shown as Republish but the auto publish will never happen until a manual click on the publish button or a resource change occurs.  The work-around to this problem is to click on the publish button in the server view to start a publish.  

The fix is to set the change[0] flag to true when a structure change is detected.  This tells the server there is something changed and need to do an auto publish.

The fix has been reviewed and tested.  When a structure change of a module happens, the server should start a publish.  This is how the server should behave.  The change is simple and risk associated with the fix is low.
Comment 3 Jason Duan CLA 2012-02-06 17:47:31 EST
-    Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 

As an adopter, without the fix, my tools may fail to do an auto publish when it is needed. The server in server view is shown as Republish but the auto publish will never happen, which will confuse my users.

-    Is there a work-around? If so, why do you believe the work-around is insufficient? 

Yes. The work-around is to click on the publish button in the server
view to start a publish.  Again, this will make the users wonder why a publish doesn't happen when auto publish is enabled.

-    How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 

The test was done using a debugger with my server adopter. It works as I expected.

-   Give a brief technical overview. Who has reviewed this fix? 

The fix is to set the change[0] flag to true when a structure change is
detected.  This tells the server there is something changed and need to do an
auto publish.  Elson Yuen has reviewed it.

-    What is the risk associated with this fix? 

The change is simple and risk associated with the fix is low.  It is how the server should behave.
Comment 4 Elson Yuen CLA 2012-02-06 17:57:13 EST
Auto-publish is one of the core function on the server tools support. There were a couple of feedback from the adopters before that there are multiple places for disabling auto publish.  Although there is a workaround on this problem, some users may find it confusing and get confused and try to look for ways to enable the auto publish function when they see this error.  Given that the change is very simple (one liner) and fairly low risk, I am marking this for PMC approval.
Comment 5 David Williams CLA 2012-02-06 18:47:16 EST
I am personally fine with this, but won't vote one way or the other, and hopefully some others have stronger opinions. It seems like a the right fix, to an important bug ... but it is very last minute for a bug which is not a regression and for which there is a work around. 

It'd be ideal to hear from some other major "server adapter providers" (oracle? redhat? sap? (libra?) ) to give a voice of support ... though I know time is short, so I am not saying that is required.  

Just my 2 cents. 

I'm fine either way.
Comment 6 Kaloyan Raev CLA 2012-02-08 02:32:30 EST
Our experience is also that the auto-publishing is often unpredictable when will be triggered, which leads to lots of user confusion. Any improvements in this direction are welcome. IMHO, having the low risk, this patch should go in SR2.
Comment 7 Chuck Bridgham CLA 2012-02-08 13:55:58 EST
I think this is a good change - approved
Comment 8 Elson Yuen CLA 2012-02-08 14:29:51 EST
Changes released to 33M and HEAD
Comment 9 Elson Yuen CLA 2012-02-08 14:56:10 EST
Marking this as resolved as the changes has been dropped.