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 azd intellij plugin into azure-toolkit-for-intellij #9712

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

haoozhang
Copy link

@haoozhang haoozhang commented Jan 15, 2025

What does this implement/fix? Explain your changes.

This PR is to add azd intellij plugin into azure-toolkit-for-intellij.

  1. Call locally installed azd cli when clicking azd intellij plugin.
  2. Check if azd installed and prompt user to install.
  3. Enable azd init for pom.xml, and azd up for azure.yaml.
  4. Small fix for azure-toolkit-ide-hdinsight-libs.

azd is an open-source tool that accelerates provisioning and deploying app resources on Azure, see here for more details.

Does this close any currently open issues?

No

Any relevant logs, screenshots, error output, etc.?

image

image

image

Any other comments?

No

Has this been tested?

  • Tested

public void update(@NotNull AnActionEvent event) {
VirtualFile file = event.getData(CommonDataKeys.VIRTUAL_FILE);
// Only enable the action for specific files
boolean enabled = file != null && getSupportedFiles().contains(file.getName());
Copy link
Author

Choose a reason for hiding this comment

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

We enable the azd related actions for only specific file patterns (such as pom.xml, azure.yaml). For other files or directories, the user should not see azd actions when clicking azure.

Messages.getQuestionIcon()
);
if (result == Messages.YES) {
if (!AzdCliUtils.installAzdCli(project)) {
Copy link
Author

@haoozhang haoozhang Jan 16, 2025

Choose a reason for hiding this comment

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

Install successfully first, then run azd commands in the terminal.

private static AzdVersion cachedAzdVersion = null;

@Nullable
public static AzdVersion getAzdVersion() {
Copy link
Author

Choose a reason for hiding this comment

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

This method is currently used to check if azd cli is installed locally.

return null;
}

public static class AzdVersion {
Copy link
Author

Choose a reason for hiding this comment

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

Introduce this model because of the output of the command azd version --output json.

image

commandLine.withExePath("powershell")
.withParameters("-ex", "AllSigned")
.withParameters("-c", "Invoke-RestMethod 'https://aka.ms/install-azd.ps1' | Invoke-Expression");
} else if (SystemInfo.isLinux || SystemInfo.isMac) {
Copy link
Author

Choose a reason for hiding this comment

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

Same command for Linux and Mac platforms.

@@ -165,6 +165,11 @@ public RedisAccessKeys regenerateKey(RedisKeyType keyType) {
return new RedisAccessKeysMock();
}

@Override
Copy link
Author

Choose a reason for hiding this comment

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

Fix the error when mvn clean install -f Utils/pom.xml in the CONTRIBUTING.md.

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.

1 participant