Skip to content

Conversation

@mpeddada1
Copy link
Contributor

@mpeddada1 mpeddada1 commented Apr 20, 2024

Fixes #6523. Locally tested by calling:

$ cd dashboard
$ mvn clean install
$ mvn exec:java -Dexec.args="-f ../google-cloud-bom/pom.xml --report -o target/tmp/output.txt" -B

@mpeddada1 mpeddada1 requested a review from a team as a code owner April 20, 2024 01:38
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Apr 20, 2024
ModelBuilder builder = new DefaultModelBuilderFactory().newInstance();
Model effectiveModel = builder.build(request).getEffectiveModel();
return effectiveModel.getProperties().getProperty("google-cloud-shared-dependencies.version");
} catch (XmlPullParserException | IOException ignored) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we know why these exceptions are ignored, but the ModelBuildingException is thrown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a good question. It is a little unclear as to why the exceptions were ignored. https://effectivejava.googleplex.com/third-edition#page=331 advices against this especially without appropriate comments explaining the reasoning and suggests the following to avoid silent failures:

Merely letting an exception propagate outward can at least cause the
program to fail swiftly, preserving information to aid in debugging the failure.

…dbomdashboard/ArtifactMavenData.java

Co-authored-by: Burke Davison <[email protected]>
@mpeddada1 mpeddada1 merged commit 669782a into main Apr 23, 2024
@mpeddada1 mpeddada1 deleted the shared-dep-check branch April 23, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate shared-dependencies-convergence failure

3 participants