Skip to content

Build cleanup and checkstyle fixes and rules updates#2901

Merged
g2vinay merged 13 commits intoAzure:masterfrom
g2vinay:pom-refactor-cleanup
Feb 6, 2019
Merged

Build cleanup and checkstyle fixes and rules updates#2901
g2vinay merged 13 commits intoAzure:masterfrom
g2vinay:pom-refactor-cleanup

Conversation

@g2vinay
Copy link
Member

@g2vinay g2vinay commented Feb 1, 2019

Deleted pom.client.build.xml
Updated checkstyle rules.
Updated headers.
Added html report export support for spotbugs.

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Member

Choose a reason for hiding this comment

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

In other repos we are starting to try and switch to using a folder called "eng" to hold files specific engineering system tools and such. I'd suggest calling the folder "eng" instead of "buid-tools".

Copy link
Member

Choose a reason for hiding this comment

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

Actually it seems as though this is actually project so I'd suggest you still put it under an "eng" folder like "eng\build-tool" assuming you want to call it that. It would probably be best to name it after what it is trying to do.

Copy link
Member

Choose a reason for hiding this comment

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

My gut feeling is that we should keep this as /build-tools - it's a pretty standard approach in Java to expose build-related tools from the root level. E.g. AWS and GCP. I'm not against having it under a sub-directory, but 1) I wonder what else we might put under there (e.g. in the future presumably we will have a top-level azure-sdk-bom directory, etc, and that wouldn't go under eng) and 2) if 'eng' is really a good, descriptive name for visitors to the repo.

Copy link
Member

Choose a reason for hiding this comment

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

@weshaggard Can you give your thoughts here please? Thanks.

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 have a strong preference here but my goal is to drive consistency across the language repos as much as possible while still allowing for the language conventions where it makes sense. One of my goals is to reduce the clutter in the root of the repo which is why I like having a top level directory that we store anything that is infrastructure/engineering system related into. In general I feel most contributors to the repo generally care more about the source code and less about the engineering system so keeping it scoped mostly in a directory helps eliminate that clutter for a lot of people. For your azure-sdk-bom directory I think that is more of a "source code" type of change, especially if we plan to ship it, so having it in its own directory would make sense. As for the name "eng" we could debate that but it is a convention we have used on my previous teams and it is short name that people who care about what is in there generally learn what it means.

That said I'll leave this call up to you @JonathanGiles if you feel that having the build-tools directory makes more sense in the scope of Java developers please continue with that name, but if you feel this is something that most contributors to the repo won't care about then I'd like to use a common convention and put it under a "eng" sub-dir.

Copy link
Member

Choose a reason for hiding this comment

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

I'd also add that if there going to be multiple of these tools (e.g. spotcheck, checkstyle, etc) then I personally think having them named after what they are checking and under a sub-directory makes the most sense.

Copy link
Member

Choose a reason for hiding this comment

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

I'm ok with using eng. I'm work with Vinay on directory naming

Copy link
Member Author

Choose a reason for hiding this comment

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

Directories are renamed.
build-tools is -> eng/code-quality-reports
eng/spotbugs-reporting -> eng/spotbugs-aggregate-report.

@g2vinay
Copy link
Member Author

g2vinay commented Feb 5, 2019

I thought this wasn't going to be added? I don't think it should be here

Build tools is listed as module in pom.client.xml
Jetty plugin is required to be configured for all modules.
Build-tools cannot inherit from pom.client.xml creates cyclic dependency.
Added clarification in the build tools pom to come back to it later.

@g2vinay g2vinay closed this Feb 5, 2019
@g2vinay g2vinay reopened this Feb 5, 2019
<artifactId>azure-client-sdk-parent</artifactId>
<groupId>com.azure</groupId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.client.xml</relativePath>
Copy link
Member

Choose a reason for hiding this comment

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

This isn't the correct path to the parent pom. One level too low.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated.

<artifactId>azure-keyvault-webkey</artifactId>
<version>${azure-keyvault.version}</version>
</dependency>
</dependencies>
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 need to specify the dependencies AND the source below?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes,
Build helper plugin dymanically imports the source during build time.
Dependencies ensure that code compiles.
If we just invoke spotbugs:spotbugs it doesn't work, because the aggregated code only gets imported at build time.
As discussed, we will explore ways to optimize this or use open source plugins available.

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Member

Choose a reason for hiding this comment

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

@weshaggard Can you give your thoughts here please? Thanks.

</goals>
<configuration>
<sources>
<source>..\keyvault\data-plane\azure-keyvault\src\main\java</source>
Copy link
Member

Choose a reason for hiding this comment

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

Does this really require that we list all the source directories manually here to run the checks?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, spotbugs doesn't offer aggregated reports. This way requires manually specifying sources.

Copy link
Member Author

Choose a reason for hiding this comment

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

This aggregates all the spotbugs in one report.

Copy link
Member

Choose a reason for hiding this comment

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

That is going to be a pain to maintain. We should be on the look out for potential ways to configure or generate this list so we don't have to add each project individually.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, agreed,
In next PR we will optimise this or explore other ways to accomplish this by utilizing open source plugins.

Copy link
Member

@weshaggard weshaggard left a comment

Choose a reason for hiding this comment

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

Looks good. Please squash the commits on merge.

@g2vinay g2vinay merged commit 09356df into Azure:master Feb 6, 2019
@JonathanGiles JonathanGiles added the Client This issue points to a problem in the data-plane of the library. label Feb 13, 2019
@g2vinay g2vinay deleted the pom-refactor-cleanup branch July 13, 2023 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Client This issue points to a problem in the data-plane of the library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments