Skip to content

Commit

Permalink
Merge pull request #254 from dxw/chore/do-not-use-old-endpoints
Browse files Browse the repository at this point in the history
Chore/do not use old endpoints
  • Loading branch information
snim2 authored Oct 25, 2024
2 parents 0e7063b + ae6671f commit 4d418c1
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 57 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Changed
- Use current dxw Git URIs for documentation and tests

## [v2.5.0] - 2024-07-24

### Added
Expand Down
8 changes: 4 additions & 4 deletions docs/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Manually edit the `whippet.json` file to add an entry to the "plugins" section f
```
{
"src": {
"plugins": "git@git.govpress.com:wordpress-plugins/",
"themes": "git@git.govpress.com:wordpress-themes/"
"plugins": "git@github.com:dxw-wordpress-plugins/",
"themes": "git@github.com:dxw/"
},
"plugins": [
{"name": "akismet"}
Expand All @@ -40,8 +40,8 @@ And you want to add a plugin called "Foo", you would edit it to look like this:
```
{
"src": {
"plugins": "git@git.govpress.com:wordpress-plugins/",
"themes": "git@git.govpress.com:wordpress-themes/"
"plugins": "git@github.com:dxw-wordpress-plugins/",
"themes": "git@github.com:dxw/"
},
"plugins": [
{"name": "akismet"},
Expand Down
8 changes: 4 additions & 4 deletions docs/themesandplugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ To manage plugins and themes using Whippet, you make entries in the `whippet.jso

The file should specify a source for plugins and themes. The source should be a base url for a git repo.

If you are a dxw customer, the source will be `git@git.govpress.com:wordpress-plugins/`. If not, we suggest using `https://github.com/wp-plugins` for plugins.
If you are a dxw customer, the source will be `git@github.com:dxw-wordpress-plugins/`. If not, we suggest using `https://github.com/wp-plugins` for plugins.

The rest of the file should specify plugins and themes that you want to install. Example:

```
{
"src": {
"plugins": "git@git.govpress.com:wordpress-plugins/",
"themes": "git@git.govpress.com:wordpress-themes/"
"plugins": "git@github.com:dxw-wordpress-plugins/",
"themes": "git@github.com:dxw/"
},
"plugins": [
{"name": "akismet"}
Expand All @@ -30,7 +30,7 @@ The rest of the file should specify plugins and themes that you want to install.
The `{"name": "akismet"}` instructs Whippet (on request) to install the most recent version of Akismet available in the repo. Whippet will determine a valid repo URL for the akismet plugin by appending the name to the source. In this example:

```
git@git.govpress.com:wordpress-plugins/akismet
git@github.com:dxw-wordpress-plugins/akismet
```

You can also specify a particular label or branch that you want to use. Generally, this will either be master (the default) or a tag (for a specific version), but you can use any git reference. So you can do:
Expand Down
14 changes: 7 additions & 7 deletions spec/dependencies/validator.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
it('returns an error', function () {
$whippetContents = '{
"src": {
"plugins": "git@git.govpress.com:wordpress-plugins/"
"plugins": "git@github.com:dxw-wordpress-plugins/"
},
"plugins": [
{"name": "akismet"},
Expand All @@ -77,7 +77,7 @@
it('returns an error', function () {
$whippetContents = '{
"src": {
"plugins": "git@git.govpress.com:wordpress-plugins/"
"plugins": "git@github.com:dxw-wordpress-plugins/"
},
"plugins": [
{"name": "akismet"},
Expand Down Expand Up @@ -110,7 +110,7 @@
it('returns an error', function () {
$whippetContents = '{
"src": {
"plugins": "git@git.govpress.com:wordpress-plugins/"
"plugins": "git@github.com:dxw-wordpress-plugins/"
},
"plugins": [
{"name": "akismet"},
Expand Down Expand Up @@ -146,7 +146,7 @@
it('returns an error', function () {
$whippetContents = '{
"src": {
"plugins": "git@git.govpress.com:wordpress-plugins/"
"plugins": "git@github.com:dxw-wordpress-plugins/"
},
"plugins": [
{"name": "akismet"},
Expand Down Expand Up @@ -185,7 +185,7 @@
it('returns an error', function () {
$whippetContents = '{
"src": {
"plugins": "git@git.govpress.com:wordpress-plugins/"
"plugins": "git@github.com:dxw-wordpress-plugins/"
},
"plugins": [
{"name": "akismet", "ref": "v1"},
Expand Down Expand Up @@ -229,7 +229,7 @@
it('returns an ok result', function () {
$whippetContents = '{
"src": {
"plugins": "git@git.govpress.com:wordpress-plugins/"
"plugins": "git@github.com:dxw-wordpress-plugins/"
},
"plugins": [
{"name": "akismet", "ref": "v1"},
Expand Down Expand Up @@ -273,7 +273,7 @@
it('returns an ok result', function () {
$whippetContents = '{
"src": {
"plugins": "git@git.govpress.com:wordpress-plugins/"
"plugins": "git@github.com:dxw-wordpress-plugins/"
},
"plugins": [
{"name": "akismet"},
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/Helpers/ManifestIo.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function load_plugins_manifest()

if ($plugin == 'source') {
if (empty($data)) {
echo "Source is empty. It should just specify a repo root:\n\n source = 'git@git.govpress.com:wordpress-plugins/'\n\nWhippet will attempt to find a source for your plugins by appending the plugin name to this URL.";
echo "Source is empty. It should just specify a repo root:\n\n source = 'git@github.com:dxw-wordpress-plugins/'\n\nWhippet will attempt to find a source for your plugins by appending the plugin name to this URL.";
exit(1);
}

Expand Down
28 changes: 14 additions & 14 deletions tests/dependencies/installer_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public function testInstallAll()

$my_plugin = [
'name' => 'my-plugin',
'src' => 'git@git.govpress.com:wordpress-plugins/my-plugin',
'src' => 'git@github.com:dxw-wordpress-plugins/my-plugin',
'revision' => '123456',
];

$another_plugin = [
'name' => 'another-plugin',
'src' => 'git@git.govpress.com:wordpress-plugins/another-plugin',
'src' => 'git@github.com:dxw-wordpress-plugins/another-plugin',
'revision' => '789abc',
];

Expand All @@ -46,9 +46,9 @@ public function testInstallAll()

$gitMyTheme = $this->getGit(false, 'git@git.govpress.com:wordpress-themes/my-theme', '27ba906');
$this->addFactoryNewInstance('\\Dxw\\Whippet\\Git\\Git', $dir.'/wp-content/themes/my-theme', $gitMyTheme);
$gitMyPlugin = $this->getGit(false, 'git@git.govpress.com:wordpress-plugins/my-plugin', '123456');
$gitMyPlugin = $this->getGit(false, 'git@github.com:dxw-wordpress-plugins/my-plugin', '123456');
$this->addFactoryNewInstance('\\Dxw\\Whippet\\Git\\Git', $dir.'/wp-content/plugins/my-plugin', $gitMyPlugin);
$gitAnotherPlugin = $this->getGit(false, 'git@git.govpress.com:wordpress-plugins/another-plugin', '789abc');
$gitAnotherPlugin = $this->getGit(false, 'git@github.com:dxw-wordpress-plugins/another-plugin', '789abc');
$this->addFactoryNewInstance('\\Dxw\\Whippet\\Git\\Git', $dir.'/wp-content/plugins/another-plugin', $gitAnotherPlugin);

$inspection_check_results = function ($type, $dep) {
Expand Down Expand Up @@ -115,7 +115,7 @@ public function testInspectionsApiUnavailable()

$my_plugin = [
'name' => 'my-plugin',
'src' => 'git@git.govpress.com:wordpress-plugins/my-plugin',
'src' => 'git@github.com:dxw-wordpress-plugins/my-plugin',
'revision' => '123456',
];

Expand All @@ -127,7 +127,7 @@ public function testInspectionsApiUnavailable()
]);
$this->addFactoryCallStatic('\\Dxw\\Whippet\\Files\\WhippetLock', 'fromFile', $dir.'/whippet.lock', \Result\Result::ok($whippetLock));

$gitMyPlugin = $this->getGit(false, 'git@git.govpress.com:wordpress-plugins/my-plugin', '123456');
$gitMyPlugin = $this->getGit(false, 'git@github.com:dxw-wordpress-plugins/my-plugin', '123456');
$this->addFactoryNewInstance('\\Dxw\\Whippet\\Git\\Git', $dir.'/wp-content/plugins/my-plugin', $gitMyPlugin);

$inspection_check_results = function ($type, $dep) {
Expand Down Expand Up @@ -438,12 +438,12 @@ public function testInstallSingle()
'plugins' => [
[
'name' => 'my-plugin',
'src' => 'git@git.govpress.com:wordpress-plugins/my-plugin',
'src' => 'git@github.com:dxw-wordpress-plugins/my-plugin',
'revision' => '123456',
],
[
'name' => 'another-plugin',
'src' => 'git@git.govpress.com:wordpress-plugins/another-plugin',
'src' => 'git@github.com:dxw-wordpress-plugins/another-plugin',
'revision' => '789abc',
],
],
Expand Down Expand Up @@ -499,19 +499,19 @@ public function testInstallSingleAlreadyCloned()
'plugins' => [
[
'name' => 'my-plugin',
'src' => 'git@git.govpress.com:wordpress-plugins/my-plugin',
'src' => 'git@github.com:dxw-wordpress-plugins/my-plugin',
'revision' => '123456',
],
[
'name' => 'another-plugin',
'src' => 'git@git.govpress.com:wordpress-plugins/another-plugin',
'src' => 'git@github.com:dxw-wordpress-plugins/another-plugin',
'revision' => '789abc',
],
],
]);
$this->addFactoryCallStatic('\\Dxw\\Whippet\\Files\\WhippetLock', 'fromFile', $dir.'/whippet.lock', \Result\Result::ok($whippetLock));

$gitMyPlugin = $this->getGit(false, 'git@git.govpress.com:wordpress-plugins/my-plugin', '123456');
$gitMyPlugin = $this->getGit(false, 'git@github.com:dxw-wordpress-plugins/my-plugin', '123456');
$this->addFactoryNewInstance('\\Dxw\\Whippet\\Git\\Git', $dir.'/wp-content/plugins/my-plugin', $gitMyPlugin);

$dependencies = new \Dxw\Whippet\Dependencies\Installer(
Expand Down Expand Up @@ -544,19 +544,19 @@ public function testInstallSingleAlreadyClonedAndArchived()
'plugins' => [
[
'name' => 'my-plugin',
'src' => 'git@git.govpress.com:wordpress-plugins/my-plugin',
'src' => 'git@github.com:dxw-wordpress-plugins/my-plugin',
'revision' => '123456',
],
[
'name' => 'another-plugin',
'src' => 'git@git.govpress.com:wordpress-plugins/another-plugin',
'src' => 'git@github.com:dxw-wordpress-plugins/another-plugin',
'revision' => '789abc',
],
],
]);
$this->addFactoryCallStatic('\\Dxw\\Whippet\\Files\\WhippetLock', 'fromFile', $dir.'/whippet.lock', \Result\Result::ok($whippetLock));

$gitMyPlugin = $this->getGit(false, 'git@git.govpress.com:wordpress-plugins/my-plugin', '123456', true);
$gitMyPlugin = $this->getGit(false, 'git@github.com:dxw-wordpress-plugins/my-plugin', '123456', true);
$this->addFactoryNewInstance('\\Dxw\\Whippet\\Git\\Git', $dir.'/wp-content/plugins/my-plugin', $gitMyPlugin);

$dependencies = new \Dxw\Whippet\Dependencies\Installer(
Expand Down
Loading

0 comments on commit 4d418c1

Please sign in to comment.