Skip to content

Conversation

@xseeseesee
Copy link
Contributor

No description provided.

<version>1.1.0</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-test</artifactId>
<version>2.0.0-beta.4</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-test;current} -->
Copy link
Member

Choose a reason for hiding this comment

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

I see that there is apache-commons dependency included. This dependency is not allowed. Can this dependency be removed?

@JonathanGiles

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 think this apache-commons is required for spring cloud service(named appplatform here). It could help on compression and upload.

cc: @ChenTanyi

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any compression package can be used?

Copy link
Member

Choose a reason for hiding this comment

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

Yes - we should start with the default position that this dependency is not allowed, and work from there to either find an alternative approach or justify why this is needed, but for me the hurdle for accepting this dependency is very high.

module com.azure.resourcemanager.appplatform {
requires transitive com.azure.resourcemanager.resources;
requires transitive com.azure.storage.file.share;
requires org.apache.commons.compress;
Copy link
Member

Choose a reason for hiding this comment

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

If the apache-commons dependency is removed, this should be removed as well.

Comment on lines +2 to +5
requires transitive com.azure.resourcemanager.keyvault;
requires transitive com.azure.resourcemanager.msi;
requires transitive com.azure.resourcemanager.dns;
requires transitive com.azure.resourcemanager.storage;
Copy link
Member

Choose a reason for hiding this comment

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

Do these have to be transitive? Will the consumers of azure-resourcemanager-appservice module use the types defined in keyvault, msi, dns and storage modules?

Comment on lines +2 to +4
requires transitive com.azure.resourcemanager.msi;
requires transitive com.azure.resourcemanager.storage;
requires transitive com.azure.resourcemanager.network;
Copy link
Member

Choose a reason for hiding this comment

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

same here - do these all have to be transitive?

@@ -0,0 +1,13 @@
module com.azure.resourcemanager.appplatform {
Copy link
Member

Choose a reason for hiding this comment

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

All the module-info.java files are missing license headers.

opens com.azure.resourcemanager.resources.fluent.inner to com.fasterxml.jackson.databind, com.azure.core;
opens com.azure.resourcemanager.resources.models to com.fasterxml.jackson.databind, com.azure.core;

exports com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation
Copy link
Member

Choose a reason for hiding this comment

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

Exporting implementation package is not recommended. If there are some common classes that are shared across multiple modules, then those classes should be in non-implementation package and that package should be exported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean we can rename the package and/or the classes? An example is the GroupableResourceImpl used in VirtualMachineImpl. There are a few {CommonResourceModel}Impl shared from azure-resourcemanager-resources to other azure-resourcemanager-** services.

Copy link
Member

Choose a reason for hiding this comment

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

The intent of the classes inside the 'implementation' packages is that they are never intended for use by end users. In JDK 9+ with modules, we can hide everything under this package and therefore have stronger protections against these being used. If we export them, we're undoing that work. We should have clearly defined barriers between public API and private API - nothing in the public API should expose private API to end users, and so therefore we should never need the user to directly interact with anything in the implementation package. If this is the case today, consider refactoring to get the classes in the correct package and with the correct name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@srnagar @JonathanGiles
Would you think if exports implementation to moduleA, moduleB could be acceptable as the end users cannot get them. Alternatively, we may change namespace from com.azure.resourcemanager.resources.fluentcore.arm.models.implementation to com.azure.resourcemanager.resources.fluentcore.arm.models.internal.

Copy link
Member

Choose a reason for hiding this comment

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

It is best to think of doing 'exports to' as a code smell that should be avoided unless absolutely necessary. It would be preferable to clearly determine firstly if the code is something that should be considered public API or not. That will help to inform how to proceed. It sounds like it should be considered public API to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree what you said about The intent of the classes inside the 'implementation' packages is that they are never intended for use by end users. And this is what export to could help for a qualified export. With that, only the designated modules can get access to the 'implementation' packages while end users cannot. It's kind of making them internal available only inside resource manager modules. This is a little bit different comparing to data plane SDK as for resource management these 'implementation' classes are helping model ARM resource in general manner. We will reuse them for the resources among various RPs.

Copy link
Member

@conniey conniey left a comment

Choose a reason for hiding this comment

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

Can you break this PR into smaller PRs? maybe one for each module? 358 files is a lot to properly review.
PRs are usually targeted towards one feature so people can reason about it.

<!-- Azure-core needs to open the test entities to Jackson for unit tests to operate -->
--add-opens com.azure.core/com.azure.core.implementation.entities=com.fasterxml.jackson.databind
--add-opens com.azure.core/com.azure.core.implementation.entities=ALL-UNNAMED

Copy link
Member

Choose a reason for hiding this comment

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

IIRC, we were trying to push this into the actual child pom.xml than bloat the parent one. @alzimmermsft, is this correct?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we should begin removing library specific configurations from the parent POM. The current configuration results in a lot of warnings from being unable to find modules that exist outside of the project being ran.

@xseeseesee
Copy link
Contributor Author

@conniey The main changes are in the commit of add azure-resourcemanager-test. The rest for each module, it's similar and repeat changes to adopt new test base class.

@conniey
Copy link
Member

conniey commented Aug 25, 2020

@conniey The main changes are in the commit of add azure-resourcemanager-test. The rest for each module, it's similar and repeat changes to adopt new test base class.

Hey. It's easier to reason about changes when they are in smaller pieces, can you create one PR for the addition of the azure-resourcemanager-test and then another for a few modules? Reviewing 300+ effectively is hard and the git UI chokes on it.

@joshfree joshfree added common common module used by all azure SDKs (e.g. client, Mgmt) Mgmt This issue is related to a management-plane library. labels Sep 11, 2020
@xseeseesee
Copy link
Contributor Author

Close this as it got separated into smaller PRs.

@xseeseesee xseeseesee closed this Sep 14, 2020
@xseeseesee xseeseesee deleted the add-resmgr-test branch September 14, 2020 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common common module used by all azure SDKs (e.g. client, Mgmt) Mgmt This issue is related to a management-plane library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants