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

Add Jetpack integration loader, add the way to load config in local dev env #6101

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

rinatkhaziev
Copy link
Contributor

@rinatkhaziev rinatkhaziev commented Jan 17, 2025

Description

There are two things happening:

Added JetpackIntegration class - very basic, but it does set up the version respecting both integrations or the legacy way.

Added ability to override config values via two filters:

apply_filters( 'vip_integrations_config_file_path', $config_file_path_orig, $slug );

This one allows us to override the file path in non-VIP environments (dev env/Codespaces)

apply_filters( 'vip_integrations_pre_load_config', null, $config_file_path, $slug );
Following core WP pattern, adding the pre_ filter will short-circuit the prod logic and will allow to inject the values as needed.

Changelog Description

Pre-review checklist

Please make sure the items below have been covered before requesting a review:

  • This change works and has been tested locally or in Codespaces (or has an appropriate fallback).
  • This change works and has been tested on a sandbox.
  • This change has relevant unit tests (if applicable).
  • This change uses a rollout method to ease with deployment (if applicable - especially for large scale actions that require writes).
  • This change has relevant documentation additions / updates (if applicable).
  • I've created a changelog description that aligns with the provided examples.

Pre-deploy checklist

  • VIP staff: Ensure any alerts added/updated conform to internal standards (see internal documentation).

Steps to Test

  1. Add integrations.json into the root of dev env project with the following content:
{
	"jetpack": {
		"status": "enabled",
		"config": {
			"version": "14.0"
		}
	},
	"parsely": {
		"status": "disabled",
		"config": {
			"apikey": "myexampledomain.test"
		}
	}
}
  1. In jetpack.php comment out the call to vip_jetpack_load
  2. Refresh a page and verify that Jetpack is indeed loaded.
  3. Flip the status and verify Jetpack is not loaded anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants