-
Notifications
You must be signed in to change notification settings - Fork 826
Forms: Add integrations feature flag #45037
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
base: trunk
Are you sure you want to change the base?
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 4 files.
|
}; | ||
}, | ||
[ clientId ] | ||
); |
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.
If you are seeing a lot of changes here, try hiding white space on the diff. It's easier to read. We just remove canUserInstallPlugins here since we are using the feature flag instead of this permissions check.
@@ -755,7 +748,7 @@ function JetpackContactFormEdit( { name, attributes, setAttributes, clientId, cl | |||
/> | |||
</PanelBody> | |||
|
|||
{ ! isSimpleSite() && canUserInstallPlugins && ( | |||
{ showFormIntegrations && ( |
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.
The main change. We no longer check ifSimpleSite or check permissions. We just the feature flag. Any given environment (WordPress.com, CIAB, VIP) is now responsible for turning this off if needed.
* @var bool | ||
*/ | ||
public static $show_integrations = false; | ||
|
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.
We're just replacing this with the new, more general feature flag / filter.
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.
Worked well for me. Good call on the function name change.
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.
Working as expected
Proposed changes:
BEFORE MERGING: We should merge 191699-ghe-Automattic/wpcom, which adds
add_filter( 'jetpack_forms_enable-integrations', '__return_false' );
to WordPress.com. Otherwise as soon as this is merged, integrations will show there. I'd like to get this one merged to make testing the feature flag on WordPress.com easier as part of this PR.Introduces a form integrations feature flag. This defaults to true. Going forward, if any environment (like WordPress.com or VIP, CIAB) wants to hide integrations, they can use the new filter:
add_filter( 'jetpack_forms_is_integrations_enabled', '__return_false' );
Uses the new feature flag to determine if we show integrations in the form dashboard and form block (rather than checking other elements like isSimpleSite or canUserInstallPlugins).
Replaces a similar, existing feature flag in class-dashboard.php file. We need a flag plugin wide, not just in the dashboard.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
add_filter( 'jetpack_forms_is_integrations_enabled', '__return_false' );
, and confirm you no longer see our integrations interface in the forms dashboard or form block.