Skip to content

feat: add migration worker and update manage to have a singular migra…#1819

Merged
ale8k merged 4 commits intocanonical:v3from
ale8k:juju-9053/migrate-model-job
Jan 21, 2026
Merged

feat: add migration worker and update manage to have a singular migra…#1819
ale8k merged 4 commits intocanonical:v3from
ale8k:juju-9053/migrate-model-job

Conversation

@ale8k
Copy link
Contributor

@ale8k ale8k commented Jan 20, 2026

Description

…te method. This PR:

  1. Adds the worker
  2. Updates river to take an UpgradeManager interface
  3. Adds a singular method for migrations on the UpgradeManager.

Engineering checklist

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

Test instructions

@ale8k ale8k requested a review from a team as a code owner January 20, 2026 13:07
Copy link
Contributor

@SimoneDutto SimoneDutto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, a few comments here and there

Copy link
Contributor

@SimoneDutto SimoneDutto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more test please and it's approved

Comment on lines +53 to 56
u := &dbmodel.Identity{Name: job.Args.Username}
if err := w.store.FetchIdentity(ctx, u); err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

It would be awesome, if you feel like it, to refactor the permission checks so that they're in jujuapi and make it so that the manager doesn't need the OpenFGA user at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How could we do it in jujuapi? Any worker could pick this up, and the time between their session could have been invalidated. Unless I'm misunderstanding?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can discuss separately another time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's a bigger issue I think but I'm not really too sure on how we solve it... I think each call should re-validate what it intends to do in a smart way.

@ale8k ale8k force-pushed the juju-9053/migrate-model-job branch from ab6ebc5 to a1f9c24 Compare January 21, 2026 13:28
Comment on lines +53 to 56
u := &dbmodel.Identity{Name: job.Args.Username}
if err := w.store.FetchIdentity(ctx, u); err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can discuss separately another time.

@ale8k ale8k merged commit 8dd4073 into canonical:v3 Jan 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants