com-pas/compas-open-scd

Apply the new Open-SCD monorepo structure to Compas-Open-SCD

Stef3st opened this issue · 1 comments

Intro

The Open-SCD project recently went from a monolith to a mono-repo architecture. In order to accomplish this a restructure was needed. This has a severe effect on the Compas-Open-SCD repository. The Compas-Open-SCD repository is a fork of the Open-SCD project and has added functionalities to it. If we want to apply the newest changes of the Open-SCD project, we first have to do some manual labor in order to prevent merge conflicts.

Changes made to the fork

As said above, the Compas-Open-SCD repository is a fork, but with alterations. Before we know how to resolve the coming merge conflicts. We need to make sure we know which files are added and which ones are altered, so we can take those into account. These files are noted in the lists below.

New files added to the project

  • src/file.ts
  • src/compas/CompasAutoAlignment.ts
  • src/compas/CompasChangeSetRadiogroup.ts
  • src/compas/CompasComment.ts
  • src/compas/CompasExistsIn.ts
  • src/compas/CompasImportFromApi.ts
  • src/compas/Compasing.ts
  • src/compas/CompasLabelsField.ts
  • src/compas/CompasLoading.ts
  • src/compas/CompasNsdoc.ts
  • src/compas/CompasOpen.ts
  • src/compas/CompasSave.ts
  • src/compas/CompasSclList.ts
  • src/compas/CompasSclTypeList.ts
  • src/compas/CompasSclTypeSelect.ts
  • src/compas/CompasSessionExpiredDialog.ts
  • src/compas/CompasSessionExpiringDialog.ts
  • src/compas/CompasSettings.ts
  • src/compas/CompasUploadVersion.ts
  • src/compas/CompasUserInfo.ts
  • src/compas/foundation.ts
  • src/compas/private.ts
  • src/compas-editors/autogen-substation.ts
  • src/compas-editors/CompasVersions.ts
  • src/compas-editors/foundation.ts
  • src/compas-editors/Sitipe.ts
  • src/compas-editors/sitipe/foundation.ts
  • src/compas-editors/sitipe/sitipe-bay.ts
  • src/compas-editors/sitipe/sitipe-service.ts
  • src/compas-editors/sitipe/sitipe-substation.ts
  • src/compas-services/CompasCimMappingService.ts
  • src/compas-services/CompasNSDocFileService.ts
  • src/compas-services/CompasSclAutoAlignmentService.ts
  • src/compas-services/CompasSclDataService.ts
  • src/compas-services/CompasUserInfoService.ts
  • src/compas-services/CompasValidatorService.ts
  • src/compas-services/foundation.ts
  • src/compas-services/Websocket.ts
  • src/compas-wizards/scl.ts
  • src/locamation/foundation.ts
  • src/locamation/LocamationIEDList.ts
  • src/locamation/LocamationLNEdit.ts
  • src/locamation/LocamationLNList.ts
  • src/menu/CompasAutoAlignment.ts
  • src/menu/CompasCimMapping.ts
  • src/menu/CompasCompareIED.ts
  • src/menu/CompasImportFromApi.ts
  • src/menu/CompasImportIEDs.ts
  • src/menu/CompasMerge.ts
  • src/menu/CompasOpen.ts
  • src/menu/CompasSave.ts
  • src/menu/CompasSaveAs.ts
  • src/menu/CompasSaveAsVersion.ts
  • src/menu/CompasSettings.ts
  • src/menu/CompasUpdateSubstation.ts
  • src/menu/ExportIEDParams.ts
  • src/menu/LocamationVMU.ts
  • src/validators/CompasValidateSchema.ts

Files from Open-SCD that are altered

  • src/Editing.ts
  • src/foundation.ts
  • src/Hosting.ts
  • src/Logging.ts
  • src/open-scd.ts
  • src/Plugging.ts
  • src/Setting.ts
  • src/wizard-dialog.ts [Component already moved out, could be extended at some point]
  • src/wizard-textfield.ts [Component already moved out, could be extended at some point]
  • src/editors/IED.ts
  • src/editors/communication/subnetwork-editor.ts
  • src/editors/protocol104/wizards/selectDo.ts
  • src/editors/publisher/data-set-editor.ts
  • src/editors/publisher/foundation.ts
  • src/editors/publisher/gse-control-editor.ts
  • src/editors/publisher/report-control-editor.ts
  • src/editors/publisher/sampled-value-control-editor.ts
  • src/editors/substation/ied-editor.ts
  • src/editors/templates/datype-wizards.ts
  • src/editors/templates/dotype-wizards.ts
  • src/editors/templates/enumtype-wizard.ts
  • src/editors/templates/lnodetype-wizard.ts
  • src/foundation/ied.ts
  • src/menu/CompareIED.ts
  • src/menu/ImportIEDs.ts
  • src/menu/Merge.ts
  • src/menu/OpenProject.ts
  • src/menu/UpdateDescriptionABB.ts
  • src/menu/UpdateDescriptionSEL.ts
  • src/menu/UpdateSubstation.ts
  • src/menu/VirtualTemplateIED.ts [Plugin already moved out, could be extended at some point]
  • src/translations/de.ts [How the translation will be handled is still an open issue]
  • src/translations/en.ts [How the translation will be handled is still an open issue]
  • src/wizards/clientln.ts
  • src/wizards/commmap-wizards.ts
  • src/wizards/connectedap.ts
  • src/wizards/dataset.ts
  • src/wizards/fcda.ts
  • src/wizards/gsecontrol.ts
  • src/wizards/lnode.ts
  • src/wizards/reportcontrol.ts
  • src/wizards/sampledvaluecontrol.ts
  • src/wizards/subnetwork.ts
  • src/wizards/foundation/dai-field-type.ts
  • src/wizards/foundation/enums.ts
  • src/wizards/foundation/finder.ts
  • src/wizards/foundation/limits.ts

Dependencies from Open-SCD

  • newLogEvent, newOpenDocEvent, newWizardEvent, LitElementConstructor, Mixin, newPendingStateEvent, Wizard, WizardInputElement, newUserInfoEvent, createElement, newActionEvent, isPublic, ComplexAction, SimpleAction, cloneElement, , EditorAction, getValue, WizardActor, getDescriptionAttribute, getInstanceAttribute, getNameAttribute, newSubWizardEvent, checkValidity, WizardAction, wizardInputSelector, compareNames, newIssueEvent from src/foundation.js
  • Nsdoc from src/foundation/nsdoc.js
  • SCL_NAMESPACE, isSCLNamespace from src/schemas.js
  • WizardTextField from src/wizard-textfield.js
  • EditingElement from src/Editing.js
  • mergeWizard from src/wizards.js
  • src/oscd-filter-button.js
  • SelectedItemsChangedEvent from src/oscd-filter-button.js
  • patterns from src/wizards/foundation/limits.js
  • src/WizardDivider.js
  • newLoadNsdocEvent from src/Setting.js
  • wizards from src/wizards/wizard-library.js
  • src/plain-compare-list.js
  • src/wizard-textfield.js [Will become oscd-textfield]
  • src/filtered-list [Will become oscd-filtered-list]
  • src/action-pane [Will become oscd-action-pane]
  • src/action-icon [Will become oscd-action-icon]

Suggestions to approach this issue

Step 1: Apply the restructure

Now that the file structure is clear a proof of concept can be made to see if the merge issues can be resolved. There are 2 options here to start.

  1. Apply the restructure manually to the entire Compas-Open-SCD project. This would mean to bump every file up 2 folders (packages/open-scd). This is probably the fastest way to implement the new structure. However the idea is to move out the compas related software to a different package. This can be more challenging with this approach
  2. Create a new fork of Open-SCD and start moving the software to the new package and see what we need from the Open-SCD package. This will probably take a bit more time, but it does leave out the manual labor that needs to be done first in order to get the new Open-SCD version.

Both approaches have merit and can be done. However approach #1 will keep the git history of Compas-Open-SCD in tact. If that's desirable the first approach would be best.

Step 2: Move out compas related software

The idea is that the open-scd package should be completely identical to the open-scd package we fork from. This will mean that The entire list from the new files should be moved to a packages/compas folder. Be sure that this folder has a dependency to the packages/open-scd folder.

Step 3: Move out tests for the Compas software

When the source code is succesfully moved out and the dependencies work correctly the tests can be moved out and run. Be sure all tests are succesful.

Step 4: Make sure the docker container is correctly build

The docker container should eventually be build from the compas package in order to make sure everything is included.

Open questions

  • How to create a dependency to a different package?
  • How to create the new default plugins that needs to be loaded in Compas-Open-SCD? (extend and override?)

Before starting:

  1. Update Compas-Open-SCD with the commit before the monorepo.
  2. Recheck the file for differences
  3. Check to see if changes between files can be reverted or need to be extended into package/compas