Skip to content
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
da7a35f
Initial integration
alirana01 Jan 13, 2025
ff8e4dc
Initial first flow with successful installation and loading of env in…
alirana01 Jan 22, 2025
6390929
constants moved to single place and added refresh function
alirana01 Jan 22, 2025
046c6d4
minor cleanup and logging for user
alirana01 Jan 22, 2025
eb705a7
IEP-1334: code cleanup (Active Review) (#1125)
alirana01 Jan 23, 2025
889e8ed
String internalization
alirana01 Jan 23, 2025
99781c9
update to ci file
alirana01 Jan 27, 2025
de6b13d
ci error fixed
alirana01 Jan 27, 2025
a08fde6
ci error fix
alirana01 Jan 27, 2025
bcbbfb1
ci fix
alirana01 Jan 27, 2025
86edcde
fixing ci error
alirana01 Jan 27, 2025
665c1ee
ci error fix
alirana01 Jan 27, 2025
adc8643
ci error fix
alirana01 Jan 27, 2025
71ddc37
ci syntax fix
alirana01 Jan 27, 2025
85442c0
ci syntax indentation fix
alirana01 Jan 27, 2025
6840537
ci syntax fix
alirana01 Jan 27, 2025
a70bd56
ci syntax fix
alirana01 Jan 27, 2025
5b75467
ci fixed
alirana01 Jan 27, 2025
7c5c165
ci fixed2
alirana01 Jan 27, 2025
ff02f73
ci trigger
alirana01 Jan 27, 2025
7c8beb3
workflow trigger fix
alirana01 Jan 27, 2025
018ddb1
cleanup
alirana01 Jan 27, 2025
92f2fef
ci deps isntalled
alirana01 Jan 27, 2025
4fd767f
eim fix
alirana01 Jan 27, 2025
ac0375a
using eim action to install
alirana01 Jan 28, 2025
da08790
using Petr's fork
alirana01 Jan 28, 2025
6b70e93
switched back to official action repo
alirana01 Jan 30, 2025
ad90d61
Revert "switched back to official action repo"
alirana01 Jan 30, 2025
4b63c7b
trying to fix action for eim
alirana01 Jan 30, 2025
325ba81
trying with petrs fork again
alirana01 Jan 30, 2025
1501568
ci fix
alirana01 Jan 30, 2025
53d8f86
back to espressif
alirana01 Jan 30, 2025
895598e
name fixed
alirana01 Jan 30, 2025
41f77b5
updated url for eim
alirana01 Jan 30, 2025
4187122
old config export handling
alirana01 Jan 30, 2025
702c2b1
fixing tests env setup
alirana01 Feb 4, 2025
f45f1ca
logging to verify skip tests
alirana01 Feb 4, 2025
249ada3
fixing POSIX path resolution
alirana01 Feb 4, 2025
56855bf
activation script properly sourced
alirana01 Feb 4, 2025
a97d4fd
added test run variable in test pom directly
alirana01 Feb 4, 2025
9319826
adding cache option for the maven
alirana01 Feb 6, 2025
39fd98a
file name updated
alirana01 Feb 11, 2025
339ff8e
increasing timeout for tests
alirana01 Feb 12, 2025
76f6fcd
test fixes and removing redundant and outdated tests
alirana01 Feb 12, 2025
7231f3c
cleanup and update for user messages
alirana01 Feb 12, 2025
3cc1389
updated to handle activation of single esp-idf from eim
alirana01 Feb 12, 2025
b14efa7
removing unwanted test for fixing failures
alirana01 Feb 14, 2025
1b414e8
increased timeout for tests
alirana01 Feb 26, 2025
7746a8f
ci updated for the release branch trigger as well
alirana01 Feb 26, 2025
e2f7f84
ci error fix
alirana01 Feb 26, 2025
6ce4789
fix for sdkconfig server
alirana01 Feb 26, 2025
22138ed
cleaning up the idf_tools_path configuration in the IDE
alirana01 Mar 17, 2025
36d2ecf
added the option to include homebrew paths on macos
alirana01 Mar 17, 2025
1e3319d
changes for guide link
alirana01 Mar 27, 2025
3d6852c
Guidance link added to NLS
alirana01 Mar 28, 2025
589456c
fix: Launch ESP-IDF Manager view even there is no eim_idf.json file f…
kolipakakondal Apr 4, 2025
3b3640e
fix: Don't launch multiple ESP-IDF Manager editors
kolipakakondal Apr 4, 2025
cec026f
fix: Update the msg and convert it to MessageDialog
kolipakakondal Apr 4, 2025
098051e
fix: notify IDF not found while opening Manager view
kolipakakondal Apr 4, 2025
e7143c1
fix: java.lang.UnsupportedOperationException
kolipakakondal Apr 4, 2025
3a46aa5
fix: File Not found issue and others
kolipakakondal Apr 4, 2025
9754e26
updated code for eim watcher added
alirana01 Apr 23, 2025
4bb57ea
refactored startup classes
alirana01 Apr 23, 2025
5035ae8
initial base level logic for file watcher
alirana01 Apr 23, 2025
a855203
missing copyright added
alirana01 Apr 23, 2025
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
27 changes: 11 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,34 @@ on:
branches: [ master ]

jobs:
build:
build_linux:

runs-on:
- self-hosted
- eclipse
- BrnoUBU0004
runs-on: [self-hosted, eclipse, BrnoUBU0004]
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Custom runner labels need documentation

The custom labels eclipse and BrnoUBU0004 are indeed undocumented. They are only used in ci.yml for a self-hosted runner but their purpose and requirements are not explained anywhere in the repository. The original suggestions remain valid:

  1. Add these labels to .github/actionlint.yaml to validate workflow syntax
  2. Document their purpose in workflow comments to explain:
    • What the eclipse label represents (e.g., required Eclipse development environment)
    • What BrnoUBU0004 represents (specific Ubuntu machine in Brno)
🔗 Analysis chain

Document custom runner labels.

The custom labels eclipse and BrnoUBU0004 should be documented:

  1. Add these labels to .github/actionlint.yaml
  2. Document their purpose in workflow comments
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if labels are documented
echo "Checking for actionlint.yaml..."
fd -g "actionlint.yaml" .github/

echo "Checking for label documentation in workflow..."
grep -B 2 -A 2 "eclipse\|BrnoUBU0004" .github/workflows/ci.yml

Length of output: 352


Script:

#!/bin/bash
# Search for any documentation or usage of these labels
echo "Searching for label documentation in workflow files..."
rg -i "eclipse|BrnoUBU0004" .

echo "Checking for README or documentation files..."
fd -e md . | xargs rg -i "eclipse|BrnoUBU0004"

Length of output: 68250


Script:

#!/bin/bash
# Look for other workflow files and any documentation about runners
echo "Checking for other workflow files..."
fd -e yml -e yaml . .github/workflows/

echo "Checking for any documentation about runners..."
rg -i "runner|self-hosted|BrnoUBU" .github/

Length of output: 1314

🧰 Tools
🪛 actionlint (1.7.4)

15-15: label "eclipse" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


15-15: label "BrnoUBU0004" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2022", "windows-2019", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file

(runner-label)


steps:
- uses: actions/checkout@v2

- name: Clone IDF Release From Github
uses: actions/checkout@v2
with:
repository: espressif/esp-idf
path: dependencies/idf-tools
submodules: 'true'
ref: release/v5.1
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: '3.10'

Comment on lines +22 to +28
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Update actions/setup-python to the latest version.

The current setup uses an outdated version of the action. Update to v4 for the latest security improvements and features:

-    - uses: actions/checkout@v4
+    - uses: actions/checkout@v4
 
     - name: Set up Python
-      uses: actions/setup-python@v2
+      uses: actions/setup-python@v4
       with:
         python-version: '3.10'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: '3.10'
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
🧰 Tools
🪛 actionlint (1.7.4)

21-21: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

- name: Install ESP-IDF via eim
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix YAML syntax error: Remove tab character.

The step name contains a tab character which can cause YAML parsing issues.

-    - name: Install ESP-IDF via eim		
+    - name: Install ESP-IDF via eim
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Install ESP-IDF via eim
- name: Install ESP-IDF via eim
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 25-25: syntax error: found character '\t' that cannot start any token

(syntax)

uses: espressif/install-esp-idf-action@v1
with:
version: 'v5.3'

Comment on lines +29 to 33
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Resolve YAML Syntax Issue and Confirm ESP-IDF Action Security

A tab character is present in the step name for "Install ESP-IDF via eim" (line 25) and should be removed to prevent YAML parsing errors. Additionally, while using espressif/install-esp-idf-action@v1 is acceptable, it is recommended to consider pinning the action to a specific commit hash to reduce potential security risks associated with mutable version tags.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 25-25: syntax error: found character '\t' that cannot start any token

(syntax)

- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Build with Maven
run: export NO_AT_BRIDGE=1 && mvn clean verify -Djarsigner.skip=true spotbugs:spotbugs -DskipTests=false -DtestWorkspace=/opt/actions-runner/_work/workspace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public class IDFEnvironmentVariables

public static final String IDF_CCACHE_ENABLE = "IDF_CCACHE_ENABLE"; //$NON-NLS-1$

public static final String ESP_IDF_EIM_ID = "ESP_IDF_EIM_ID"; //$NON-NLS-1$

/**
* @param variableName Environment variable Name
* @return IEnvironmentVariable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,23 @@ public class Messages extends NLS
public static String ToolsInitializationDifferentPathMessageBoxOptionYes;
public static String ToolsInitializationDifferentPathMessageBoxOptionNo;
public static String IDFToolChainsMissingErrorMsg;

public static String ToolsInitializationEimMissingMsgBoxTitle;
public static String ToolsInitializationEimMissingMsgBoxMessage;

public static String RefreshingProjects_JobName;

public static String NoActiveEspIdfInWorkspaceMsgTitle;
public static String NoActiveEspIdfInWorkspaceMsg;

public static String OldConfigFoundMsgBoxTitle;
public static String OldConfigFoundMsgBoxMsg;
public static String OldConfigExportDirectorSelectionDialogTitle;
public static String OldConfigExportDirectorSelectionDialogInfo;
public static String OldConfigExportCompleteSuccessMsgTitle;
public static String OldConfigExportCompleteSuccessMsg;
public static String OldConfigExportCompleteFailMsgTitle;
public static String OldConfigExportCompleteFailMsg;

static
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,23 @@ IDFBuildConfiguration_ParseCommand=Parse Compile Commands File
IncreasePartitionSizeTitle=Low Application Partition Size
IncreasePartitionSizeMessage=Less than 30% of application partition size is free({0} of {1} bytes), would you like to increase it? Please click <a href={2}>here</a> to check more details.
ToolsInitializationDifferentPathMessageBoxTitle=Different IDF path found in the config file
ToolsInitializationEimMissingMsgBoxTitle=ESP-IDF Missing
ToolsInitializationEimMissingMsgBoxMessage=ESP-IDF is not found on your system. Please use EIM to install the ESP-IDF on your system to use the IDE. Click Yes to go to the download page and install EIM.
ToolsInitializationDifferentPathMessageBoxMessage=A different ESP-IDF path was found in the esp_idf.json.json configuration file. Do you want to install the tools in the new path or the old path? Please click on the appropriate button.\nNew Path: {0}\nOld Path: {1}
ToolsInitializationDifferentPathMessageBoxOptionYes=Use New Path
ToolsInitializationDifferentPathMessageBoxOptionNo=Use Old Path
RefreshingProjects_JobName=Refreshing Projects...
IDFBuildConfiguration_PreCheck_DifferentIdfPath=The project was built using the ESP-IDF located at the {0} path.\nThe currently active ESP-IDF path in the IDE is {1}.\nPlease clean the project using "ESP-IDF:Project Full Clean" menu option to use the active ESP-IDF configuration.
IDFToolChainsMissingErrorMsg=Toolchains are missing. Please use ESP-IDF Manager for configuring
IDFToolChainsMissingErrorMsg=Toolchains are missing. Please use ESP-IDF Manager for configuring

NoActiveEspIdfInWorkspaceMsgTitle=ESP-IDF Setup
NoActiveEspIdfInWorkspaceMsg=ESP-IDF is required to use Espressif IDE. Would you like to configure it now?

OldConfigFoundMsgBoxTitle=Old Configuration Found
OldConfigFoundMsgBoxMsg=An old ESP-IDF configuration has been detected.\nIf you want to use these you need to export these configuration and pass them on to EIM for updated configurations.\nWould you like to export these settings?\n\nPress 'Yes' to choose a location to save.
OldConfigExportDirectorSelectionDialogTitle=Select Destination
OldConfigExportDirectorSelectionDialogInfo=Choose a directory to save the exported settings.
OldConfigExportCompleteSuccessMsgTitle=Export Successful
OldConfigExportCompleteSuccessMsg=The configuration has been successfully copied to:\n{0}
OldConfigExportCompleteFailMsgTitle=Export Failed
OldConfigExportCompleteFailMsg=An error occurred while copying the configuration.\n{0}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.espressif.idf.core.tools;

public interface EimConstants
{
String EIM_WIN_PATH = "C:\\Espressif\\tools\\eim_idf.json"; //$NON-NLS-1$

String EIM_URL = "https://dl.espressif.com/dl/eim/"; //$NON-NLS-1$

String EIM_POSIX_PATH = System.getProperty("user.home").concat("/.espressif/tools/eim_idf.json"); //$NON-NLS-1$ //$NON-NLS-2$

String INSTALL_TOOLS_FLAG = "INSTALL_TOOLS_FLAG"; //$NON-NLS-1$

String TOOL_SET_CONFIG_LEGACY_CONFIG_FILE = "tool_set_config.json"; //$NON-NLS-1$

String OLD_CONFIG_EXPORTED_FLAG = "OLD_CONFIG_EXPORTED_FLAG"; //$NON-NLS-1$
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.espressif.idf.core.tools;

import java.io.FileReader;
import java.io.IOException;

import org.eclipse.core.runtime.Platform;

import com.espressif.idf.core.tools.vo.EimJson;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class EimIdfConfiguratinParser
{
Comment on lines +12 to +13
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix class name typo.

The class name contains a typo: "Configuratin" should be "Configuration".

-public class EimIdfConfiguratinParser
+public class EimIdfConfigurationParser
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public class EimIdfConfiguratinParser
{
public class EimIdfConfigurationParser
{

private EimJson eimJson;
private Gson gson;

public EimIdfConfiguratinParser()
{
gson = new GsonBuilder().setPrettyPrinting().enableComplexMapKeySerialization()
.excludeFieldsWithoutExposeAnnotation().create();
}

private void load() throws IOException
{
try (FileReader fileReader = new FileReader(
Platform.getOS().equals(Platform.OS_WIN32) ? EimConstants.EIM_WIN_PATH : EimConstants.EIM_POSIX_PATH))
{
eimJson = gson.fromJson(fileReader, EimJson.class);
}
}
Comment on lines +23 to +30
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Improve error handling in load() method.

The load method should handle JSON parsing errors and file not found scenarios more gracefully.

 	private void load() throws IOException
 	{
+		File configFile = new File(
+			Platform.getOS().equals(Platform.OS_WIN32) ? 
+				EimConstants.EIM_WIN_PATH : 
+				EimConstants.EIM_POSIX_PATH
+		);
+		
+		if (!configFile.exists()) {
+			throw new FileNotFoundException("EIM configuration file not found: " + configFile.getPath());
+		}
+
 		try (FileReader fileReader = new FileReader(
-				Platform.getOS().equals(Platform.OS_WIN32) ? EimConstants.EIM_WIN_PATH : EimConstants.EIM_POSIX_PATH))
+				configFile))
 		{
 			eimJson = gson.fromJson(fileReader, EimJson.class);
+			if (eimJson == null) {
+				throw new IOException("Failed to parse EIM configuration file");
+			}
+		} catch (JsonSyntaxException e) {
+			throw new IOException("Invalid JSON format in EIM configuration file", e);
 		}
 	}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private void load() throws IOException
{
try (FileReader fileReader = new FileReader(
Platform.getOS().equals(Platform.OS_WIN32) ? EimConstants.EIM_WIN_PATH : EimConstants.EIM_POSIX_PATH))
{
eimJson = gson.fromJson(fileReader, EimJson.class);
}
}
private void load() throws IOException
{
File configFile = new File(
Platform.getOS().equals(Platform.OS_WIN32) ?
EimConstants.EIM_WIN_PATH :
EimConstants.EIM_POSIX_PATH
);
if (!configFile.exists()) {
throw new FileNotFoundException("EIM configuration file not found: " + configFile.getPath());
}
try (FileReader fileReader = new FileReader(configFile))
{
eimJson = gson.fromJson(fileReader, EimJson.class);
if (eimJson == null) {
throw new IOException("Failed to parse EIM configuration file");
}
} catch (JsonSyntaxException e) {
throw new IOException("Invalid JSON format in EIM configuration file", e);
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you also handle eim file not found, parsing exception issues and version specific things(not sure if it's already introduced version number the eim_ide.json file)



public EimJson getEimJson(boolean reload) throws IOException
{
if (reload)
{
load();
}

if (eimJson == null)
{
load();
}

return eimJson;
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.espressif.idf.core.tools;

import org.eclipse.osgi.util.NLS;


public class Messages extends NLS
{
private static final String BUNDLE_NAME = "com.espressif.idf.core.tools.messages"; //$NON-NLS-1$

public static String InstallToolsHandler_CopyingOpenOCDRules;
public static String InstallToolsHandler_OpenOCDRulesCopyWarning;
public static String InstallToolsHandler_OpenOCDRulesCopyWarningMessage;
public static String InstallToolsHandler_OpenOCDRulesNotCopied;
public static String InstallToolsHandler_OpenOCDRulesCopyPaths;
public static String InstallToolsHandler_OpenOCDRulesCopyError;
public static String InstallToolsHandler_OpenOCDRulesCopied;

static
{
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}

private Messages()
{
}
}
Loading
Loading