-
Notifications
You must be signed in to change notification settings - Fork 51
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
Exception handling for generateFeatures #672
Exception handling for generateFeatures #672
Conversation
Signed-off-by: Kathryn Kodama <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to ci.maven, the message To disable the automatic generation of features, start dev mode with --generateFeatures=false.
is separated from the actual error and may give users the wrong impression. Is it possible to put that message next to the error message?
…ment Signed-off-by: Kathryn Kodama <[email protected]>
Updated the error message shown when
Also updated the comments inserted in the |
* Add Generate Features prototype and implement the necessary interfaces. Signed-off-by: Paul Gooderham <[email protected]> * Add the generateFeatures command line and build file option. Signed-off-by: Paul Gooderham <[email protected]> * Add comment to existing server.xml and scan gradle classes dirs. Signed-off-by: Paul Gooderham <[email protected]> * Code cleanup. Signed-off-by: Paul Gooderham <[email protected]> * Make generateFeatures option command line only. Clean up streams code. Signed-off-by: Paul Gooderham <[email protected]> * Allow generateFeatures=false * Add classFile option to GenerateFeaturesTask (#640) Signed-off-by: Kathryn Kodama <[email protected]> * Get binary scanner jar from connected repos * Fix name of API method. Signed-off-by: Paul Gooderham <[email protected]> * Use gradle convention for latest release version * Update message * Change generated file name to generated-features.xml (#644) Signed-off-by: Kathryn Kodama <[email protected]> * Fix NPE and remove getAllServerFeatures * Fix IO error when server is not yet setup. Signed-off-by: Paul Gooderham <[email protected]> * Quick fix Signed-off-by: Paul Gooderham <[email protected]> * Remove binary scanner jar parameter * Handle optimize and non-optimize cases * Add a system where the binary scanner handler detects an error generated by the scanner and calls it again with fewer restrictions in order to generate a list of suggested features that should work. This error and suggested solution is then displayed to the user. * Improved error reporting after code review. Signed-off-by: Paul Gooderham <[email protected]> * After writing server.xml ensure <server> element is on a new line. Signed-off-by: Paul Gooderham <[email protected]> * Move the xml document rewrite code into ci.common. Signed-off-by: Paul Gooderham <[email protected]> * Remove unused import. Signed-off-by: Paul Gooderham <[email protected]> * Use the binary scanner support in ci.common. Signed-off-by: Paul Gooderham <[email protected]> * Remove unused imports and class variable. Signed-off-by: Paul Gooderham <[email protected]> * Allow info messages to appear in output by default and without setting log level to Info. Signed-off-by: Paul Gooderham <[email protected]> * Get existing features for feature gen from the source config dir (#661) * Get existing features for feature gen from the source config dir Signed-off-by: Kathryn Kodama <[email protected]> * Call generate features on dev mode startup and restart Signed-off-by: Kathryn Kodama <[email protected]> * Simplify getServerFeatureUtil method Signed-off-by: Kathryn Kodama <[email protected]> * Update to use latest snapshot from ci.common Signed-off-by: Kathryn Kodama <[email protected]> * Add binary scanner sonatype repo to dev test Signed-off-by: Kathryn Kodama <[email protected]> * Update sonatype repo link in dev tests Signed-off-by: Kathryn Kodama <[email protected]> * Diable feature generation in dev tests Signed-off-by: Kathryn Kodama <[email protected]> * Added optimize parameter for generating features * Added optimize parameter to generateFeatures task * Feature generation, create generated xml file with empty feature list (#664) * When no features left to generate create generated xml file with empty feature list Signed-off-by: Kathryn Kodama <[email protected]> * Improve comment in generated-features.xml Signed-off-by: Kathryn Kodama <[email protected]> * Improve formatting for comments Signed-off-by: Kathryn Kodama <[email protected]> * Allow optimize to be passed in as a String parameter * Use binary scanner Maven coordinates promoted by the scanner team. Signed-off-by: Paul Gooderham <[email protected]> * Fix compileJava call in recompileBuildFile * Put snapshot repo on project level for dev tests Signed-off-by: Kathryn Kodama <[email protected]> * Updated debug statements * Use new method downloadBuildArtifact() to search buildscript portion of build.gradle Signed-off-by: Paul Gooderham <[email protected]> * Exception handling for generateFeatures (#672) * Exception handling for generateFeatures Signed-off-by: Kathryn Kodama <[email protected]> * Updated generateFeatures error message and generated-features.xml comment Signed-off-by: Kathryn Kodama <[email protected]> * Remove unnecessary imports and adjust copyright header Signed-off-by: Kathryn Kodama <[email protected]> * Update dev test project build.gradle Signed-off-by: Kathryn Kodama <[email protected]> * Improve comment for default generateFeatures behaviour Signed-off-by: Kathryn Kodama <[email protected]> * Improve exception handling message when generate features fails (#675) * Improve exception handling message when generate features fails Signed-off-by: Kathryn Kodama <[email protected]> * Add return boolean for libertyGenerateFeatures method Signed-off-by: Kathryn Kodama <[email protected]> * Add missing return statement for createNewInstallFeatureUtil (#678) Signed-off-by: Kathryn Kodama <[email protected]> Co-authored-by: Paul Gooderham <[email protected]> Co-authored-by: Eric Lau <[email protected]> Co-authored-by: Kathryn Kodama <[email protected]>
Handles exception for the
generateFeatures
task.When the task runs standalone and an error occurs, a
GradleException
is thrown and users will see a build failure.When running the goal as part of dev mode:
On startup if
generateFeatures
throws an error dev mode will exit. If there is a feature conflict (most likely reason generate-features will fail) we fail here first to show users a more relevant error message rather than continuing on toinstallFeature
and failing there. Error message indicates that users can disable feature generation with --generateFeatures=falseOnce in the inner dev mode loop errors from
generateFeatures
will not fail dev mode, users will see the following error in their console:Signed-off-by: Kathryn Kodama [email protected]