Conversation
chiatt
left a comment
There was a problem hiding this comment.
For string formatting - could you use f-strings or .format() for localized strings?
cea2bd4 to
6c36f26
Compare
…nto cbyrd/package-migrations-rebuild
|
EXAMPLE COMMAND OUTPUT The error messages are confusing.... For example
Maybe better would be Also, there are directions at the very beginning and at the end. I think all the directions should be at the end. The ending message is also confusing given the message at the top. (Do I need to update the graph to have all updates the migration was going to apply??... isn't that the point of the migration? Or should this message even be shown if I already have the change (per the first message)) |
|
After the above error I ran it with the Again, the message is confusing ( Is the Finally, while this command could change business data, I don't have any tiles in the system, so that warning doesn't really apply in my case. |
|
It would be nice to add a message after a person calls |
|
Can we get rid of the step to export graphs and just read them directly from the database? Currently it's:
Maybe it could be this:
|
Unless I'm mistaken, we don't want that pattern. These are package migrations meant to work off the package as the source of truth. But yeah happy to chat theory around this thing 👍 |

Types of changes
Description of Change
Issues Solved
Closes #9054
Further comments
Versions an Arches application's graphs the way Django migrations version schema. Rebuilds the approach from #12840.
An application ships graphs. When version 2 changes one, every install that already has version 1 needs its graph rows updated, its tile data brought in line, the graph republished, and its resources moved onto the new publication. This does that, with a generator, a runner, and a ledger.
The committed graph JSON under pkg/graphs/** is the desired state, the same files load_package reads. makepkgmigrations replays the app's existing package migrations into an in-memory state, projects the committed JSON into the same shape, diffs them, and writes migrations.
commands:
guards:
AlterNodewould update zero rows and report success.migratepkgchecks the rows a plan is about to write and refuses, naming them.--fakeinstead.load_package. Missing ones are named before anything runs, instead of surfacing asOntology.DoesNotExistinsideGraph.publish().migratepkg <app> zerorefuses up front if any migration in the plan cannot be reversed.RunPackagePythonmigration.testing in rascolls:
Install normally, then adopt:
Make a change and ship it. Add a node to an existing card in the Designer, publish, then:
Your own database already has the rows, so record the graph migration and run the data one:
Optional, and the path nothing exercised before. Blow the database away and let the migrations create every graph:
python manage.py setup_db --force python manage.py load_ontology -s arches_rascolls/pkg/ontologies/linkedart python manage.py migratepkg arches_rascolls --plan time python manage.py migratepkg arches_rascollsThe ontology has to be loaded first. Graphs point at one by foreign key, and the pre-flight check refuses without it rather than failing inside
Graph.publish().known limitaitons:
ConstraintModelis not a concrete field ofCardModel, so the projection does not see it.migratepkgdoes not reindex. Reindex affected resources afterwards or search will reflect the old graph.load_package. A release that adds a node using a new controlled list has to ship the list separately, and nothing orders the two.