Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Release with new features and bugfixes:

* https://github.com/devonfw/IDEasy/issues/1754[#1754]: Add version support to vscode plugins
* https://github.com/devonfw/IDEasy/issues/796[#796]: cannot install aws on Mac
* https://github.com/devonfw/IDEasy/issues/865[#865]: az not working on Mac
* https://github.com/devonfw/IDEasy/issues/1800[#1800]: IDEasy will automatically switch to IntelliJ standard edition when installing newer ultimate edition versions
* https://github.com/devonfw/IDEasy/issues/1552[#1552]: User-defined MAVEN_ARGS appends and no longer overwrites IDEasy's defaults
* https://github.com/devonfw/IDEasy/issues/1833[#1833]: No settings repo update with missing `.commit.id`
Expand Down
6 changes: 6 additions & 0 deletions cli/src/main/java/com/devonfw/tools/ide/tool/az/Azure.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.devonfw.tools.ide.tool.LocalToolCommandlet;
import com.devonfw.tools.ide.tool.ToolCommandlet;
import com.devonfw.tools.ide.tool.ToolInstallation;
import com.devonfw.tools.ide.tool.python.Python;

/**
* {@link ToolCommandlet} for azure CLI (azure).
Expand Down Expand Up @@ -52,5 +53,10 @@ public void setEnvironment(EnvironmentContext environmentContext, ToolInstallati

super.setEnvironment(environmentContext, toolInstallation, additionalInstallation);
environmentContext.withEnvVar("AZURE_CONFIG_DIR", this.context.getConfPath().resolve(".azure").toString());
if (this.context.getSystemInfo().isMac()) {
Python python = this.context.getCommandletManager().getCommandlet(Python.class);
Path pythonBin = python.getToolBinPath().resolve("python3");
environmentContext.withEnvVar("AZ_PYTHON", pythonBin.toString());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.devonfw.tools.ide.url.tool.az;

import com.devonfw.tools.ide.os.OperatingSystem;
import com.devonfw.tools.ide.os.SystemArchitecture;
import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater;
import com.devonfw.tools.ide.version.VersionIdentifier;
Expand All @@ -12,6 +13,8 @@ public class AzureUrlUpdater extends GithubUrlTagUpdater {

private static final VersionIdentifier MIN_AZURE_VID = VersionIdentifier.of("2.17.0");

private static final VersionIdentifier MIN_AZURE_MAC_VID = VersionIdentifier.of("2.84.0");

@Override
public String getTool() {

Expand All @@ -23,6 +26,13 @@ protected void addVersion(UrlVersion urlVersion) {

doAddVersion(urlVersion, getDownloadBaseUrl() + "/msi/azure-cli-${version}.msi",
OperatingSystem.WINDOWS);
VersionIdentifier vid = urlVersion.getVersionIdentifier();
if (vid.compareVersion(MIN_AZURE_MAC_VID).isGreater()) {
String macBaseUrl = GITHUB_BASE_URL + "/" + getGithubRepositoryPath()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

interesting: So here we actually have two different downloadBaseUrls.
That is new and we wont mock this then.
In JUnit we change getDownloadBaseUrl() to point to mockito.
Isn't AzureUrlUpdaterTest now dependent on the Internet with your change included?
So does that test then fail if you unplug the network and get offline?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I see this correctly, they changed their strategy and starting with 2.86.0 they publish releases via GitHub:
https://github.com/Azure/azure-cli/releases/tag/azure-cli-2.86.0
If that is correct, we might want to create a new UrlUpdater for azure based on GitHub releases.
We should discuss if we first merge this and let it run or if we add the outcome manually via PR to ide-urls and then simply replace the existing AzureUrlUpdater for the new implementation strategy...

+ "/releases/download/azure-cli-${version}/azure-cli-${version}-macos-";
doAddVersion(urlVersion, macBaseUrl + "x86_64.tar.gz", OperatingSystem.MAC, SystemArchitecture.X64);
doAddVersion(urlVersion, macBaseUrl + "arm64.tar.gz", OperatingSystem.MAC, SystemArchitecture.ARM64);
}
}

@Override
Expand Down
Loading