-
Notifications
You must be signed in to change notification settings - Fork 374
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
Index directory layout migration #600
Comments
I'm currently indifferent. We haven't heard of many complaints about the explicit migration in the past, right @corneliusweig ? My main concern is people leaping forward 3 versions at a time (think: they don't have So we need to probably manually test direct migration from 0.2 to latest to see if it's gracefully migrated (either explicitly or implicitly). |
I noticed a bug when I tried the update from 0.2 to master. Here's what I did:
Here's the output I saw after using the build from master (I kept both binaries in this folder so that's why this one has
I'm not exactly sure why this happens, but I'll look into it and comment here with what I find. |
Ok so the above happens because in root.go the index migration check happens after the receipts migration check in the preRun function. Once I got past that I noticed that the receipt migration failed because it calls I think a simple solution would be to move the index migration before the receipts migration (just a hunch, haven't dug too deep into it). |
Doing index migration first, then receipts migration can open a can of worms. If we can maintain the current order, that would be the best (if there's an easy solution). If not, we can consider ripping out the receipts migration for the upcoming 0.X version. |
So in my first pass at this I tried changing some stuff around. The receipts migration uses I'm not sure if there's an easy solution here since the install code will be using the new index paths. What would the path forward for users on 0.2 look like if the receipts migration was removed from 0.X? |
At this point 0.2 was a long time ago. |
There is another option. So far, we see the migration as a two-step process: Dropping the migration code ls -d $KREW_HOME/store/ > plugins.tmp \
&& rm -r $KREW_HOME \
&& {reinstall krew} \
&& krew install < plugins.tmp And this should work for all OSes, so it's not as easy as it sounds. |
Doesn't sound like a bad idea. Though, it might be a little too burdensome to refactor. We already have a receiptsmigration package that uses old way of doing things, I'm not sure how these two would work together. What if we detected receiptsmigration and told v0.2.x users:
instead of mechanically trying to migrate? |
Yes, this is more or less what I tried to sketch with my bash snippet. This can work, but is not great UX. And the crucial point is to get 3) right. Because after 0.3 we use the receipts folder to list plugins, and if someone has a 0.2 KREW_HOME, this won't work for him. That's why I'm worried that this may be more complex than it sounds. We could try out if we can get the unified 0.2|0.3->0.4 migration to work. If it's too hairy we can still abandon this idea. |
So I took a quick pass at getting the unified 0.2|0.3->0.4 migration to work. I think the main issue boils down to needing to reinstall the plugins to generate receipts for 0.2 users since the install path will assume a migrated index layout. I haven't had time since I last tried to make changes, but I have a feeling that it would get pretty messy trying to get that to work without performing the index migration first, but as @ahmetb mentioned, this could cause other issues. |
@ahmetb @corneliusweig gently pinging. How do you guys want to proceed with this? |
I recommend we rip out receipts migration as part of this release. That way the indexmigration can be a log simpler and automatic I assume. |
That works for me, @corneliusweig if that sounds good to you, then I can open a PR to
|
If that is so much simpler, then let's not complicate things and remove the old migration code. So yes, go ahead! |
Please make sure to create a separate PR for removing receiptsMigration. That’d be easier to navigate. |
Currently there is a
krew system index-upgrade
command to migrate users to the new directory structure needed to support multiple indexes. It's been mentioned before about potentially making this migration happen automatically.Both options seem fine to me. The receipts migration used a subcommand to perform the migration but I also think it might be more user friendly to have the index migration happen under the hood. @ahmetb @corneliusweig what are your thoughts?
/area multi-index
The text was updated successfully, but these errors were encountered: