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

[REF] Add in function to retrieve Pre Upgrade messages in headless #25414

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

seamuslee001
Copy link
Contributor

Overview

This makes it possible for CLI tools such as drush and wp cli to get the pre-upgrade message when doing database upgrades

Before

No way to get the pre upgrade messages just post

After

function to get the pre-upgrade message

ping @demeritcowboy @kcristiano @totten

@civibot
Copy link

civibot bot commented Jan 25, 2023

(Standard links)

@civibot civibot bot added the master label Jan 25, 2023
@totten
Copy link
Member

totten commented Jan 25, 2023

civibot, test this please

@totten
Copy link
Member

totten commented Jan 25, 2023

Looks sensible. @seamuslee001 Are you working on a patch for a tool/entry-point that can be used to r-run it?

$upgrade->setPreUpgradeMessage($preUpgradeMessage, $currentVer, $latestVer);
if (empty($this->preUpgradeMessage)) {
$preUpgradeMessage = NULL;
$upgrade->setPreUpgradeMessage($preUpgradeMessage, $currentVer, $latestVer);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ug - this is a bit nasty that it is a pass-by-ref huh? Doesn't look like it is trivial to unravel though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is pass by reference

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, it's also a confusing name... but there are 3 distinct structures which include variations on this signature (CRM_Upgrade_Incremental_Base and its subclasses; then also CRM_Upgrade_Form; then also CRM_Upgrade_Incremental_General).

@seamuslee001
Copy link
Contributor Author

@totten see civicrm/civicrm-drupal#663 I plan to do one for wp-cli as well

@totten
Copy link
Member

totten commented Feb 1, 2023

Did an r-run using this PR and the accompanying drupal PR. It succeeded in get the pre-upgrade messages, so let's merge.

@totten
Copy link
Member

totten commented Feb 1, 2023

I pulled the merge trigger a bit hastily. Suggested revision: #25488

@eileenmcnaughton eileenmcnaughton deleted the headless_pre_upgrade branch February 1, 2023 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants