Add migration after the provenance redesign#2336
Merged
giovannipizzi merged 3 commits intoDec 11, 2018
Merged
Conversation
|
Coverage increased (+0.002%) to 68.966% when pulling 5685025889cfb2fc15b0fc6b2d79bf6442ff3c18 on sphuber:fix_2178_provenance_redesign_migration into 454bfc3 on aiidateam:provenance_redesign. |
The migrations consist of two steps: * Inferring the node process type of the node type * Migrating the node type, deleting illegal links and renaming links The process type column was added sometime ago, which is used to store the entry point string of the process class that led to the creation of the node. This is mostly applicable for job calculations and workflows. Since the node type is the same for all calculations and workflows, the process type is necessary to keep the information of the process class that ran it. Older databases may contain job calculations and workchains that were run before the code was updated to include the process type. There the information for what sub class, of especially the JobCalculation, was contained in the node type. Since in this migration, the node type will be migrated to be just the base CalcJobNode, with type string `node.process.calculation.calcjob.CalcJobNode.`, the information of the calculation sub class would be lost. Therefore, before migrating the node types, we attempt to infer the entry point string from the node type string and store that in the process type column. Node type strings that cannot be mapped on a known entry point string will get a fallback process type string and are logged to a file. After this is completd, a normal database migration is applied, where illegal links are deleted, the remaining renamed according to the new rules and names and the node types are renamed according to the new node ORM class type strings.
…lculation` There has been a period, at the very beginning of the move to processes where the node classes had the type `calculation.process.ProcessCalculation.` These could represent either the execution of a workfunction or a workchain. Therefore, we first convert all `ProcessCalculations` to `WorkCalculations` and in a second step, we convert all `WorkCalculations` that have an attribute called `function_name` to `WorkFunctionNode`. The only remaining `WorkCalculations` then have to be `WorkChainNodes`.
The migration for the provenance redesign will delete illegal links such as `return` and `call` links outgoing from calculation nodes. Since the migration will simply delete them, before we do so, we detect these illegal links, and if found will print a warning to the console and write the offending links to a migration log file. This way, the user could potentially restore the deleted links.
5685025 to
6924089
Compare
giovannipizzi
approved these changes
Dec 11, 2018
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.
Fixes #2178
Tested on 5 production databases: