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

WordPress devhub blueprint #44

Open
carstingaxion opened this issue May 6, 2024 · 15 comments
Open

WordPress devhub blueprint #44

carstingaxion opened this issue May 6, 2024 · 15 comments
Labels
enhancement New feature or request

Comments

@carstingaxion
Copy link

I’d like to see (and maybe start working on) a blueprint that replicates the WordPress devhub for a custom plugin. As a real use-case I’d like to explore creating developer.gatherpress.org with the phpdoc-parser running against the plugin code of GatherPress.

@carstingaxion
Copy link
Author

carstingaxion commented May 6, 2024

Hello @dmsnell ,

did you explore this dmsnell/phpdoc-parser@bda7e06 any further?

I would like to know, how things went.
I’m sorry for pinging you like this and would appreciate if you could take a minute.

Thanks Carsten

@adamziel adamziel added the enhancement New feature or request label May 13, 2024
@adamziel
Copy link
Contributor

This would be lovely! I've heard a local setup can be quite challenging. Although that doesn't address the devhub issue, I have some early explorations going for a GitHub-based documentation site workflow: https://github.com/adamziel/playground-docs-workflow

@dmsnell
Copy link
Member

dmsnell commented May 15, 2024

@carstingaxion I haven't pushed that any further along, but would love some help!

@flexseth
Copy link

There is a GitHub token required - for Composer - to make the DevHub local setup work properly, otherwise this seems feasible and helpful!

question: What happens if there are manual steps needed for a blueprint to function? 🤯

@carstingaxion
Copy link
Author

This would be lovely! I've heard a local setup can be quite challenging.

You heard right. It’s not my first attempt and it is … challenging.

Although that doesn't address the devhub issue, I have some early explorations going for a GitHub-based documentation site workflow: https://github.com/adamziel/playground-docs-workflow

Yes this is indeed cool and could help, thank you @adamziel

Luckily this came already to my attention and is even more cool as it could help preparing a playground with the goal to create and manage demo content for a plugin or theme, that will be saved back to a given repo. I guess @ndiego is working on something similar and me too.

@carstingaxion
Copy link
Author

@carstingaxion I haven't pushed that any further along, but would love some help!

Thank you for stopping by @dmsnell and sorry for being that late with my reaction.

I started exploring the idea at https://github.com/carstingaxion/gatherpress-devhub, which currently has 2 branches. Getting the parser to run on the GatherPress code and within the playground worked … somehow and was the first branch.

The second branch houses the absolutely not pleasing experiments or hacks to get the theme running, which didn’t worked yet. Also, but not exclusively because of the composer token @flexseth mentioned. I struggled with that too.

@ndiego
Copy link
Member

ndiego commented May 31, 2024

Luckily this came already to my attention and is even more cool as it could help preparing a playground with the goal to create and manage demo content for a plugin or theme, that will be saved back to a given repo. I guess @ndiego is working on something similar and me too.

I imagine a world where most WordPress developers have their own little collection of blueprints that suit their specific needs.

@carstingaxion
Copy link
Author

I imagine a world where most WordPress developers have their own little collection of blueprints that suit their specific needs.

I imagine a world where most WordPress developers share a common collection of blueprints that suits typical needs.

@carstingaxion
Copy link
Author

Making a well-known, nice designed and well structured documentation (website) available to every plugin author with the help of playground could be our take on number 5 of @m|s birthday opinions.

Every plugin and theme should have all the infrastructure that we use to build WordPress itself—version control, bug trackers, forums, documentation, internationalization, chat rooms, P2, and easy pathways for contribution and community. We shouldn’t be uploading ZIPs in 2024!

@carstingaxion
Copy link
Author

Now that I‘ve found your installation error description @flexseth and the solution to that directly next door in an open issue, I can and will go on moving this forward.

@flexseth
Copy link

flexseth commented Aug 15, 2024

@carstingaxion - FWIW, the issue I think stems from some type of propagation with GitHub's tokens needed to boot up DevHub. Following the given instructions (at least when I last tried) for the DevHub setup, you will get an error if you attempt to boot up the environment immediately after completing the steps.

However, if you wait about 10 minutes or so, it seems to work as expected when attempting to boot.

That said, I don't know that it's possible, without putting some type of timeout in the blueprint.

Here's how that might can work:

  1. Create the blueprint based on existing instructions, except do not boot the environment
  2. Throw an alert that the user needs to wait for the token to propagate
  3. Add a step to set a timer in PHP for 10 minutes
  4. Run the final step to boot up the environment via shell
  5. Go to WP Admin (an onboarding screen might be very helpful)

Testing your blueprint

In order to test if the blueprint is working correctly working, you'd need to delete the token before trying to run again?

Awesome idea!!

@carstingaxion
Copy link
Author

Wow. Thank you very much for your detailed answer @flexseth !

I will go through your ideas and give it a try.

Today I just skipped the whole build process and used the final built repos, which works fine, but for sure is not a good place to start contributing from as you wanted.

If you don't worry about 180sec TTFB, have a look: https://playground.wordpress.net/builder/builder.html?blueprint-url=https://raw.githubusercontent.com/carstingaxion/gatherpress-devhub/WIP/use-build-deps/blueprint.json

@flexseth
Copy link

@carstingaxion - wow I didn't even think to use the full build, will look into that. Thanks for the blueprint, saving for later!

@carstingaxion
Copy link
Author

@flexseth: wow I didn't even think to use the full build, will look into that. Thanks for the blueprint, saving for later!

I took it one step further by additionally using Playgrounds Export & Import as .zip-feature.

This brought the TTFB down to approx. 3 seconds. And because this is not any website, but a code-reference. it would be totally ok to run all of this as a workflow once per release. Export & Upload are done manually for now, but this could easily be done by the Github action workflow as well.

This is getting closer to something useful, give it a try: https://playground.wordpress.net/?mode=seamless&blueprint-url=https://raw.githubusercontent.com/carstingaxion/gatherpress-devhub/WIP/use-build-deps/blueprint-import.json

@flexseth
Copy link

@carstingaxion - If you could simplify the blueprint to just load up DevHub and the necessary requirements to work in that environment, that might be helpful as part of the Blueprints Gallery

Make post

Following for the final product!

@adamziel adamziel moved this from Inbox to Needs review in Playground Board Sep 16, 2024
@adamziel adamziel moved this from Needs review to Inbox in Playground Board Sep 16, 2024
@adamziel adamziel removed the status in Playground Board Sep 25, 2024
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

No branches or pull requests

5 participants