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

Tracking: Install themes and plugins directly from Git #1708

Closed
adamziel opened this issue Aug 27, 2024 · 6 comments
Closed

Tracking: Install themes and plugins directly from Git #1708

adamziel opened this issue Aug 27, 2024 · 6 comments
Labels
[Type] Enhancement New feature or request [Type] Mindmap Node [Type] Tracking Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@adamziel
Copy link
Collaborator

adamziel commented Aug 27, 2024

Let's support installing plugins and themes directly from git, e.g.:

  • Query API:
    • GitHub repo: https://playground.wordpress.net/?plugin=https://github.com/dmsnell/blocky-formats
    • GitLab repo: https://playground.wordpress.net/?plugin=https://gitlab.com/dmsnell/blocky-formats
    • Arbitrary git repo URL: [email protected]:dmsnell/blocky-formats.git
  • Blueprints API:
    • Resource shorthand: { "plugins": ["https://github.com/dmsnell/blocky-formats"] }
    • A full resource definition: { "plugins": [ {"resource": "git", "url": "[email protected]:dmsnell/blocky-formats.git" } ] }

A few other features that would be useful to support

  • Subdirectories: https://github.com/WordPress/playground-tools/tree/trunk/packages/wordpress-playground-block
  • Branches: https://github.com/WordPress/playground-tools/tree/my-sub-branch/packages/wordpress-playground-block
  • PRs: https://github.com/WordPress/playground-tools/pulls/1

We'll likely need to recognize the git service provider domain, and rewrite the provider-specific URL into a CORS proxied git URL behind the scenes.

CI artifacts are out of scope of this issue: https://github.com/WordPress/gutenberg/actions/runs/10575588549/artifacts/1858796776

Pre-requisites

Follow-up work

cc @jonathanbossenger

@adamziel
Copy link
Collaborator Author

adamziel commented Sep 9, 2024

Once this is in place, let's:

  • Update all the Blueprints in the community space to use direct checkout
  • Rewrite github-proxy.com references into direct checkout for any Blueprints we cannot go back and update

@adamziel adamziel moved this from Inbox to Project: Up soon in Playground Board Sep 11, 2024
@adamziel
Copy link
Collaborator Author

Once we have a good git -> Playground flow, let's look into #1709 to enable providing default configuration in the repo.

@jonathanbossenger
Copy link
Collaborator

@adamziel I see that there were some new docs added to the Playground docs today, and this caught my eye

https://wordpress.github.io/wordpress-playground/guides/for-plugin-developers#plugin-in-a-github-repository

I was not aware that it was possible to do it this way, and if it also works in the Playground block, it would solve my immediate need for Learn.WordPress.org usage. So if I test it and it works, I'm wondering if this work is still needed?

@asirota
Copy link

asirota commented Sep 26, 2024

Potentially a Public PHP CORS Proxy will be useful for other potential issues in plugins that call APIs that don't have CORS support. We already encountered this with the [WildApricot API](https://forums.wildapricot.com/forums/309658-developers/suggestions/9958881-api-implement-cors-for-cross-domain-api-requests)

@adamziel
Copy link
Collaborator Author

adamziel commented Oct 8, 2024

This can be marked as solved as soon as we deploy the PHP CORS proxy (#1467 cc @brandonpayton).

The git parts are provided by #1858 and #1860. The following Blueprint would install the blocky formats plugin:

{
	"$schema": "https://playground.wordpress.net/blueprint-schema.json",
	"login": true,
	"landingPage": "/wp-admin/",
    "steps": [
        {
            "step": "installPlugin",
            "pluginData": {
                "resource": "git:directory",
                "url": "https://github.com/dmsnell/blocky-formats.git",
                "ref": "trunk",
                "path": "/"
            }
        }
    ]
}

Note there is no Query API counterpart and there is no shorthand syntax such as {"plugins":["https://github.com/dmsnell/blocky-formats.git"]}. You need to explicitly type out the entire resource definition. I didn't find any developer-friendly, useful, and generalizable way of encoding the URL, ref, and path as a string. If you can think of one, let's discuss in #1793.

@adamziel
Copy link
Collaborator Author

Solved in #1793 now that CORS proxy is live on playground.wordpress.net for fetching git files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement New feature or request [Type] Mindmap Node [Type] Tracking Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
Archived in project
Development

No branches or pull requests

3 participants