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

Log error when project cannot be created #36057

Merged
merged 1 commit into from
Oct 10, 2023
Merged
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 @@ -27,6 +27,8 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import org.jboss.logging.Logger;

import io.dekorate.kubernetes.config.Annotation;
import io.dekorate.kubernetes.config.ConfigMapVolumeBuilder;
import io.dekorate.kubernetes.config.EnvBuilder;
Expand Down Expand Up @@ -106,6 +108,7 @@
import io.quarkus.kubernetes.spi.Subject;

public class KubernetesCommonHelper {
private static final Logger LOG = Logger.getLogger(KubernetesCommonHelper.class);
private static final String ANY = null;
private static final String OUTPUT_ARTIFACT_FORMAT = "%s%s.jar";
private static final String[] PROMETHEUS_ANNOTATION_TARGETS = { "Service",
Expand All @@ -125,9 +128,10 @@ public static Optional<Project> createProject(ApplicationInfoBuildItem app,
public static Optional<Project> createProject(ApplicationInfoBuildItem app,
Optional<CustomProjectRootBuildItem> customProjectRoot, Path artifactPath) {
//Let dekorate create a Project instance and then override with what is found in ApplicationInfoBuildItem.
final var name = app.getName();
try {
Project project = FileProjectFactory.create(artifactPath.toFile());
BuildInfo buildInfo = new BuildInfo(app.getName(), app.getVersion(),
BuildInfo buildInfo = new BuildInfo(name, app.getVersion(),
"jar", project.getBuildInfo().getBuildTool(),
project.getBuildInfo().getBuildToolVersion(),
artifactPath.toAbsolutePath(),
Expand All @@ -139,6 +143,7 @@ public static Optional<Project> createProject(ApplicationInfoBuildItem app,
buildInfo, project.getScmInfo()));

} catch (Exception e) {
LOG.debugv(e, "Couldn't create project for {0} application", name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be debug or does it have value for the user?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I debated using info level… the problem is that the exception you usually get is not really actionable as-is since you get exceptions like the one seen in #36041. Maybe if dekorate was returning more informative exceptions, it would make more sense to use an info level here.

return Optional.empty();
}
}
Expand Down