-
Notifications
You must be signed in to change notification settings - Fork 320
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
T6007: revise migration system #3692
Conversation
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
d47e6cd
to
418df9e
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
cfec08a
to
7e2f9fe
Compare
https://github.com/vyos/vyos-1x/actions/runs/9639183334 PR smoketests report an error during HTTP API testing |
Fixed: update to |
This will need a rebase after: |
d9b3a71
to
59c6c65
Compare
Failure was for: |
59c6c65
to
a6eaee2
Compare
This is a ghost issue which comes and goes and I have not yet identified the root cause - you may omit that error |
a6eaee2
to
5502a75
Compare
👍 VyOS CLI smoketests finished successfully! |
Change Summary
This is a simplification of the migration system that provides a dramatic speed up of config migration, and requires little adjustment on the part of authors of migrations scripts.
Taking examples from the configtest directories, running time improvement is, for example:
basic-vyos:
old:
new:
firewall-big:
old:
new:
The difference is impressive, but not surprising, as we eliminate the parse/write step traditionally required for each migration script, instead operating on a resident configtree under modifications by the body of the migration script. The scripts have been stripped of the boiler plate read/parse/write; the migrate.py module provides a wrapper to run a single 'script' for testing, as one is accustomed to.
Example of the changes for a recent migration script, ignoring white space:
The only subtlety in writing the form of migration module is that one now has to be aware of local scope, so if a traditionally global variable is updated in the
migrate
function, one will encounter the standard error.UnboundLocalError: cannot access local variable ...
I found only ~10 scripts that had this issue, due to the nature of the translation, but don't expect it be an issue for authors of the new format.
Types of changes
Simplification, improved error reporting, and performance improvement.
Related Task(s)
Related PR(s)
Component(s) name
Proposed changes
How to test
Smoketest result
make testc:
Checklist: