Skip to content

Azure Core VNext and ClientCore updates#7115

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

Open
wants to merge 9 commits into
base:main
Choose a base branch
from

Conversation

srnagar
Copy link
Member

No description provided.

@microsoft-github-policy-servicemicrosoft-github-policy-servicebot added the emitter:client:java Issue for the Java client emitter: @typespec/http-client-java label Apr 24, 2025
@github-actionsGitHub Actions
Copy link
Contributor

No changes needing a change description found.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Apr 24, 2025

@@ -413,6 +414,44 @@ private void addPagingNextOperation(Client client, OperationGroup operationGroup
nextOperation.setSummary(operation.getSummary());
nextOperation.setUid(operation.getUid());

if (operation.getConvenienceApi() != null && operation.getConvenienceApi().getRequests() != null) {
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 major design change on nextLink call in v2?

Comment on lines +100 to +102
if (JavaSettings.getInstance().isBranded()) {
builder.convenienceMethods(convenienceMethods);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this is turned off in both unbranded and v2?

nit, if need to turn off, the condition better to include the final List<ConvenienceMethod> convenienceMethods code as well.

Also, the convenience method is used to handle the method signature override in TypeSpec, example here https://github.com/microsoft/typespec/blob/main/packages/http-client-java/generator/http-client-generator-test/tsp/method-override.tsp
Unsure whether this would be affected.

Comment on lines +25 to +26
private static final ObjectMapper OBJECT_MAPPER
= new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, a bit weird that we are still using Jackson in our code.

@@ -121,6 +135,7 @@ public ConfidentialResourceInner withLocation(String location) {
/**
* {@inheritDoc}
*/
@Generated
Copy link
Contributor

Choose a reason for hiding this comment

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

The @Generated annotation is written in mgmt SDK, but it is not consistent. E.g. validate, toJson and fromJson does not have it.

Can we keep it not generated, till we can make them consistent?

BinaryData request = BinaryData.fromObject(node);

client.putWithResponse(request, null);
client.putWithResponse(model.map, null);
Copy link
Contributor

Choose a reason for hiding this comment

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

Many of the changes in clientcore Tests files about request body seems to be bug from codegen (or major changes in design of the client method?)?

Comment on lines +78 to +80
private final Map<CacheKey, List<ClientMethod>> parsed = new ConcurrentHashMap<>();

private static class CacheKey {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to duplicate these.

Also, this file seems pretty big, and potentially have lots of duplication with ClientMethodMapper. @anuchandy

import java.util.function.Function;
import java.util.stream.Collectors;

public class ClientCoreClientMethodTemplate extends ClientMethodTemplate {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is also a big file, and potentially have duplication.

Can we at least flag what we've changed in this subclass, and then at least have a clue about what to refactor when later trying to reduce the duplications?

Copy link
Contributor

@weidongxu-microsoftweidongxu-microsoft left a comment

Choose a reason for hiding this comment

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

Unblock.

There are a few things I have concern

  1. clientcore tests are disabled. It seems either the codegen or annotation processor have major problem (otherwise I'd expect just disabling a few test cases)
    • There be 1.0.0 compiler release at about May 4, we would likely need to release a working unbranded emitter on this version
    • We can merge this, and keep release unbranded emitter from feature branch on clientcore beta.5 for a few releases. But we'd expect the new clientcore work before long, as such release from branch would have large Eng cost (and likely would eventually fail when it diffs too much from main)
  2. Code around ClientMethod(Mapper/Template) have potentially large duplications. I'd hope we know what's the diff between the baseclass and subclass, so that is be possible to reduce the duplication in future.
  3. Turn of convenienceAPI would be a concern Azure Core VNext and ClientCore updates #7115 (comment)
  4. We want to avoid generating @Generated in mgmt Azure Core VNext and ClientCore updates #7115 (comment) (for now)
@@ -266,6 +269,7 @@ words:
- xiangyan
- xiaofei
- xlarge
- Xlint
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 anything about Xlint?

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:javaIssue for the Java client emitter: @typespec/http-client-java
3 participants
@srnagar@azure-sdk@weidongxu-microsoft
close