keria icon indicating copy to clipboard operation
keria copied to clipboard

feat: migrate command for all agents

Open iFergal opened this issue 1 year ago • 5 comments

This PR adds a keria migrate command that will fetch all of the agents from the agency DB and kick off the migrate doer used in kli migrate. Slightly weird to mimic a kli command from keria but it works, and means we will pick up changes to kli migrate.

I also pinned the keripy version again - this got unpinned by mistake it seems. But as mentioned before we need it for determinism of builds.

Here is a screenshot example of incepting 2-of-2 multi-sig on an old version, trying to connect without migrating and successfully migrating: image

Note: SignifyGroupHabs are not correctly migrated on keripy - but this is separate for now and has been raised in #257 - I gave some details on why in that issue yesterday.

iFergal avatar Jul 18 '24 17:07 iFergal

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 93.10%. Comparing base (18d3ad7) to head (d8e65cc). :warning: Report is 71 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #272      +/-   ##
==========================================
+ Coverage   93.06%   93.10%   +0.04%     
==========================================
  Files          36       36              
  Lines        7121     7221     +100     
==========================================
+ Hits         6627     6723      +96     
- Misses        494      498       +4     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jul 18 '24 17:07 codecov[bot]

Looks good to me @iFergal. I suppose this is more of an administrative feature, hence the command line tool. Do you have any thoughts how we can test a command like this in case migrate changes?

2byrds avatar Jul 18 '24 20:07 2byrds

Also @iFergal could you post a screenshot(s) showing the command being successfully used on this PR?

2byrds avatar Jul 18 '24 20:07 2byrds

Thanks @2byrds I added a screenshot and note to the description.

Yeah based on recommendations from Phil, migrations should be manual, hence the cli.

Regarding testing - I think we would need a minimal agent and set the migration version to the lowest, run keria migrate and then the basic check could be that the version is up to date. I'm not sure if creating an agent would conflict with any schemas that are assumed to be not migrated already (so far, maybe not, but maybe in the future) - but I could look into it.

On the other hand it's probably unlikely that the kli migrate command will be subject to much change since it just opens the DB and calls db.migrate().

iFergal avatar Jul 18 '24 20:07 iFergal

Based on discussions yesterday and https://github.com/WebOfTrust/keripy/issues/824 more thought should be put into this.

If SignifyGroupHab and other files move to KERIA, we may need a separate set of migrations for KERIA on top of calling db.migrate() from keripy.

iFergal avatar Jul 31 '24 16:07 iFergal

@iFergal Is this ready to merge? Looks like there are merge conflicts that need to be resolved.

If this migrate command works, let's get it in.

kentbull avatar Sep 18 '25 17:09 kentbull

@kentbull I hadn't had the time to revisit this since we had the discussion that parts of keripy need to be moved here, in which case this migration needs to be handled differently. I would be in favour of closing it until someone has capacity to handle it properly.

iFergal avatar Sep 18 '25 18:09 iFergal

Okay, I'll close this for now.

kentbull avatar Sep 18 '25 19:09 kentbull