Add vip integration validate conformance checker#2978
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
vip validate integration conformance checker
1e0306a to
ff3ad26
Compare
| 'vip-validate': () => import( '../../bin/vip-validate' ), | ||
| 'vip-validate-integration': () => import( '../../bin/vip-validate-integration' ), |
There was a problem hiding this comment.
I would switch the order of the params. vip integration <command> since we might need init/configure in the future.
I also wonder if this should belong to the VIP-CLI or if we should have a dedicate tooling for the integrations, but that's probably ok to keep it here.
There was a problem hiding this comment.
I also wonder if this should belong to the VIP-CLI or if we should have a dedicate tooling for the integrations, but that's probably ok to keep it here.
I don't think it should be here TBH.
There was a problem hiding this comment.
I don't think it should be here TBH.
@rinatkhaziev like a separate CLI command, correct?
vip dev-env would still be something used (and useful) for a partner to test an integration, so it could make sense to bundle it here, instead of separating it in a separate CLI.
On the other hand, separating it would probably give us a little bit more freedom, but we'd consolidate less on the pre-existing codebase.
There was a problem hiding this comment.
@andrea-sdl I've flipped the command.
Regarding whether we should put the command here or create a separate package: both options have pros and cons. Let's discuss this, but we also have to keep moving with the SDK integration. So I will release this command with next tag instead of merging it to trunk. If we decide in the meantime that this command don't belong here, we will port the code away elsewhere.
Static checks that map the VIP integration conformance checklist to an objective pass/fail/warn/n-a verdict per rule, plus human-readable and JSON report rendering. Security review and the plugin/platform config-schema match stay in the human-review layer, never an automated pass.
Register the no-auth integration command and its validate subcommand, wire the bin entries and internal-bin loader, and gate CI with a non-zero exit when an integration is not conformant.
Cover conformant and non-conformant integrations, the load/test/config edge cases, and the report rendering.
ff3ad26 to
f87c5e9
Compare
vip validate integration conformance checkervip integration validate conformance checker
|
@andrea-sdl @pandah3 @rinatkhaziev Unless ya'll don't have an objection, I will proceed to merge it into |
andrea-sdl
left a comment
There was a problem hiding this comment.
Tested using the starter kit.
The only thing worth mentioning (which is more related to the starter kit) is that once I run composer setup -- --vendor="Acme" --name="Content Sync" in the starter kit, we fail the validation
Besides this, it looks good for me. I left some feedback inline, the only relevant is the latest behavior that might generate false positives.
Let's check in with @rinatkhaziev on merging it here vs in a separate repo.
node dist/bin/vip.js integration validate
Integration conformance check: vip-integrations-starter-kit
PASS Rule 1: Loads through the Starter Kit workflow
Plugin entry file and Composer wordpress-plugin package are present.
- Entry file: content-sync.php
- composer.json type is "wordpress-plugin" with an autoload section.
PASS Rule 2: `composer test` runs PHPUnit and e2e tests
composer test declares a PHPUnit run and an e2e runner (Playwright/Cypress).
- Resolved commands: phpunit • npm test • playwright test
- Static check: it verifies the test commands are wired, not that the tests pass.
PASS Rule 3: `composer run validate-integration` exists
composer.json defines a "validate-integration" script.
FAIL Rule 4: Config constant is documented and referenced in code
Config constant VIP_CONTENT_SYNC_CONFIG is used in code but not documented in README/docs.
PASS Rule 5: Missing/invalid config is handled without fataling
Config access is guarded against a missing or invalid constant.
- Guards found: is_ready(), missing_fields(), is_available(), defined() guard, is_array() guard
- Static signal only — behavioral proof comes from the integration's own tests (rule 2).
FAIL Rule 6: Docs include valid and incomplete config examples
No documented config example references VIP_CONTENT_SYNC_CONFIG.
PASS Rule 7: Compatibility evidence covers WP 6.9/7.0 and PHP 8.2-8.5
CI matrix covers WP 6.9 + 7.0 and PHP 8.2-8.5.
PASS Rule 8: Build and test commands are documented
Docs document both build/install and test commands.
PASS Rule 9: Telemetry uses the Starter Kit pattern (Tracks only, no secrets)
Telemetry uses the guarded VIP Tracks helper with no obvious secrets in properties.
Human review required (not automated):
• Plugin - platform config-schema match
Whether the plugin's expected config matches the platform schema is not fully deterministic and is confirmed in human review, not by this checker.
• Security review
Security posture (input handling, secret storage, capability checks) is assessed in human review, not by this checker.
Summary: 7 passed, 2 failed, 0 warnings, 0 n/a.
✗ Not conformant — one or more automated checks failed.
Skipping auth on any argv containing "integration" let a logged-out call like `vip @app.env -- wp option get integration` bypass the login prompt and fail. Gate the no-auth path on the absence of an app/env argument, mirroring dev-env.
The rule 7 check treated any `latest` token as WP 7.0 evidence, so a `runs-on: ubuntu-latest` runner label wrongly satisfied it. Match `latest` only when tied to a WordPress version key (e.g. `wp: latest`).
|
|
The But on another thought, the In any case, the fix will be in the starter kit repo. Not here. |
Adversarial Review:
|
|
Closing this PR in favour of Automattic/integration#1 |



Description
Adds
vip integration validate, a no-auth command that checks a WordPress VIP partner integration for conformance and returns an objective conformant / not-conformant verdict. A partner (or an internal team) will run it locally and in CI before submitting an integration.--format jsonfor machine-readable CI output; exits non-zero when an integration is not conformant.See
docs/integration-validate.mdfor the command reference and the full rule list.Changelog Description
Added
vip integration validate, a conformance checker for WordPress VIP partner integrations that runs locally and in CI and returns an objective conformant / not-conformant verdict.Pull request checklist
New release checklist
Steps to Test
npm run build../dist/bin/vip.js integration validateand make sure that it doesn't require auth../dist/bin/vip.js integration validate <path-to-an-integration>against a conformant integration and see the output.Tip💡: You can locally pull the
update/integration-contract-compliancebranch of the vip-integrations-starter-kit repo, and run the validator against it:./dist/bin/vip.js integration validate ~/automattic/vip-integrations-starter-kit.Sample Success Result
composer.jsonhas notestscript): confirm the relevant rule reportsFAILand the process exits non-zero (echo $?→1).Tip💡: Now checkout the
mainbranch of thevip-integrations-starter-kitrepo, and run the same command again.Sample Failure Result