Closed wangmingliang-ms closed 1 year ago
@v-xuto - Can you please run a test pass on all java templates? Thanks!
I will generate the templates now...
/azp run azure-dev - repoman
Started running template tests validation: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=1980514&view=results
FYI @jongio
@jdubois Could use you or your team's insights on what might be idiomatic Java or otherwise based on your experiences. Otherwise, code changes looks fine pending validation.
@brunoborges you are right, Lombok is removed.
@brunoborges you are right, Lombok is removed.
Awesome, thank you.
What is the Java version set for the source code and the version of the JDK used in the images? Is it 17?
What is the Java version set for the source code and the version of the JDK used in the images? Is it 17?
yes, it's 17 (in both pom.xml
and api-appservice-java.bicep
). I didn't modify it.
@v-xuto - Can you please run a test pass on all java templates? Thanks!
I will generate the templates now...
@jongio We have tested the java templates (todo-java-mongo
and todo-java-mongo-aca
) only in Windows Desktop
, both of them test results are PASS.
Can you make sure they also work fine on Linux? You may use WSL
Can you make sure they also work fine on Linux? You may use WSL
We have tested the java templates in WSL
, the results are PASS.
/azp run azure-dev - repoman
Re-running repoman after latest repoman CI changes
/azp run azure-dev - repoman
Repoman pushed changes to remotes for the following projects:
You can initialize this project with:
azd init -t Azure-Samples/todo-csharp-cosmos-sql -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-csharp-sql-swa-func -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-csharp-sql -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-java-mongo-aca -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-java-mongo -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-nodejs-mongo-aca -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-nodejs-mongo-swa-func -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-nodejs-mongo -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-nodejs-mongo-terraform -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-python-mongo-aca -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-python-mongo-swa-func -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-python-mongo -b pr/1122
View Changes | Compare Changes
You can initialize this project with:
azd init -t Azure-Samples/todo-python-mongo-terraform -b pr/1122
View Changes | Compare Changes
@weikanglim @jongio is there anything I should fix?
@wangmingliang-ms No, the test failures are unrelated to your changes. We were in the middle of a release. Overall, the changes look good to me, and I'll merge it at the next appropriate window.
@wangmingliang-ms Can you verify what additional changes we might need so that running
./mvnw -P openapigen compile
doesn't result in a huge diff in the java files?
The huge diff you mentioned should be mainly caused by 2 reasons:
useTags=true
when generating code, resulting in only one ListsApi
generated, instead of the separate ItemsApi
and ListsApi
we expected, I submitted another commit to fix this problem see https://github.com/Azure/azure-dev/pull/1122/commits/7647439d111f5aa960ffbac5350bc749f87befa0.The code style issue can be solved by some maven plugins e.g. io.spring.javaformat:spring-javaformat-maven-plugin
. see commit https://github.com/Azure/azure-dev/pull/1122/commits/ce21ce43d988f22c73c12e8569e17e1afcab01f3
but none of them can organize the imports.
For formatting, please have a look at https://github.com/jhipster/prettier-java (it’s under JHipster, to be transparent). You’ll have perfect formatting and it works with IDEs and CI easily as it’s Prettier.
@wangmingliang-ms The formatting from javaformat-maven
ended up not being very readable:
So I opted for using prettier which has a much better result:
After these changes, I can see the minimal codegen diff of only the intended, modified changes to our model classes, so I think we're in a good spot.
@jdubois @wangmingliang-ms One final thing to check about prettier
, the import order seems to not prefer import sections, and instead always alphabetical:
Which seems like it's a hardcoded and opinionated import format according to their readme. I don't have a concern here as long as we have a consistent format. But do you feel strongly otherwise?
I just wanted to get to a point where the user using the sample could understand the openapigen diff easily, so if they wanted to use the template as a starting point for their application, it would make total sense. I think that's accomplished here but let me know otherwise. Would love to get this merged sooner than later.
I think it's OK, no style can satisfy all users, sections or not does not affect readability actually. What's more, google code style is almost the most popular.
This PR refactored code and fixed some issues (including those in comments of PR https://github.com/Azure/azure-dev/pull/799 and several others) of SimpleTodo templates for Java AppService and Container Apps.