@automattic/vip 2.20.0 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,30 +1,43 @@
1
1
  ## Changelog
2
2
 
3
- ### 2.20.0 (23 Sep 2022)
4
-
5
- - #1121 Add support for custom PHP images
6
- - #1136 SQL Import: Add validation for unique_checks being disabled
7
- - #1131 SQL Import - Add ALTER TABLE statement validation
8
- - #1134 [dev-env] add app and env to tracks when creating env
9
- - #1135 [dev-env] Make xdebug config not break during wp update
10
- - #1098 Include options into reading software config
11
- - #1114 [dev-env] Verify current user is a docker user
12
- - #1130 Update/exec help
13
- - #1125 add validation output
14
- - #1127 Run wp-cli as www-data
15
- - #1120 Update php-fpm image names
16
- - #1126 Update memcached to 1.6-alpine3.16
17
- - #1124 [dev-env] Supress Setup wizard during update
18
- - #1111 [dev-env] prompt for es index after db import
19
- - #1119 Use --yes instead of --force
3
+ ### 2.21.0 (24 Oct 2022)
4
+
5
+ - #1143 [dev-env] adds default for wordpress version prompt
6
+ - #1146 fix(dev-env): Resolve the "xdebugConfig is not defined" issue
7
+ - #1142 Update Slack channel on which to (optionally) ping before release
8
+ - #1144 fix: Suppress ES security-related warnings
9
+ - #1132 [PIE-3105] Update VIP-CLI command line output
10
+ - #1118 Remove unused confirmation prompt during sql import
11
+ - #1137 [dev-env] simplify and rename elasticsearch service config
12
+ - #1138 [dev-env] Update/rename app code and mu-plugins
13
+
14
+ ### 2.20.0 (19 Oct 2022)
15
+
16
+ - #1121 Add support for custom PHP images
17
+ - #1136 SQL Import: Add validation for unique_checks being disabled
18
+ - #1131 SQL Import - Add ALTER TABLE statement validation
19
+ - #1134 [dev-env] add app and env to tracks when creating env
20
+ - #1135 [dev-env] Make xdebug config not break during wp update
21
+ - #1098 Include options into reading software config
22
+ - #1114 [dev-env] Verify current user is a docker user
23
+ - #1130 Update/exec help
24
+ - #1125 add validation output
25
+ - #1127 Run wp-cli as www-data
26
+ - #1120 Update php-fpm image names
27
+ - #1126 Update memcached to 1.6-alpine3.16
28
+ - #1124 [dev-env] Supress Setup wizard during update
29
+ - #1111 [dev-env] prompt for es index after db import
30
+ - #1119 Use --yes instead of --force
20
31
  - #1115 [dev-env] reclasify most common error
21
- - #1122 [dev-env] support xdebug_config environment variable
32
+ - #1122 [dev-env] support xdebug_config environment variable
22
33
  - #1129 Fix ESLint/Flow/SonarScan issues
23
34
  - #1133 Add PHP 8.2 image
24
35
  - #1141 SQL validation: Change formatting to make it more readable
25
36
 
37
+ https://github.com/Automattic/vip-cli/releases/tag/v2.20.0
38
+
26
39
  ### 2.19.2 (23 Sep 2022)
27
- - #1116 Reverted #1049 changes
40
+ - #1116 Reverted #1049 changes
28
41
 
29
42
  ### 2.19.0 (23 Sep 2022)
30
43
  - #1108 [dev-env] Validate import file and add debug lines
package/CONTRIBUTING.md CHANGED
@@ -50,7 +50,7 @@ Our release flow for VIP CLI follows this pattern:
50
50
  - This is a public repository. Please do not include any internal links in PRs, changelogs, testing instructions, etc.
51
51
  - Merge changes from your feature branch to the `develop` branch
52
52
  - If you are ready to release your changes publicly, merge your changes from the `develop` branch to the `master` branch. All changes that are not ready to be public should be feature flagged or stay in the `develop` branch to avoid conflicts when releasing urgent fixes (not recommended).
53
- - Finally, release your changes as a new minor or major NPM version. Ping in the #vip-platform-patisserie channel to notify folks of a new release, but please feel free to release your changes without any blockers from the team. Any team member that is part of the Automattic NPM organization can release a new version; if you aren't a member, generic credentials are available in the Secret Store.
53
+ - Finally, release your changes as a new minor or major NPM version. Ping in the #vip-platform channel to notify folks of a new release, but please feel free to release your changes without any blockers from the team. Any team member that is part of the Automattic NPM organization can release a new version; if you aren't a member, generic credentials are available in the Secret Store.
54
54
 
55
55
  ### Changelogs
56
56
  Changelogs allow customers to keep up with all the changes happening across our VIP Platform. Changelogs for VIP CLI are posted to the [VIP Cloud Changelog P2](https://wpvipchangelog.wordpress.com/), along with the repository’s `README.md`.
@@ -14,7 +14,7 @@ services:
14
14
  devtools:
15
15
  type: compose
16
16
  services:
17
- image: ghcr.io/automattic/vip-container-images/dev-tools:0.8
17
+ image: ghcr.io/automattic/vip-container-images/dev-tools:0.9
18
18
  command: sleep infinity
19
19
  volumes:
20
20
  - devtools:/dev-tools
@@ -92,11 +92,11 @@ services:
92
92
  environment:
93
93
  UPLOAD_LIMIT: 4G
94
94
  <% } %>
95
- <% if ( elasticsearchEnabled ) { %>
96
- vip-search:
95
+ <% if ( elasticsearch ) { %>
96
+ elasticsearch:
97
97
  type: compose
98
98
  services:
99
- image: elasticsearch:<%= elasticsearch %>
99
+ image: elasticsearch:7.17.2
100
100
  command: /usr/local/bin/docker-entrypoint.sh
101
101
  environment:
102
102
  ELASTICSEARCH_IS_DEDICATED_NODE: 'no'
@@ -104,6 +104,7 @@ services:
104
104
  ELASTICSEARCH_NODE_NAME: 'lando'
105
105
  ELASTICSEARCH_PORT_NUMBER: 9200
106
106
  discovery.type: 'single-node'
107
+ xpack.security.enabled: 'false'
107
108
  ports:
108
109
  - ":9200"
109
110
  volumes:
@@ -133,7 +134,7 @@ services:
133
134
  nocopy: true
134
135
 
135
136
  <% if ( muPlugins.mode == 'image' ) { %>
136
- mu-plugins:
137
+ vip-mu-plugins:
137
138
  type: compose
138
139
  services:
139
140
  image: ghcr.io/automattic/vip-container-images/mu-plugins:0.1
@@ -150,7 +151,7 @@ services:
150
151
  <% } %>
151
152
 
152
153
  <% if ( appCode.mode == 'image' ) { %>
153
- client-code:
154
+ demo-app-code:
154
155
  type: compose
155
156
  services:
156
157
  image: ghcr.io/automattic/vip-container-images/skeleton:latest
@@ -62,7 +62,6 @@ cmd.argv(process.argv, async (arg, opt) => {
62
62
  appCode: currentInstanceData.appCode.dir || currentInstanceData.appCode.tag || 'latest',
63
63
  muPlugins: currentInstanceData.muPlugins.dir || currentInstanceData.muPlugins.tag || 'latest',
64
64
  wordpress: currentInstanceData.wordpress.tag,
65
- elasticsearchEnabled: currentInstanceData.elasticsearchEnabled,
66
65
  elasticsearch: currentInstanceData.elasticsearch,
67
66
  php: currentInstanceData.php || _devEnvironment.DEV_ENVIRONMENT_PHP_VERSIONS.default,
68
67
  mariadb: currentInstanceData.mariadb,
@@ -362,9 +362,7 @@ const displayPlaybook = ({
362
362
  appQuery,
363
363
  envContext: true,
364
364
  requiredArgs: 1,
365
- module: 'import-sql',
366
- requireConfirm: 'Are you sure you want to import the contents of the provided SQL file?',
367
- skipConfirmPrompt: true
365
+ module: 'import-sql'
368
366
  }).command('status', 'Check the status of the current running import').option('skip-validate', 'Do not perform pre-upload file validation. If unsupported entries are present, the import is likely to fail').option('search-replace', 'Perform Search and Replace on the specified SQL file').option('in-place', 'Search and Replace explicitly on the given input file').option('output', 'Specify the replacement output file for Search and Replace', 'process.stdout').examples(examples).argv(process.argv, async (arg, opts) => {
369
367
  var _env$primaryDomain;
370
368
 
package/dist/bin/vip.js CHANGED
@@ -65,22 +65,21 @@ const rootCmd = async function () {
65
65
  runCmd();
66
66
  } else {
67
67
  console.log();
68
- console.log(' Welcome to');
69
68
  console.log(' _ __ ________ ________ ____');
70
- console.log(' | | / // _/ __ \ / ____/ / / _/');
69
+ console.log(' | | / // _/ __ / ____/ / / _/');
71
70
  console.log(' | | / / / // /_/ /______/ / / / / / ');
72
71
  console.log(' | |/ /_/ // ____//_____/ /___/ /____/ / ');
73
- console.log(' |___//___/_/ \____/_____/___/ ');
72
+ console.log(' |___//___/_/ ____/_____/___/ ');
74
73
  console.log();
75
- console.log(' VIP CLI is your tool for interacting with and managing your VIP applications.');
74
+ console.log(' VIP-CLI is your tool for interacting with and managing your VIP applications.');
76
75
  console.log();
77
- console.log(` To get started, we need an access token for your VIP account. We'll open ${tokenURL} in your web browser; follow the instructions there to continue.`);
76
+ console.log(' Authenticate your installation of VIP-CLI with your Personal Access Token. This URL will be opened in your web browser automatically so that you can retrieve your token: ' + tokenURL);
78
77
  console.log();
79
78
  await (0, _tracker.trackEvent)('login_command_execute');
80
79
  const answer = await (0, _enquirer.prompt)({
81
80
  type: 'confirm',
82
81
  name: 'continue',
83
- message: 'Ready?'
82
+ message: 'Ready to authenticate?'
84
83
  });
85
84
 
86
85
  if (!answer.continue) {
@@ -11,7 +11,6 @@ exports.DEV_ENVIRONMENT_FULL_COMMAND = DEV_ENVIRONMENT_FULL_COMMAND;
11
11
  const DEV_ENVIRONMENT_DEFAULTS = {
12
12
  title: 'VIP Dev',
13
13
  multisite: false,
14
- elasticsearchVersion: '7.17.2',
15
14
  mariadbVersion: '10.3',
16
15
  phpVersion: '8.0'
17
16
  };
@@ -270,8 +270,7 @@ async function promptForArguments(preselectedOptions, defaultOptions, supressPro
270
270
  const instanceData = {
271
271
  wpTitle: preselectedOptions.title || (await promptForText('WordPress site title', defaultOptions.title || _devEnvironment.DEV_ENVIRONMENT_DEFAULTS.title)),
272
272
  multisite: 'multisite' in preselectedOptions ? preselectedOptions.multisite : await promptForBoolean(multisiteText, !!multisiteDefault),
273
- elasticsearchEnabled: false,
274
- elasticsearch: preselectedOptions.elasticsearch || defaultOptions.elasticsearch || _devEnvironment.DEV_ENVIRONMENT_DEFAULTS.elasticsearchVersion,
273
+ elasticsearch: false,
275
274
  php: preselectedOptions.php ? resolvePhpVersion(preselectedOptions.php) : await promptForPhpVersion(resolvePhpVersion(defaultOptions.php || _devEnvironment.DEV_ENVIRONMENT_DEFAULTS.phpVersion)),
276
275
  mariadb: preselectedOptions.mariadb || defaultOptions.mariadb || _devEnvironment.DEV_ENVIRONMENT_DEFAULTS.mariadbVersion,
277
276
  mediaRedirectDomain: preselectedOptions.mediaRedirectDomain || '',
@@ -323,12 +322,12 @@ async function promptForArguments(preselectedOptions, defaultOptions, supressPro
323
322
  debug(`Processing elasticsearch with preselected "${preselectedOptions.elasticsearch}"`);
324
323
 
325
324
  if ('elasticsearch' in preselectedOptions) {
326
- instanceData.elasticsearchEnabled = !!preselectedOptions.elasticsearch;
325
+ instanceData.elasticsearch = !!preselectedOptions.elasticsearch;
327
326
  } else {
328
- instanceData.elasticsearchEnabled = await promptForBoolean('Enable Elasticsearch (needed by Enterprise Search)?', defaultOptions.elasticsearchEnabled);
327
+ instanceData.elasticsearch = await promptForBoolean('Enable Elasticsearch (needed by Enterprise Search)?', defaultOptions.elasticsearch);
329
328
  }
330
329
 
331
- if (instanceData.elasticsearchEnabled) {
330
+ if (instanceData.elasticsearch) {
332
331
  instanceData.statsd = preselectedOptions.statsd || defaultOptions.statsd || false;
333
332
  } else {
334
333
  instanceData.statsd = false;
@@ -559,7 +558,8 @@ async function promptForComponent(component, allowLocal, defaultObject) {
559
558
  const tagChoices = await getTagChoices();
560
559
  const selectTag = new _enquirer.Select({
561
560
  message,
562
- choices: tagChoices
561
+ choices: tagChoices,
562
+ initial: (defaultObject === null || defaultObject === void 0 ? void 0 : defaultObject.tag) || ''
563
563
  });
564
564
  const option = await selectTag.run();
565
565
  return {
@@ -587,11 +587,7 @@ function processBooleanOption(value) {
587
587
  }
588
588
 
589
589
  function addDevEnvConfigurationOptions(command) {
590
- return command.option('wordpress', 'Use a specific WordPress version').option(['u', 'mu-plugins'], 'Use a specific mu-plugins changeset or local directory').option('app-code', 'Use the application code from a local directory or use "demo" for VIP skeleton code').option('statsd', 'Enable statsd component. By default it is disabled', undefined, processBooleanOption).option('phpmyadmin', 'Enable PHPMyAdmin component. By default it is disabled', undefined, processBooleanOption).option('xdebug', 'Enable XDebug. By default it is disabled', undefined, processBooleanOption).option('xdebug_config', 'Extra configuration to pass to xdebug via XDEBUG_CONFIG environment variable').option('elasticsearch', 'Explicitly choose Elasticsearch version to use or false to disable it', undefined, value => {
591
- var _value$toLowerCase2;
592
-
593
- return FALSE_OPTIONS.includes(value === null || value === void 0 ? void 0 : (_value$toLowerCase2 = value.toLowerCase) === null || _value$toLowerCase2 === void 0 ? void 0 : _value$toLowerCase2.call(value)) ? false : value;
594
- }).option('mariadb', 'Explicitly choose MariaDB version to use').option(['r', 'media-redirect-domain'], 'Domain to redirect for missing media files. This can be used to still have images without the need to import them locally.').option('php', 'Explicitly choose PHP version to use');
590
+ return command.option('wordpress', 'Use a specific WordPress version').option(['u', 'mu-plugins'], 'Use a specific mu-plugins changeset or local directory').option('app-code', 'Use the application code from a local directory or use "demo" for VIP skeleton code').option('statsd', 'Enable statsd component. By default it is disabled', undefined, processBooleanOption).option('phpmyadmin', 'Enable PHPMyAdmin component. By default it is disabled', undefined, processBooleanOption).option('xdebug', 'Enable XDebug. By default it is disabled', undefined, processBooleanOption).option('xdebug_config', 'Extra configuration to pass to xdebug via XDEBUG_CONFIG environment variable').option('elasticsearch', 'Enable Elasticsearch (needed by Enterprise Search)', undefined, processBooleanOption).option('mariadb', 'Explicitly choose MariaDB version to use').option(['r', 'media-redirect-domain'], 'Domain to redirect for missing media files. This can be used to still have images without the need to import them locally.').option('php', 'Explicitly choose PHP version to use');
595
591
  }
596
592
  /**
597
593
  * Provides the list of tag choices for selection
@@ -164,13 +164,17 @@ function preProcessInstanceData(instanceData) {
164
164
  newInstanceData.mediaRedirectDomain = `https://${instanceData.mediaRedirectDomain}`;
165
165
  }
166
166
 
167
- newInstanceData.elasticsearchEnabled = instanceData.elasticsearchEnabled || false;
167
+ newInstanceData.elasticsearch = instanceData.elasticsearch || false;
168
168
  newInstanceData.php = instanceData.php || _devEnvironment.DEV_ENVIRONMENT_PHP_VERSIONS.default;
169
169
 
170
170
  if (newInstanceData.php.startsWith('image:')) {
171
171
  newInstanceData.php = newInstanceData.php.slice('image:'.length);
172
172
  }
173
173
 
174
+ if (!newInstanceData.xdebugConfig) {
175
+ newInstanceData.xdebugConfig = '';
176
+ }
177
+
174
178
  return newInstanceData;
175
179
  }
176
180
 
@@ -289,9 +293,9 @@ function readEnvironmentData(slug) {
289
293
  ***********************************/
290
294
  // REMOVEME after the wheel of time spins around few times
291
295
 
292
- if (instanceData.enterpriseSearchEnabled) {
293
- // enterpriseSearchEnabled was renamed to elasticsearchEnabled
294
- instanceData.elasticsearchEnabled = instanceData.enterpriseSearchEnabled;
296
+ if (instanceData.enterpriseSearchEnabled || instanceData.elasticsearchEnabled) {
297
+ // enterpriseSearchEnabled and elasticsearchEnabled was renamed to elasticsearch
298
+ instanceData.elasticsearch = instanceData.enterpriseSearchEnabled || instanceData.elasticsearchEnabled;
295
299
  } // REMOVEME after the wheel of time spins around few times
296
300
 
297
301
 
@@ -606,12 +610,7 @@ async function updateWordPressImage(slug) {
606
610
  }) => tag.trim() === choice.tag.trim()); // Write new data and stage for rebuild
607
611
 
608
612
  envData.wordpress.tag = version.tag;
609
- envData.wordpress.ref = version.ref; // Ensure xdebugConfig is not undefined (needed by .lando.yml template)
610
-
611
- if (!envData.xdebugConfig) {
612
- envData.xdebugConfig = '';
613
- }
614
-
613
+ envData.wordpress.ref = version.ref;
615
614
  await updateEnvironment(envData);
616
615
  return true;
617
616
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.20.0",
3
+ "version": "2.21.0",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.20.0",
3
+ "version": "2.21.0",
4
4
  "description": "The VIP Javascript library & CLI",
5
5
  "main": "index.js",
6
6
  "bin": {