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

Add Java analyzer #4422

Closed
wants to merge 56 commits into from
Closed

Add Java analyzer #4422

wants to merge 56 commits into from

Conversation

saragluna
Copy link
Member

Add the extensible Java analyzer for azd, to further understand a Java project.

rujche and others added 30 commits September 6, 2024 13:55
Support adding MySQL when run `azd init`
Fix typo by changing "DbMysql" to "DbMySql"
…or like this: "argetTypeNotSupported: Target resource type MICROSOFT.DBFORMYSQL/FLEXIBLESERVERS is not supported.".
2. Delete '1>&2' used for debug.
3. Add 'az tag create' to fix the problem about tag been deleted when creating service connector.
Use managed-identity instead of username and password
2. Update log about "failed to read spring application properties".
3. Fix bug about can not find frontend app and backend app at the same time.
4. Add service connector from aca to postgresql.
Use passwordless to connect to PostgreSQL in Azure Container Apps
Copy link
Contributor

@weikanglim weikanglim left a comment

Choose a reason for hiding this comment

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

Thanks for doing this.

Leaving some small notes. I've made it to Maven projects and the existing services we support.

I'll discuss with you on Teams on how we can start splitting out the PR to land some changes.

}
defer xmlFile.Close()

bytes, err := ioutil.ReadAll(xmlFile)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the linter may catch this: ioutil.ReadAll is deprecated, we now use os.ReadFile. Once we do this, we can avoid os.Open and file.Close() entirely.

}

func analyzeMavenProject(projectPath string) ([]mavenProject, error) {
rootProject, _ := analyze(projectPath + "/pom.xml")
Copy link
Contributor

Choose a reason for hiding this comment

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

Use filepath.Join so that os.Separator is used -- / on linux and \ on Windows.

Copy link
Contributor

Choose a reason for hiding this comment

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

Applies elsewhere as well.

// if it has submodules
if len(rootProject.Modules) > 0 {
for _, m := range rootProject.Modules {
subModule, _ := analyze(projectPath + "/" + m + "/pom.xml")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do check and return err if there was an error reading the file.

Comment on lines +12 to +13
rules := []rule{
&ruleService{},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can replace these rules with switch statements like Python, and I feel comfortable moving all the logic here into java.go.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure

@@ -123,6 +136,7 @@ resource app 'Microsoft.App/containerApps@2023-05-02-preview' = {
allowedOrigins: union(allowedOrigins, [
// define additional allowed origins here
])
allowedMethods: ['GET', 'PUT', 'POST', 'DELETE']
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this giving you trouble? I was under the impression that the default value is allowedMethods: [*], but if not, we can make that explicit. I'd prefer allowedMethods: [*] over what we have currently.

rujche and others added 17 commits October 11, 2024 23:33
Support both password and passwordless auth type for PostgreSQL and MySQL
Support monolithic web application with Database access - MongoDB - Password
Fix bug: Get auth type should only be required for MySQL and PostgreSQL
…erver.port" is set in application.properties.
Make sure app work well after deployed to ACA no matter what value "server.port" is set in application.properties
Implement feature: detect port in Dockerfile
Implement feature: detect redis by analyzing pom file
…ve just like spring-boot-starter-data-mongodb
Detect Mongo DB by dependency spring-boot-starter-data-mongodb-reactive just like spring-boot-starter-data-mongodb
Support all kinds of properties file like application(-profile).yaml(or yaml, properties)
@azure-sdk
Copy link
Collaborator

VSCode Extension Installation Instructions

  1. Download the extension at https://azuresdkreleasepreview.blob.core.windows.net/azd/vscode/pr/4422/azure-dev-0.9.0-alpha.1.vsix
  2. Extract the extension from the compressed file
  3. In vscode
    a. Open "Extensions" (Ctrl+Shift+X)
    b. Click the ...\ menu at top of Extensions sidebar
    c. Click "Install from VSIX"
    d. Select location of downloaded file

@saragluna saragluna mentioned this pull request Oct 22, 2024
@saragluna
Copy link
Member Author

Superseded by #4473

@saragluna saragluna closed this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants