Skip to content

Add installationMethod as optional output from installFexPackage#52

Merged
ehennestad merged 2 commits intomainfrom
changed-installFexPackage
Mar 20, 2026
Merged

Add installationMethod as optional output from installFexPackage#52
ehennestad merged 2 commits intomainfrom
changed-installFexPackage

Conversation

@ehennestad
Copy link
Copy Markdown
Owner

Add installationMethod ("folder" or "mltbx") as second optional output from matbox.setup.internal.installFexPackage

@ehennestad ehennestad requested a review from Copilot March 20, 2026 15:28
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 20, 2026

Test Results

21 tests   21 ✅  21s ⏱️
 5 suites   0 💤
 1 files     0 ❌

Results for commit 3668e7d.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an optional second output (installationMethod) to matbox.setup.internal.installFexPackage so callers can distinguish between zip-extracted installs (“folder”) and MATLAB-managed add-on installs (“mltbx”).

Changes:

  • Updated installFexPackage signature to return [packageTargetFolder, installationMethod].
  • Set installationMethod to "folder" for /zip downloads and "mltbx" for /mltbx installs and already-installed add-ons.
  • Updated output documentation and adjusted mltbx packageTargetFolder to string(missing) for the install path.

Comment on lines 33 to +36
if isInstalled
matlab.addons.enableAddon(toolboxIdentifier, version)
packageTargetFolder = toolboxFolder;
installationMethod = "mltbx";
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

When isInstalled is true, the function assigns outputs but never applies the ~nargout/nargout==1 clearing logic used in the download path. This leads to inconsistent behavior when calling installFexPackage(...) without output arguments (e.g., it may return/echo values in the already-installed case). Consider moving the nargout handling to a single place at the end of the function so it applies to both branches.

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +13
% Output:
% packageTargetFolder - Path to the installed package folder, or
% string(missing) for mltbx packages (managed by MATLAB)
% installationMethod - "folder" for zip-extracted packages,
% "mltbx" for MATLAB toolbox packages
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The docstring says packageTargetFolder is string(missing) for mltbx packages, but when the add-on is already installed you return toolboxFolder (which can be "" if the internal lookup fails). This makes the output contract inconsistent across the two mltbx paths; consider either always returning string(missing) for mltbx, or updating the docs and normalizing toolboxFolder=="" to string(missing) before returning.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.55%. Comparing base (2491817) to head (3668e7d).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
code/+matbox/+setup/+internal/installFexPackage.m 33.33% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
- Coverage   42.26%   41.55%   -0.72%     
==========================================
  Files          59       59              
  Lines        1455     1468      +13     
==========================================
- Hits          615      610       -5     
- Misses        840      858      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ehennestad ehennestad merged commit 2519f3d into main Mar 20, 2026
6 checks passed
@ehennestad ehennestad deleted the changed-installFexPackage branch March 22, 2026 16:48
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.

2 participants