Skip to content

Commit

Permalink
Add Sensei to the allowed repositories for plugin proxy (#1079)
Browse files Browse the repository at this point in the history
It adds Sensei to the allowed repositories for plugin proxy.

## What problem is it solving?

Allow Sensei to use the plugin proxy, so it can be added to Sensei pull
requests. It's a better alternative to
Automattic/senseilms-com-plugins#305 because we
don't have an extra code and GitHub token to maintain.

## How is the problem addressed?

Plugin added to the allowed array.

## Testing Instructions

- Create a GitHub token with the "repo" scope checked for test.
- Add the token hard coded in the
`packages/playground/website/public/plugin-proxy.php`.
- Serve the `wordpress-playground/packages/playground/website/public`
with a PHP server.
- Request
`/plugin-proxy.php?org=Automattic&repo=sensei&workflow=Plugin%20Build&artifact=sensei-lms-bef4d18c802094cc0eaacc522eefdbac5bcbfa77&pr=7521`.
- Check that the request works properly.

## Pending

I still need to see how the PR previewer for Sensei will be. Originally,
I was implementing it in https://senseilms.com/playground/ to be used in
the PRs. But I still need to take a look now that we're adding the proxy
here. I think it will be just to use the playground.wordpress.com with
the plugin pointing to the proxy URL and send my blueprint as
querystring.
  • Loading branch information
renatho authored Mar 4, 2024
1 parent daeef68 commit 372ffa8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/playground/website/public/plugin-proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ function ($curl, $body) use (&$extra_headers_sent, $default_response_headers) {
'workflow' => 'Test Build Processes',
'artifact' => '#wordpress-build-\d+#'
],
[
'org' => 'Automattic',
'repo' => 'sensei',
'workflow' => 'Plugin Build',
'artifact' => '#sensei-lms-\w+#'
],
];
$allowed = false;
foreach ($allowedInputs as $allowedInput) {
Expand Down

0 comments on commit 372ffa8

Please sign in to comment.