Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update identifiers to use UUIDs instead of integers #1091

Open
wants to merge 116 commits into
base: master
Choose a base branch
from
Open

Conversation

dakoop
Copy link
Member

@dakoop dakoop commented Jun 5, 2015

Since integer identifiers make version tree modifications difficult, this branch seeks to replace them with UUIDs.

dakoop and others added 17 commits January 17, 2013 16:04
… integers.

The goal here is to make things like merging vistrails or dealing with distributed versions of the same vistrail much easier (e.g. for use with crowdLabs).  The main changes so far are a new schema where ids (and foreign ids) are strings that store UUIDs instead of integers and changes to code to support this.

Current known issue is that there is no translation back and forth between the old and new schemas so ***do not use this to create vistrails you wish to open later***.

core/layout/version_tree_layout.py:
  - VistrailsTreeLayoutLW.generateTreeLW: use Vistrail.ROOT_VERSION constant

core/modules/module_descriptor.py:
  - ModuleDescriptor.add_input_port: include self when computing sort_key
  - ModuleDescriptor.add_output_port: include self when computing sort_key

core/modules/module_registry.py:
  - ModuleRegistry.add_port: compute sort key based on the length of the port_specs_list since sorting the id does not work any longer

core/vistrail/controller.py:
  - VistrailController._set_current_version: raise Exception is 0 is passed
  - VistrailController.flush_pipeline_cache: use Vistrail.ROOT_VERSION
  - VistrailController.set_version: use Vistrail.ROOT_VERSION
  - VistrailController.create_port_spec_static: compute sort key based on length of the port_specs_list since sorting by id does not work any longer
  - VistrailController.recompute_terse_graph: use Vistrail.ROOT_VERSION
  - VistrailController.do_version_switch: use Vistrail.ROOT_VERSION, don't convert tag to long

core/vistrail/pipeline.py:
  - Pipeline.get_tmp_id: do not need negative sign here (just a UUID)

core/vistrail/vistrail.py:
  - Vistrail.getPipeline: can't use dispatcher here since UUIDs are also strings, just check if the tag exists
  - Vistrail.getVersionGraph: **removed**
  - Vistrail.pruneVersion: **moved** to gui.vistrail_controller
  - Vistrail.getPipelineDispatcher: **removed**
  - ExplicitExpandedVersionTree: use Vistrail.ROOT_VERSION
  - TestVistrail.test_version_graph: **removed**

db:
  - added version v2_0_0 which uses UUIDs for ids, changed various pointers to reflect this

db/services/action_chain.py:
  - getActionChain: use != not <
  - get_reduced_operations: new method
  - get_operation_diff: new method
  - getCurrentOperations: use get_reduced_operations

db/services/vistrail.py:
  - materializeWorkflow: use DBVistrail.ROOT_VERSION
  - performAdds: ignore "None-ops"
  - invertOperations: use reversed instead of in-place reverse, ignore "None-ops"
  - normalOperations: ignore "None-ops"
  - getPathAsAction: use updated utility routines, keep adds, deletes separate
  - getSharedRoot: changed to make more sense and support new id scheme
  - getOperationDiff: use in instead of has_key

gui/collection/vis_log.py:
  - QExecutionListWidget.add_workflow_exec: don't convert parent_version to int

gui/pipeline_view.py:
  - QAbstractGraphicsPortItem.__init__: don't set a default z-value
  - QAbstractGraphicsPortItem.mouseMoveEvent: calculate the z-value using the module's z-values
  - QGraphicsConfigureItem.__init__: don't set a default z-value
  - QGraphicsConnectionItem.__init__: set z-value using module's z-values
  - QGraphicsModuleItem.setupModule: set z-value to 0.5, need to fix

gui/query_view.py:
  - QQueryView.build_widget: use new signal for versionSelected

gui/version_view.py:
  - QGraphicsVersionItem.show_raw_pipeline: new signal for versionSelected
  - QGraphicsVersionItem.construct_from_root: new signal for versionSelected
  - QVersionTreeScene.adjust_version_colors: use Vistrail.ROOT_VERSION
  - QVersionTreeScene.setupScene: use Vistrail.ROOT_VERSION
  - QVersionTreeScene.selectedChanged: use new signal for versionSelected
  - QVersionTreeScene.double_click: use new signal for versionSelected

gui/vistrail_controller.py:
  - VistrailController._change_version_short_hop: use Vistrail.ROOT_VERSION
  - VistrailController.show_parent_version: use Vistrail.ROOT_VERSION
  - VistrailController.prune_version: **moved** from core.vistrail.vistrail.Vistrail, use Vistrail.ROOT_VERSION
  - VistrailController.prune_versions: use Vistrail.ROOT_VERSION, prune_version call
  - VistrailController.hide_versions_below: use _current_full_graph instead of getVersionGraph
  - VistrailController.show_all_versions: use _current_full_graph instead of getVersionGraph
  - VistrailController.expand_versions: use _current_full_graph instead of getVersionGraph, != instead of >
  - VistrailController.collapse_versions: use _current_full_graph instead of getVersionGraph
  - VistrailController._expand_or_collapse_all_versions_below: use _current_full_graph instead of getVersionGraph
  - VistrailController.get_pipeline_name: use Vistrail.ROOT_VERSION

gui/vistrail_view.py:
  - QVistrailView.create_version_view: use new versionSelected signal
core/vistrail/controller.py:
  - VistrailController.create_port_spec_static: port_spec_key -> port_sort_key
Changes ids on mashups to use uuids as well.
Use unichr instead of QChar.  Note, however, that this looks bizarre on Mac as it shows a large triangle and a small triangle.

vistrails/gui/modules/paramexplore.py:
  - QParameterEditorSelector.__init__: use unichar instead of QChar
Seeing how much depends on version ids, I think it is nice to actually be able to see the version ids.

versions/gui/version_prop.py:
  - QVersionProp.__init__: add id labels
  - QVersionProp.updateVersion: update id field
vistrails/gui/common_widgets.py:
  - QElideLabel: new class

vistrails/gui/version_prop.py:
  - QVersionProp.__init__: use QElideLabel for id
  - QVersionProp.updateVersion: no need to cast to unicode
Conflicts:
	vistrails/gui/collection/vis_log.py
	vistrails/gui/version_prop.py
	vistrails/gui/vistrail_controller.py
This commit begins the process of translating older vistrails (schema 1.0.3) to use uuids.  Known issues:

(1) The link between workflow execs and workflows is not working.  We have support for translating individual entities like vistrails, workflows, logs, but not entire bundles.  This will need to be added.
(2) Some entities that were changed to uuids (session) are not translated because they are not "ids" so the copy won't reassign ids.
(3) The translation is a bit hacky as it uses do_copy from 2.0.0 objects but passing 1.0.3 objects; this requires hacking __class__ which isn't great.

vistrails/core/collection/vistrail.py:
  - VistrailEntity.add_workflow_entity: use ROOT_VERSION, not 0
  - VistrailEntity.add_wf_exec_entity: use ROOT_VERSION, not 0
  - VistrailEntity.reload: if get_persisted_log fails, need to already have log set to None for the guard below to catch

vistrails/core/vistrail/vistrail.py:
  - Vistrail.get_pipeline_name: raise exception is version doesn't exist

vistrails/db:
  - change session in wf_exec to be a uuid (matching vistrail)

vistrails/db/versions/__init__.py:
  - translate_object: add 1.0.3 -> 2.0.0 and 2.0.0 -> 1.0.3 translations

vistrails/db/versions/v1_0_3/translate/v2_0_0.py:
  - initial idea to translate back from uuids

vistrails/db/versions/v2_0_0/translate/v1_0_3.py:
  - translate from numeric ids to uuids

vistrails/gui/collection/vis_log.py:
  - QLogView.set_controller: allow db_name to be "Unknown" so we can open old vistrails
Conflicts:
	vistrails/core/modules/module_descriptor.py
	vistrails/db/domain/__init__.py
	vistrails/db/persistence/__init__.py
	vistrails/db/specs/all.xml
Conflicts:
	vistrails/core/api.py
	vistrails/core/collection/vistrail.py
	vistrails/core/modules/module_registry.py
	vistrails/core/vistrail/controller.py
	vistrails/db/domain/__init__.py
	vistrails/db/persistence/__init__.py
	vistrails/db/services/action_chain.py
	vistrails/db/versions/__init__.py
	vistrails/gui/common_widgets.py
	vistrails/gui/module_info.py
	vistrails/gui/pipeline_view.py
	vistrails/gui/version_prop.py
	vistrails/gui/version_view.py
	vistrails/gui/vistrail_controller.py
@dakoop
Copy link
Member Author

dakoop commented Jun 5, 2015

There are a lot of tests that break with this right now. Much more work to be done.

Need to make sure the remapped pipeline is processed with the remapped
errors
Use a metaclass to create individual test functions
Internal versions in the vistrail need to be updated so we translate
abstractions first to know what this remap is
Add support for subworkflow translations
Cannot rely on port spec uuids to order specs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants