Skip to content

[VSC-1739 | 1742 | 1735]Current setup download enhancements #1625

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

brianignacio5
Copy link
Collaborator

@brianignacio5 brianignacio5 commented Jul 23, 2025

Description

Fixes #1623
Fixes #1618
Fixes #1612

This pull request introduces improvements to the ESP-IDF tooling, focusing on enhancing download reliability, caching, and code maintainability. Key changes include replacing downloadFile and downloadWithRetries with a more robust downloadWithResume method, introducing caching for ESP-IDF version lists, and replacing the move function with a custom robustMove function for better error handling. Additionally, some dependencies and unused code have been removed for simplification.

Improvements to download reliability:

  • Replaced downloadFile and downloadWithRetries with downloadWithResume in src/espIdf/documentation/getDocsVersion.ts, src/setup/embedGitPy.ts, and src/setup/espIdfDownload.ts to support resumable downloads. [1] [2] [3] [4]

Caching for ESP-IDF version lists:

  • Added caching logic in src/setup/espIdfVersionList.ts to store and retrieve ESP-IDF version lists, reducing redundant network requests. Includes cache validation, saving, and fallback mechanisms. [1] [2]
  • Implemented a fallback to GitHub releases API and local files if primary download methods fail.

Code maintainability and simplification:

  • Replaced move with utils.robustMove in src/installManager.ts, src/setup/espIdfDownload.ts, and src/utils.ts to improve error handling during file operations. [1] [2] [3] [4] [5]
  • Removed unused dependencies (follow-redirects, https-proxy-agent) and related code, simplifying package.json and src/utils.ts. [1] [2] [3]

Updates to test cases:

  • Updated test cases in src/test/suite/downloadManager.test.ts to use downloadWithResume instead of downloadFile. [1] [2]

Miscellaneous:

  • Updated idf_versions.txt to include new ESP-IDF versions and remove outdated ones.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

Steps to test this pull request

Provide a list of steps to test changes in this PR and required output

  1. Click on "Configure ESP-IDF extension" command.
  2. Execute action. If you can cancel the setup while ESP-IDF or ESP-IDF tool is downloading and try to run the setup again, the setup will see the existing downloaded file and will continue from where is stopped before.
  3. idf_versions.txt now has a cache system with timestamp to redownload the file, also fallback to using GitHub releases api, local file or hardcoded string in code.
  4. Add retry for move function in extension setup.
  • Expected behaviour:

More reliable idf_versions.txt, ESP-IDF and ESP-IDF tools download mechanism.

  • Expected output:

Fallback for idf_versions.txt used if unavailable first link, if download links break the user can continue the download from the previous attempt.

How has this been tested?

Manual steps as described above.

Test Configuration:

  • ESP-IDF Version: Any version
  • OS (Windows,Linux and macOS): macOS

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

@brianignacio5 brianignacio5 added this to the v1.11.0 milestone Jul 23, 2025
@brianignacio5 brianignacio5 self-assigned this Jul 23, 2025
Copy link

github-actions bot commented Jul 23, 2025

Download the artifacts for this pull request:
You can test these changes by installing this VSIX by click menu View -> Command Palette..., type Install from VSIX and then select downloaded esp-idf-extension.vsix file to install the extension.

Copy link
Collaborator

@radurentea radurentea left a comment

Choose a reason for hiding this comment

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

Nice work, LGTM!

@arc12
Copy link

arc12 commented Jul 26, 2025

Thanks @brianignacio5 - nice work!

Copy link
Collaborator

@radurentea radurentea left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants