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

chore: exclude grpc-android from bom validation #6189

Merged
merged 5 commits into from
Sep 19, 2023
Merged
Changes from 2 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 @@ -77,6 +77,26 @@ private static String calculateDependencyManagementSection(Bom bom) {
String version = coordinatesElements[2];

StringBuilder builder = new StringBuilder();
if (artifactId.equals("grpc-bom")) {
builder.append(" <dependencyManagement>\n");
builder.append(" <dependencies>\n");
builder.append(" <dependency>\n");
builder.append(" <groupId>").append(groupId).append("</groupId>\n");
builder.append(" <artifactId>").append(artifactId).append("</artifactId>\n");
builder.append(" <version>").append(version).append("</version>\n");
builder.append(" <type>pom</type>\n");
builder.append(" <scope>import</scope>\n");
builder.append(" <exclusions>\n");
Copy link
Member

Choose a reason for hiding this comment

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

I don't think dependencyManagement's "import" type can take exclusion.

If it works, can you add your observation when you run this with the latest grpc-bom?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. The exclusion compiles but it doesn't work for a dependencyManagement import. Tried replicating the GA job's behavior locally and observed that it creates a tmp/validation-bom/pom.xml which includes the following dependencies:

Screenshot 2023-09-19 at 11 16 47 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verified that with changes in f965cf7, the tmp/validation-bom/pom.xml doesn't contain grpc-android`
Screenshot 2023-09-19 at 11 21 29 AM

builder.append(" <exclusion>\n");
builder.append(" <groupId>io.grpc</groupId>\n");
builder.append(" <artifactId>grpc-android</artifactId>\n");
builder.append(" <exclusion>\n");
builder.append(" <exclusions>\n");
builder.append(" </dependency>\n");
builder.append(" </dependencies>\n");
builder.append(" </dependencyManagement>\n");
return builder.toString();
}
builder.append(" <dependencyManagement>\n");
builder.append(" <dependencies>\n");
builder.append(" <dependency>\n");
Expand Down