Skip to content

Select plugin version prototype (Not meant to be merged)#345

Open
sandyfzu wants to merge 3 commits intodevelopfrom
select-version-prototype
Open

Select plugin version prototype (Not meant to be merged)#345
sandyfzu wants to merge 3 commits intodevelopfrom
select-version-prototype

Conversation

@sandyfzu
Copy link
Member

@sandyfzu sandyfzu commented Mar 3, 2026

Description

Fixes #6 and #315

This code uses https://github.com/wp-media/automation-plugin-version-manager to build plugins from Git refs (tags, branches, and commits). The repo is written in safe Rust but exposed to NodeJS JavaScript/TypeScript through napi.rs leveraging Rust safety from NodeJS with all TypeScript types defined.

This is just a test. If this approach is approved, we can find a better way of writing the code. I just used a BeforeAll hook to build plugins there using some environment variables, but we can change this if we think of a better approach.

To test this, just try the following:

For WP Rocket:

E2E_WPR_PREV=v3.20.4 E2E_WPR_NEW=v3.20.5 npm run test:e2e

For BackWPup:

E2E_WPR_BACKWPUP=5.6.5 npm run test:bwpup

Passing existing Git tags to the environment variables.

For private repositories like BackWPup, the method createWithTokenResolution will attempt to resolve any git/github authentication in the environment (SSH keys, Github tokens, etc)

Recording: https://jmp.sh/Kr4DZQVl

Type of change

  • New feature (non-breaking change which adds functionality).
  • Bug fix (non-breaking change which fixes an issue).
  • Enhancement (non-breaking change which improves an existing functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as before).
  • Sub-task of #(issue number)
  • Chore
  • Release

Detailed scenario

What was tested

Plugin building before E2E test.

How to test

Pass any gitref to the environment variables (tags, branches, or commits), the tool will build the plugins from there:

For WP Rocket:

E2E_WPR_PREV=v3.20.4 E2E_WPR_NEW=v3.20.5 npm run test:e2e

For BackWPup:

E2E_WPR_BACKWPUP=5.6.5 npm run test:bwpup

Affected Features & Quality Assurance Scope

N/A

Technical description

Documentation

Used APVM in a BeforeAll hook.

New dependencies

    "apvm-napi": "github:wp-media/automation-plugin-version-manager",

Risks

N/A

Mandatory Checklist

Code validation

N/A

Code style

N/A

Unticked items justification

N/A

@sandyfzu sandyfzu requested review from a team March 3, 2026 15:52
@sandyfzu sandyfzu self-assigned this Mar 3, 2026
Copilot AI review requested due to automatic review settings March 3, 2026 15:52
@sandyfzu sandyfzu added the enhancement New feature or request label Mar 3, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a prototype workflow to automatically build WP Rocket / BackWPup plugin ZIPs from Git refs at test startup (via APVM), so E2E runs can target specific versions without manually preparing plugin/*.zip files.

Changes:

  • Add a BeforeAll hook that builds plugin artifacts from env-provided git refs and writes them to the expected stable ZIP names in ./plugin/.
  • Add helper logic to build via apvm-napi and move the resulting artifact to a known path.
  • Add apvm-napi as a new dev dependency (with lockfile updates).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/support/hooks.ts Adds APVM-powered plugin build step in a global BeforeAll hook and a helper to move artifacts into plugin/ ZIP paths used by tests.
package.json Adds apvm-napi dependency to enable building plugins from Git refs during test runs.
package-lock.json Locks apvm-napi to a specific commit (currently via an SSH-resolved URL).

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

As a QA engineer, I want the plugin versions to be automatically handled so that I can easily run tests on a selected version

2 participants