-
Notifications
You must be signed in to change notification settings - Fork 30
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
DRUP-574 Simulate pagination if CPS is not enabled. #43
Conversation
CPS is not enabled on on-prem installations at this moment. apigee/apigee-edge-drupal#123
Codecov Report
@@ Coverage Diff @@
## 2.x #43 +/- ##
============================================
+ Coverage 91.49% 91.52% +0.02%
- Complexity 1545 1553 +8
============================================
Files 240 240
Lines 2999 3033 +34
============================================
+ Hits 2744 2776 +32
- Misses 255 257 +2
Continue to review full report at Codecov.
|
Tested it with private cloud build v4.19.01, worked as expected. Both client and Drupal 8 tests passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General thoughts:
-
Paging simulation: I am not sure if paging simulation will work on non CPS orgs. I thought I remember that items are not guaranteed to come back in same order. I sent an email to persons that can answer this and cc'd you @mxr576
-
I am not sure how the E_USER_NOTICE error surfaces in our Drupal modules. Just want to make sure this message is suppressed without extra user work since non CPS orgs are standard for private cloud users and probably will always be that way.
-
If a user is using this library against a non CPS org and not trying to use paging there shouldn't be any difference. If this is true, we could throw exception or error only when trying to use a pager on a nonCPS org (that could also be suppressed). This way we only expose that something may be behaving differently than expected in that very narrow case.
Since we should solve this ASAP, we can put this PR in now and look at this again if needed.
Based on @cnovak's suggestions.
@cnovak Thanks for the review, I could not commit your suggestion in one commit by using GH's new suggestions feature so I have to commit them in the usual way. Reacting to your comments:
|
Related: apigee/apigee-edge-drupal#123
This implementation keeps BC and also solves the reported issue. Because PHP API client applies a workaround, a shortcut with non-CPS enabled orgs, we should let developers know what happened. This is the reason why I choose to triegger an E_USER_NOTICE.
Introducing APIGEE_EDGE_PHP_CLIENT_SUPPRESS_CPS_SIMULATION_NOTICE environment variables seemed to be a good idea because at this moment E_NOTICE errors can not be suppressed if you are using Drupal, it does not matter what do you configure in the PHP ini.
https://www.drupal.org/project/drupal/issues/1267246
Latest test with real Apigee Edge connection: https://travis-ci.org/mxr576/apigee-client-php/builds/486860650