Skip to content

feat(user): check the installation before migrating user data - #186

Open
ehennestad wants to merge 8 commits into
fix-catalog-upgrade-from-mainfrom
check-installation-before-migration
Open

ehennestad wants to merge 8 commits into
fix-catalog-upgrade-from-mainfrom
check-installation-before-migration

Conversation

@ehennestad

@ehennestad ehennestad commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A repository updated with git keeps the MATLAB search path that was saved for the earlier version. After an update from main, the folders code/api, code/examples, code/external and code/modules are not on it. dev also requires 18 community toolboxes, while main requires 2 and bundles 8 of the others under external/fileexchange, which dev does not track.

NansenUserSession starts the migration anyway. migrateUserdata moves and deletes _userdata, and upgradeProjects creates each project again. That step needs all of NANSEN and its toolboxes, so it fails on the first missing function, at every start, after two dialogs and a backup of each project folder.

Change

nansen.internal.setup.findInstallationProblems lists the folders of the NANSEN code that are not on the search path and the required community toolboxes that are not on it. It compares genpath(nansen.toolboxdir) with the search path, and uses the installCheck of each required entry in the dependency manifest. The installCheck of Limit figure size is corrected to LimitFigSize, the name of the file.

NansenUserSession calls it before migrateUserdata and throws NANSEN:Setup:InstallationIncomplete if anything is missing. _userdata is not touched, and the message says to run nansen_install. nansen and nansen.setup show the message without a stack trace. The session creates the add-on manager first, because that is what puts the toolboxes it tracks on the search path.

upgradeProjects calls it before its dialogs. If anything is missing it warns with NANSEN:ProjectManager:ProjectUpgradeSkipped, says where nansen_install is, and leaves the project folders alone.

The check only runs when there is something to migrate, so an ordinary start is not affected.

🤖 Generated with Claude Code

ehennestad and others added 2 commits November 8, 2026 09:56
findInstallationProblems reports the folders of the NANSEN code that
are not on the search path and the required community toolboxes that
are not on it. A repository updated with git keeps the search path
that was saved for the earlier version, so both can be missing after
an update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The migration of the _userdata folder deletes that folder, and the
project upgrade after it creates each project again, which needs all
of NANSEN and its toolboxes. On an incomplete installation every
project upgrade failed at every start, after two dialogs and a backup
of the project folder.

The session now stops before it touches _userdata when the
installation is incomplete, and the error says to run nansen_install.
upgradeProjects warns and leaves the project folders alone instead of
attempting each upgrade. The check only runs when there is something
to migrate, so an ordinary start is not affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ehennestad
ehennestad added this pull request to stack #187 November 8, 2026 08:57
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

676 tests  +7   675 ✅ +6   1m 31s ⏱️ +19s
 54 suites +1     1 💤 +1 
  1 files   ±0     0 ❌ ±0 

Results for commit acee67f. ± Comparison against base commit 9296936.

♻️ This comment has been updated with latest results.

github-actions Bot and others added 2 commits November 8, 2026 09:02
…gration

The base branch no longer tracks .github/badges/tests.svg, so the
generated badge is removed here as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ehennestad ehennestad self-assigned this Nov 8, 2026
ehennestad and others added 4 commits November 8, 2026 17:22
…gration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nansen.setup turned NANSEN:Setup:InstallationIncomplete into a warning
and went on without a user session, so it then failed with "No user
session is active". The identifier now joins the errors that end the
setup with their message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The manifest said limitFigSize, while the file and every caller use
LimitFigSize. The installation check refuses a migration when a
required install check does not resolve, so the entry has to match the
name of the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nansen_install.m is in the repository root, which it does not add to
the search path, so the warning has to name the folder. Upgrades run
when a user session is created, so MATLAB has to be restarted after
the installation.

testFailedUpgradeWarnsWithReason now assumes a complete installation,
because an incomplete one skips the upgrade that the test exercises.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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