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

Don't put API calls in the upgrader #24364

Closed
wants to merge 4 commits into from
Closed

Conversation

totten
Copy link
Member

@totten totten commented Aug 24, 2022

n/t

@civibot
Copy link

civibot bot commented Aug 24, 2022

(Standard links)

@civibot civibot bot added the master label Aug 24, 2022
@demeritcowboy
Copy link
Contributor

In case the log disappears they're all this one in the stock preupgrade messages

$financialAclExtension = civicrm_api3('extension', 'get', ['key' => 'biz.jmaconsulting.financialaclreport', 'sequential' => 1]);

@colemanw
Copy link
Member

@totten FYI there was some work done last year to make APIv4 calls upgrade-safe, because it filters values by CRM_Core_DAO::getSupportedFields and that function only returns fields supported by the current version (even during an upgrade state).

@colemanw
Copy link
Member

retest this please

@demeritcowboy
Copy link
Contributor

Patch no longer applies. Github says yes, git says no. One of them is lying.

@totten totten force-pushed the master-upgrade branch 2 times, most recently from 9f1ffbe to d0b26d9 Compare March 3, 2023 04:18
@totten
Copy link
Member Author

totten commented Mar 3, 2023

@demeritcowboy @colemanw I've rebased, and... it does pass now... though it's slightly deceptive, because
this bit hides some failed assertions (and I don't really have my head around the range of errors that are properly or improperly captured there).

@demeritcowboy
Copy link
Contributor

I'm just wondering if it's too harsh to completely prevent it. For example one of them is just setting a setting, which ok could be a SQL query where you serialize it yourself, but it seems like the risks in using the function is low. Or some of them are ensureOptionValueExists(), which is intended to be used in upgrade scripts, so if that one's dangerous we should update that function.
But I suppose we could always grow the functionThatIsNotSupposedToGrow if it's decided a future given upgrade task could also be excluded.

@demeritcowboy
Copy link
Contributor

@totten What do you want to do with this one? Close for now as being too nuanced to be so strict?

@eileenmcnaughton
Copy link
Contributor

Since the last action here was to propose closing this in June I'm gonna do just that - I've opened a ticket to track it - https://lab.civicrm.org/dev/core/-/issues/4823

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.

4 participants