-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove unused code in Zendesk utils #22651
Conversation
This code includes specific WP.com plan names, which we should avoid hard-coding since they can change.
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
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.
👍 Thanks. Yes, method such as getHighestPriorityPlan
are no longer used sinceZendeskUtils
now uses getZendeskMetadata
to fetch plan data dynamically.
There's still ZendeskUtilsPlans
(ZendeskUtlsTests+Plans.swift) file that use hardcoded plan names for testing, although I think one generic test would be enough instead of having a test for each hardcoded plan name. Tests simply validate that hardcoded plan names in MockPlanServiceRemote
get set in customFields
.
Good catch, I forgot about the tests. I'd enabled auto-merge, so this PR got merged already. I have this change ready to clean up the tests file:
I could put it in a separate PR, but will wait to do some more clean-up later of plan names later on. For example, there's a "business" plan name in an error message during the AT process when installing a plugin. As noted in the link above, this could be renamed to be future-proof against plan name changes, such as "plugin-enabled plan". |
This code includes specific WP.com plan names, which we should avoid hard-coding since they can change.
This came up because when WP.com plan names changed, this unused code was found in a search for hard-coded plan names: pcNC1U-WN-p2#comment-1198
To test: Verify the code builds.
Regression Notes
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: Not applicable