Directory

env :: support ssh protocol for github repos. by n3f · Pull Request #40451 · WordPress/gutenberg · GitHub
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

env :: support ssh protocol for github repos. #40451

Merged
merged 9 commits into from
May 16, 2022

Conversation

n3f
Copy link
Contributor

@n3f n3f commented Apr 19, 2022

Add support for ssh strings in the @wordpress/env package sources. (A similar issue was discussed in #20325).

What?

Adds URL parsing for ssh strings in env parse-config module (which returns a WP_Source object).

Why?

Git parsing only supported HTTP (until this PR), but fails to pull/clone authenticated projects.

How?

The git library already supports ssh; this change just implements parsing into a supported WP_Source.

Testing Instructions

  1. Add a ssh url to your wp-env enabled project. (e.g. ssh://git@github.com/some/plugin.git)
  2. Run <gutenberg-dir>/packages/env/bin/wp-env start
  3. Verify that your plugin was downloaded and enabled in the project.

@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @n3f! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Apr 19, 2022
@n3f n3f closed this Apr 20, 2022
@n3f n3f deleted the env/support-git-protocol branch April 20, 2022 00:37
@n3f n3f restored the env/support-git-protocol branch April 20, 2022 00:43
@n3f n3f reopened this Apr 20, 2022
@n3f n3f marked this pull request as ready for review April 21, 2022 06:19
@n3f n3f requested a review from noahtallen as a code owner April 21, 2022 06:19
@n3f n3f force-pushed the env/support-git-protocol branch from 27cec8c to 20cfaaf Compare April 21, 2022 15:55
@n3f n3f requested a review from noahtallen April 25, 2022 18:15
@n3f n3f force-pushed the env/support-git-protocol branch from 20cfaaf to c6ad9cc Compare April 25, 2022 18:15
Copy link
Member

@noahtallen noahtallen left a comment

Choose a reason for hiding this comment

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

This tests well for me!

I did notice one little weird thing, but it doesn't cause problems. I think the HTTPS clone is cloning directly to $wp_env_dir/wordpress, but the SSH clone went to $wp_env_dir/wordpress/wordpress. However, docker-compose still maps it correctly ($wp_env_path/WordPress/WordPress:/var/www/html), so it doesn't cause problems.

@noahtallen
Copy link
Member

Also, would you be able to update the Changelog file in packages/env with this new feature?

@skorasaurus skorasaurus added the [Package] Env /packages/env label May 5, 2022
@n3f n3f force-pushed the env/support-git-protocol branch from c6ad9cc to b54e4de Compare May 7, 2022 22:58
@n3f n3f requested a review from noahtallen May 7, 2022 22:58
@n3f
Copy link
Contributor Author

n3f commented May 7, 2022

Also, would you be able to update the Changelog file in packages/env with this new feature?

I'm not sure about my changelog entry 😆, I put today's date but not sure if that should be different or if everything else looks okay.

I'm not sure how merging occurs, since I don't have the permissions, I assume when it all looks good, you'll just push the button?

Copy link
Member

@noahtallen noahtallen left a comment

Choose a reason for hiding this comment

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

LGTM and still tests well. I think we need to tweak the changelog a bit, but after that I can hit the merge button. (I don't think I have write access to the branch, otherwise I'd update it myself and merge now!)

Apply suggestion

Co-authored-by: Noah Allen <noahtallen@gmail.com>
@n3f
Copy link
Contributor Author

n3f commented May 16, 2022

Accepted the suggestion (and added you as a contributor to my fork if anything else needs to be updated).

@noahtallen
Copy link
Member

Great, thanks! I'll merge once the tests finish :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Env /packages/env
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants