Repository navigation
feat(project): migrate a project folder when it is opened - #215
Draft
ehennestad wants to merge 1 commit into
Draft
ehennestad wants to merge 1 commit into
ehennestad wants to merge 1 commit into
Conversation
A project folder has a layout of its own, and it can be on a drive that is not connected when a session starts, so it can not be migrated with the user data directory. The first time a session opens a project, ProjectManager brings it to the current layout with the same numbered steps and lock as the user data directory. The version is the LayoutVersion field of project.nansen.json. A project that a newer version of NANSEN organised is refused. A step that has nothing to do does not stop a project in a read only location from opening. The first step moves the Configurations folder into configurations. getProjectCatalogPath saved there while everything else used configurations, which are two folders on a case sensitive file system. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A project folder has a layout of its own. It can be on a drive that is not connected when a session starts, so it cannot be migrated together with the user data directory.
Change
nansen.config.project.ProjectFolderLayoutholds the layout version of a project folder, in theLayoutVersionfield ofproject.nansen.json. A project without that field holdsFIRST_VERSION. The first time a session opens a project,ProjectManager.getProjectObjectcallsProjectFolderLayout.migrate, which runs the numbered steps above the stored version withapplyMigrationStepsand the migration lock. A folder withoutproject.nansen.jsonis left forupgradeProjects.A project that a newer version of NANSEN organised is refused with
NANSEN:Project:LayoutNewer. A step that fails stops the project from opening withNANSEN:Migration:StepFailed. A version that cannot be stored only warns, so a project in a read only location can still be opened when a step had nothing to change there.The first open of every project writes
LayoutVersiontoproject.nansen.json. This is a one-time change to a file that some projects keep under version control.First step
getProjectCatalogPathdefaulted toConfigurations, while everything else usesconfigurations. On a case sensitive file system those are two folders, so the session methods catalog thatuiCreatePipelineanduiEditPipelineuse was kept apart from the other configurations. Step 2 renamesConfigurations, or moves its files intoconfigurationswhen both exist. A file that both folders hold stays in both. On a case insensitive file system there is nothing to do. The default is nowProject.CONFIG_FOLDER_NAME.The tests of the two folder case run only on a case sensitive file system, so they run on the Linux CI runner and are filtered on macOS and Windows.
nansen.internal.migration.tryAcquireLocknow holds the rule that only a timeout is an error when taking the lock, whichNansenUserSessionhad on its own.🤖 Generated with Claude Code