Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-5250

Workspace refactoring





      Currently, we have a lot of troubles with Studio workspace / JGit (NXS-5232), in particular the NXS-5212 Invalid ref name: HEAD problem. However, we don't know the root cause of the problem and it keeps impacting more and more customers. In regards to workspace, several things are not clear: its lifecycle, the responsibility of each class, and workspace pool (caching mechanism). This ticket aims to address these problems by refactoring the workspace usage.


      We want to make workspace safer to use and easier understand. We also want to avoid using "workspace" everywhere, but replace by other more appropriate vocabulary. In more detail, it means:

      1. Understand workspace lifecycle
      2. Simplify the logic by removing useless class
      3. Distinguish user-specific actions (workspace), and project-common actions (repository)
      4. Distinguish read and write actions
      5. Reduce the workspace state changes — error-prone actions.

      Source Code Changes

      GitService is renamed from VersioningService (NXS-2938). Its primary goal is to interact with workspace. That's why we always use Workspace as input parameter, and avoid using File from now on. The service contains the following logic:

      1. Read operations (branches, tags, file changes, file content)
      2. Write operations which require a workspace (delete tag, commit, delete wip commit)
      3. Write operations which do not require a workspace (create branch, create WIP branch, delete branch, delete tags)
      4. WIP branch mechanism (saveWIP, commitWIP, pullWIP, pushWIP)
      5. Legacy operations (get history, compare file, merge, pull rebase)

      ProjectDataService contains methods split from VersioningService. This is a business level service. Its goal is to provides information for a given project.

      1. Interact with project data (files)
      2. Deserialization and serialization of Java object, e.g. ApplicationDefinition
      3. Branch status (ahead commits, behind commits, possible WIP commit)

      GitRepositoryService contains methods split from VersioningService. Its goal is to handle CRUD operations for Git repository. It only takes action at the beginning and end of the repository life cycle. It also provides useful information related to the repository (remote URL, credentials). The main difference between GitService and GitRepositoryService is that they take actions in different phrases in repository's life cycle. The service contains the following logic:

      1. Create repository
      2. Delete repository
      3. Rename repository
      4. Get repository URL
      5. Get credentials

      ProjectImportService contains methods split from VersioningService. Its goal is to handle project import / export. The service contains the following logic:

      1. Push force
      2. Reconfigure repo after import
      3. Prepare repo before export
      4. prepare repo before import



      // TODO


          Issue Links



              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created:

                  Time Tracking

                  Original Estimate - Not Specified
                  Not Specified
                  Remaining Estimate - 0 minutes
                  Time Spent - 4 days