-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14692 from stuartwdouglas/fix-config-on-error
Add mini config editor to error page
- Loading branch information
Showing
24 changed files
with
507 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
core/devmode-spi/src/main/java/io/quarkus/dev/config/ConfigurationProblem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.quarkus.dev.config; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* Interface that can be implemented by exceptions to allow for config issues to be easily fixed in dev mode. | ||
* | ||
*/ | ||
public interface ConfigurationProblem { | ||
|
||
Set<String> getConfigKeys(); | ||
|
||
} |
59 changes: 59 additions & 0 deletions
59
core/devmode-spi/src/main/java/io/quarkus/dev/config/CurrentConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package io.quarkus.dev.config; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.function.Consumer; | ||
|
||
public class CurrentConfig implements Comparable<CurrentConfig> { | ||
|
||
public static volatile List<CurrentConfig> CURRENT = Collections.emptyList(); | ||
public static volatile Consumer<Map<String, String>> EDITOR; | ||
|
||
private final String propertyName; | ||
private final String description; | ||
private final String defaultValue; | ||
private final String currentValue; | ||
private final String appPropertiesValue; | ||
|
||
public CurrentConfig(String propertyName, String description, String defaultValue, String currentValue, | ||
String appPropertiesValue) { | ||
this.propertyName = propertyName; | ||
this.description = description; | ||
this.defaultValue = defaultValue; | ||
this.currentValue = currentValue; | ||
this.appPropertiesValue = appPropertiesValue; | ||
} | ||
|
||
public String getPropertyName() { | ||
return propertyName; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public String getDefaultValue() { | ||
return defaultValue; | ||
} | ||
|
||
public String getCurrentValue() { | ||
return currentValue; | ||
} | ||
|
||
public String getAppPropertiesValue() { | ||
return appPropertiesValue; | ||
} | ||
|
||
@Override | ||
public int compareTo(CurrentConfig o) { | ||
if (appPropertiesValue == null && o.appPropertiesValue != null) { | ||
return 1; | ||
} | ||
if (appPropertiesValue != null && o.appPropertiesValue == null) { | ||
return -1; | ||
} | ||
|
||
return propertyName.compareTo(o.propertyName); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
core/devmode-spi/src/main/java/io/quarkus/dev/spi/DeploymentFailedStartHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.quarkus.dev.spi; | ||
|
||
public interface DeploymentFailedStartHandler { | ||
|
||
/** | ||
* This method is called if the app fails to start the first time. This allows for hot deployment | ||
* providers to still start, and provide a way for the user to recover their app | ||
*/ | ||
void handleFailedInitialStart(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.