Skip to content
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

#5328 - Stop enabling all CAS doctor checks on beta and SNAPSHOT versions #5329

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

import de.tudarmstadt.ukp.clarin.webanno.diag.config.CasDoctorProperties;
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument;
import de.tudarmstadt.ukp.inception.support.SettingsUtil;
import de.tudarmstadt.ukp.inception.support.logging.LogMessage;

public class CasDoctor
Expand All @@ -50,7 +49,7 @@ public class CasDoctor
private Set<String> activeRepairs;

private boolean fatalChecks = true;
private boolean disableAutoScan = false;
// private boolean disableAutoScan = false;

public CasDoctor(CasDoctorProperties aProperties, ChecksRegistry aChecksRegistry,
RepairsRegistry aRepairsRegistry)
Expand All @@ -59,7 +58,7 @@ public CasDoctor(CasDoctorProperties aProperties, ChecksRegistry aChecksRegistry
repairsRegistry = aRepairsRegistry;

fatalChecks = aProperties.isFatal();
disableAutoScan = aProperties.isForceReleaseBehavior();
// disableAutoScan = aProperties.isForceReleaseBehavior();

activeChecks = new LinkedHashSet<>();
if (isNotEmpty(aProperties.getChecks())) {
Expand All @@ -78,7 +77,7 @@ public CasDoctor(ChecksRegistry aChecksRegistry, RepairsRegistry aRepairsRegistr
repairsRegistry = aRepairsRegistry;

fatalChecks = false;
disableAutoScan = true;
// disableAutoScan = true;

activeChecks = new LinkedHashSet<>();
activeRepairs = new LinkedHashSet<>();
Expand Down Expand Up @@ -216,18 +215,18 @@ public void setActiveRepairs(String... aActiveRepairs)
public void onApplicationStartedEvent(ApplicationStartedEvent aEvent)
{
// When under development, automatically enable all checks.
var version = SettingsUtil.getVersionProperties().getProperty(SettingsUtil.PROP_VERSION);
if ("unknown".equals(version) || version.contains("-SNAPSHOT")
|| version.contains("-beta-")) {
if (disableAutoScan) {
LOG.info("Detected SNAPSHOT/beta version - but FORCING release mode and NOT "
+ "auto-enabling checks");
}
else {
checksRegistry.getExtensions().forEach(check -> activeChecks.add(check.getId()));
LOG.info("Detected SNAPSHOT/beta version - automatically enabling all checks");
}
}
// var version = SettingsUtil.getVersionProperties().getProperty(SettingsUtil.PROP_VERSION);
// if ("unknown".equals(version) || version.contains("-SNAPSHOT")
// || version.contains("-beta-")) {
// if (disableAutoScan) {
// LOG.info("Detected SNAPSHOT/beta version - but FORCING release mode and NOT "
// + "auto-enabling checks");
// }
// else {
// checksRegistry.getExtensions().forEach(check -> activeChecks.add(check.getId()));
// LOG.info("Detected SNAPSHOT/beta version - automatically enabling all checks");
// }
// }

for (var checkId : activeChecks) {
LOG.info("Check activated: " + checkId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ public interface CasDoctorProperties

boolean isFatal();

boolean isForceReleaseBehavior();
// boolean isForceReleaseBehavior();
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class CasDoctorPropertiesImpl
private List<String> checks = Collections.emptyList();
private List<String> repairs = Collections.emptyList();
private boolean fatal = true;
private boolean forceReleaseBehavior = false;
// private boolean forceReleaseBehavior = false;

@Override
public List<String> getChecks()
Expand Down Expand Up @@ -64,14 +64,14 @@ public void setFatal(boolean aFatal)
fatal = aFatal;
}

@Override
public boolean isForceReleaseBehavior()
{
return forceReleaseBehavior;
}

public void setForceReleaseBehavior(boolean aForceReleaseBehavior)
{
forceReleaseBehavior = aForceReleaseBehavior;
}
// @Override
// public boolean isForceReleaseBehavior()
// {
// return forceReleaseBehavior;
// }
//
// public void setForceReleaseBehavior(boolean aForceReleaseBehavior)
// {
// forceReleaseBehavior = aForceReleaseBehavior;
// }
}
Loading