Skip to content
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

Fix wrong keyvalue store being used for the deploy hook registry #6082

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

DieterHolvoet
Copy link
Contributor

Fixes #6081.

@weitzman
Copy link
Member

weitzman commented Aug 3, 2024

LGTM, but what are the ramifications if a D10 site upgrades its Drush to 13, while staying on D10? Past deploy hooks will run?

@DieterHolvoet
Copy link
Contributor Author

Yes, that's what happened to me.

@weitzman
Copy link
Member

weitzman commented Aug 3, 2024

Sorry I was unclear. If this or goes in, it could negatively affect a site that is only upgrading their drush and not their Drupal.

@DieterHolvoet
Copy link
Contributor Author

No that’s what I meant, I only updated Drush, not Drupal. This is obviously a mistake, no? It used to be deploy_hook, then it was mistakingly(?) changed to post_update, which is a different kind of update hook.

@weitzman
Copy link
Member

weitzman commented Aug 4, 2024

Yes it's a mistake and you have the right fix. I'm just wondering if we should copy data into the new registry to avoid problems. Or something.

@DuaelFr
Copy link

DuaelFr commented Aug 6, 2024

I can confirm the issue (introduced in f9186d6) and the fix.
I believe it's a critical one as it can lead to data loss given the wide usage of deploy hooks.

The only problem I can see here is that this fix would land in a 13.0.x version and might cause issues to people that ran their deploy hooks with 13.0.0 for the first time. I believe we need an upgrade path for this specific use case.

@bircher
Copy link
Contributor

bircher commented Aug 6, 2024

Yes I think this should be changed as soon as possible.
It will not affect people upgrading drush from 12 to 13+fix, only for people going from 13-fix to 13+fix, but that is for sure a much smaller group.

@bircher
Copy link
Contributor

bircher commented Aug 6, 2024

I wrote more on slack, I will post it here too so that someone might find it.

We merge this and fix drush 13 and release a new version with it.
So drush 12 is ok, then some versions of drush 13 are broken, and then later versions of drush 13 are ok again.

  • If you update from drush 12 to the fixed drush 13, all is good.
  • if you update from drush 12 to a broken drush 13 then you risk running old hooks again, you notice and you don't run the deploy hooks and you update to the fixed drush 13 and you are fine.
  • If you started with a a broken drush 13 or updated and didn't notice and you have run drush deploy with the broken drush 13 you can fix this in the following way:
    update to the fixed drush 13 without adding any new deploy hook in that deployment, then run:
    drush deploy:mark-complete.
    Now the correct key value store knows about the hooks that were run with the wrong key value store. And you are good too.

@weitzman weitzman merged commit 997c8ca into drush-ops:13.x Aug 6, 2024
1 check 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.

Deploy hook registry is reset after update to Drush 13
4 participants