-
Notifications
You must be signed in to change notification settings - Fork 516
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
ACA-Py Upgrade command implementation #1557
ACA-Py Upgrade command implementation #1557
Conversation
Signed-off-by: Shaanjot Gill <[email protected]>
Signed-off-by: Shaanjot Gill <[email protected]>
Signed-off-by: Shaanjot Gill <[email protected]>
Signed-off-by: Shaanjot Gill <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! I wonder if we should store the agent version in the wallet, that way we know what version we are upgrading from, and we could even check on startup if an "upgrade" was required. (Obviously existing deployments wouldn't have this so would require the "--from-version" to be provided, but if the version number were in the wallet all they would need to do is "aca-py upgrade")
I agree, the version should likely be stored to allow for automatic upgrades. This would probably mean auto-populating the version if it is not detected during startup, since we don't store one at the moment. |
Signed-off-by: Shaanjot Gill <[email protected]>
I wouldn't recommend auto-populating the version number in the database on startup. I suggest we insert the version number when we create the database (on For I also suggest we have a VERY OBVIOUS MESSAGE somewhere that they backup their database before they run an |
Working on this. |
OK as long as you agree with it :-D |
Signed-off-by: Shaanjot Gill <[email protected]>
Signed-off-by: Shaanjot Gill <[email protected]>
Signed-off-by: Shaanjot Gill <[email protected]>
@ianco @andrewwhitehead This is ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@andrewwhitehead do you want to take a look before we merge?
@swcurran I think this is good to go, my only concern is that upgraded agents will refuse to start until the |
Can you propose specific changes to be made? @shaangill025 -- can you take a look? I'd really like to get this out today, so collaborating on this would be helpful. The big issue is refusing to start without the upgrade. Ideas on how best to deal with that? Next the issue of indicating a version -- what do you propose we document to help them? Can they look at the "version.py" from their previous version to tell them? |
Alternatively:
Opinions welcome! What would developers want? |
I'm not sure. I think the upgrade could be made optional, as the only thing that's affected is continuation of existing did-exchange connections (AFAIK). To get the current version of their aca-py install the easiest way is probably to run |
@andrewwhitehead I see there is a flaw here when introducing this into ACA-Py, how about I raise an exception here and ask to execute the
The YAML config for previous versions will be the same for this release. So even if somebody puts in the wrong
|
Hm, it doesn't make sense to me to repeat the upgrade commands for each version, they should all be done from the --from-version onward in order. v0.6.0-v0.7.1 doesn't require any upgrade for instance. It seems like if the --from-version isn't specified and no version is stored then we should just start from the first defined upgrade. In any case, I think the upgrade command should be optional for this release (only if a user wants to use existing did-exchange connections for instance). |
Right now, YAML config for each version is defined separately and not incrementally onwards from the specified version as you have proposed above. I can add this in today. Regarding making
I think this change still makes sense. |
I don't think we ever want to auto-add the version record unless it's a new wallet. For an existing wallet that should only happen when |
Sounds good, working on the above changes and I have added the incremental/onward config support. This should be ready in the next 2-3 hours. @andrewwhitehead With |
The logic there looks a little too complicated to verify right now. Let's just leave the version handling out of the wallet config for now. |
Signed-off-by: Shaanjot Gill <[email protected]>
Signed-off-by: Shaanjot Gill <[email protected]>
@andrewwhitehead @swcurran The requested changes are in and ready for review. |
Signed-off-by: Shaanjot Gill <[email protected]>
Signed-off-by: Shaanjot Gill <[email protected]>
Signed-off-by: Shaanjot Gill <[email protected]>
I hadn't realized that the We can't really expect users to know the path to the configuration file, or even where the aca-py module is installed on their system. |
Running the |
Signed-off-by: Shaanjot Gill <[email protected]>
Testing with the latest, if I run
But that's without any wallet configuration, so what records is it re-saving? The same output is produced if run a second time. |
Oddly if I run without the
Edit: oops, looks like that's because I was pointing it as the test config not the default one. |
Signed-off-by: Shaanjot Gill <[email protected]>
With no wallet configuration, we get the |
Signed-off-by: Shaanjot Gill [email protected]
upgrade
commandExample
--upgrade-config
- path to YAML config fileExample YAML config
ConnRecord
andV10CredentialExchange
.update_existing_records
can be used to handlechanges where existing records need to be updated, for instance, if a new required field has been added to Marshmallow
schema. It is handled here: link1 and link2 and link3, this will have to be managed every release.
--from-version
is only required when version information is not there in storage. It will be ignored if version is found in storageWalletGroup
argumentsUpdate: now follows this approach.
Thanks @ianco for suggesting the command approach. This is an initial implementation, for now, it can only handle re-save and/or update records but it can be expanded upon. @andrewwhitehead, @swcurran, and @ianco I will appreciate any feedback.