SolutionGuidance / psm

Welcome to the Medicare/Medicaid Provider Enrollment Screening Portal
http://projectpsm.org/
Other
26 stars 20 forks source link

Improve front-end development feedback cycle #767

Open jasonaowen opened 6 years ago

jasonaowen commented 6 years ago

Currently, when a developer makes a change to a JSP file, a handlebars template, or to a JavaScript file, they must build and deploy to see the changes. This takes at least multiple seconds, and sometimes a minute or more, which is a long time between making a change and seeing the result.

Investigate improvements to this feedback cycle. Is there a way to tell WildFly to look for static assets at a certain location on disk, outside of the deployment? Is there a way to tell WildFly to dynamically recompile JSPs if they change, without a full redeployment?

If we find such a way, document it, and (most likely) add it to our build scripts. This should be an additional build, or a build-time option, so as to preserve the release-like build we are currently working with.

HemKal commented 6 years ago

For this the project import using eclipse or intellij needs some hooks to realize the project structure so that the IDE's can work with. So that hot code replacement can work with server runtime in the IDE.

For that to happen the build.gradle needs respective plugins under allprojects section eg; apply plugin: 'eclipse-wtp' apply plugin: 'idea'

This will only be used by respective IDE while importing, does not affect the overall build.

HemKal commented 5 years ago

PSM as a multi-project comprise of several modules. EAR project is a module which should be a wrapper or shell to host the ejb, utility and web modules. However it is treated as a fully realized java/groovy module as groovy plugin is applied to this project. We need to remove that requirement on this project so that IDE's can better understand , secondly that is the best practice.

Removing the groovy plugin for cms-portal-services module is the key to integration with IDE for hot deploy and get development feedback

Secondly, add eclipse-wtp plugin to projects that needs IDE integration. Similarly for intellij add idea plugin.

I have made the necessary changes , however removal of groovy plugin on cms-portal-services is something that @jasonaowen or team needs to provide input on.

Another pertinent issue is JBPM/Drools module. There is a known bug when jar is exploded (which is what eclipse does to achieve hot deploy by copying modified resources accordingly) the class definitions are not matched/linked. This can be safely ignored during the development in IDE unless you are touching this cms-business-process . Details are provided below as links to KB

KB Solution (image attached) https://access.redhat.com/solutions/2175191 image

Bug Report: https://bugzilla.redhat.com/show_bug.cgi?id=1310981

jasonaowen commented 5 years ago

removal of groovy plugin on cms-portal-services is something that @jasonaowen or team needs to provide input on

@HemKal that sounds reasonable to me; there are no unit tests in the cms-portal-services subproject, and since there is also no code in it, I don't foresee us ever needing unit tests. Not applying the groovy plugin to that subproject sounds like the right choice.

There is a known bug when jar is exploded (which is what eclipse does to achieve hot deploy by copying modified resources accordingly) the class definitions are not matched/linked.

When documenting hot deployments, we should mention this restriction, and in particular we should mention this relevant bit from the linked KB article:

In a case preserving but case-insensitive system (for example, Mac or Windows)

frankduncan commented 5 years ago

A branch (767-improve-de-cycle-using-hot-deploy) was created, and a PR that was never merged, but closed until someone can look at again (#996), are here as artifacts of the effort made.