-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
The infamous DEV mode #589
Comments
Something like this could be done in the main config: %dev.shamrock.mode = DEV
%test.shamrock.mode = TEST
shamrock.mode = PROD after the main config refactor; WDYT? |
I don't think this should be config driven, we know if it is TEST mode because it was launched from the JUnit extension, and similarly we will know if it is dev mode if it is launched from shamrock:dev |
Typically in Play it was config based, but I think it's fine to set the mode from an entry point, like unit tests or shamrock:dev. You still need to make it config driven because you may have several profiles that use the DEV mode and several that set it to PROD. |
Maybe the test runner could provide an overlay config source which contains the mode. |
We now have a LaunchMode enum: https://github.com/jbossas/protean-shamrock/blob/068143cc436e138c6425c528d9a1471d704e7fd3/core/runtime/src/main/java/org/jboss/shamrock/runtime/LaunchMode.java#L3 This can be accessed in BuildStep methods and templates. What else is needed here? I guess some kind of config integration is the main thing that is still outstanding? |
Yeah but we can worry about config integration after we get the static init config stuff sorted out. |
@FroMage I think this is complete? |
|
Is it complete now? |
Well, my questions remain unanswered. AFAICT the "writing an extension guide" only mentions it by accident at https://quarkus.io/guides/extension-authors-guide#conditional-step-inclusion and doesn't explain it. At a minimum we need to document it. |
We're still missing a
Mode
enum that has three values:PROD
,DEV
andTEST
.That mode should be obtainable (injectable) by extensions as well as user code. It can be set by configuration files. It should default to
DEV
, or possiblyTEST
when run from Shamrock test runners.Certain behaviour defaults change depending on that mode:
DEV
lists dev info, such as what you can do, and the list of registered URLs, possibly more deployment info. In prod it would probably be a 404.DEV
mode shows stack trace and perhaps even code snippets. InPROD
it should just inform the user it had an error and give (and log) that error ID (generated unique ID that users can then pass on to support, who can grep for it in the logs which have the stack trace).So far I've only used
TEST
mode to load test data fixtures specific to tests, to avoid botching myDEV
DB, but perhaps there are other use-cases for it.The text was updated successfully, but these errors were encountered: