Skip to content

Commit b4d6bee

Browse files
reynoldsalecpirog
andauthored
Dial fully for lando update (#36)
* Dial fully for `lando update` * Update to node 18 * Fix some script-generated issues. * isolate riff 1 * isolate riff 2 * remove extraneous test line --------- Co-authored-by: Mike Pirog <[email protected]>
1 parent 740b215 commit b4d6bee

23 files changed

+9266
-4559
lines changed

.github/workflows/pr-docs-tests.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
os:
1212
- ubuntu-22.04
1313
node-version:
14-
- '16'
14+
- '18'
1515
steps:
1616
# Install deps and cache
1717
- name: Checkout code
@@ -20,12 +20,12 @@ jobs:
2020
uses: actions/setup-node@v3
2121
with:
2222
node-version: ${{ matrix.node-version }}
23-
cache: yarn
24-
- name: Install Yarn dependencies
25-
run: yarn install --prefer-offline --frozen-lockfile
23+
cache: npm
24+
- name: Install dependencies
25+
run: npm clean-install --prefer-offline --frozen-lockfile
2626

2727
# Run tests
2828
- name: Run linter
29-
run: yarn docs:lint
29+
run: npm run docs:lint
3030
- name: Test build
31-
run: yarn docs:build
31+
run: npm run docs:build

.github/workflows/pr-linter.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
os:
1212
- ubuntu-22.04
1313
node-version:
14-
- '16'
14+
- '18'
1515
steps:
1616
# Install deps and cache
1717
- name: Checkout code
@@ -20,10 +20,10 @@ jobs:
2020
uses: actions/setup-node@v3
2121
with:
2222
node-version: ${{ matrix.node-version }}
23-
cache: yarn
24-
- name: Install Yarn dependencies
25-
run: yarn install --prefer-offline --frozen-lockfile
23+
cache: npm
24+
- name: Install dependencies
25+
run: npm clean-install --prefer-offline --frozen-lockfile
2626

2727
# Run the linter
2828
- name: Run code linter
29-
run: yarn lint
29+
run: npm run lint

.github/workflows/pr-mysql-tests.yml

+13-10
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
os:
1515
- ubuntu-22.04
1616
node-version:
17-
- '16'
17+
- '18'
1818
lando-version:
19-
- 3-dev
19+
- 3-dev-slim
2020
leia-test:
2121
- examples/5.7
2222
- examples/8.0
@@ -29,20 +29,23 @@ jobs:
2929
with:
3030
node-version: ${{ matrix.node-version }}
3131
registry-url: https://registry.npmjs.org
32-
cache: yarn
33-
- name: Install Yarn dependencies
34-
run: yarn install --prefer-offline --frozen-lockfile
32+
cache: npm
33+
- name: Install dependencies
34+
run: npm clean-install --prefer-offline --frozen-lockfile
35+
- name: Bundle Deps
36+
uses: lando/prepare-release-action@v3
37+
with:
38+
lando-plugin: true
39+
version: dev
40+
sync: false
3541
- name: Setup lando ${{ matrix.lando-version }}
3642
uses: lando/setup-lando@v2
3743
with:
3844
lando-version: ${{ matrix.lando-version }}
3945
config: |
40-
plugins.@lando/mysql=/home/runner/work/mysql/mysql
46+
setup.skipCommonPlugins=true
47+
setup.plugins.@lando/mysql=/home/runner/work/mysql/mysql
4148
telemetry: false
42-
- name: Verify Lando works and we are dogfooding this plugin for tests
43-
run: |
44-
lando version
45-
lando config --path plugins | grep mysql | grep /home/runner/work/mysql/mysql || (echo "::error:: Not dogfooding this plugin correctly!" && exit 1)
4649
- name: Run Leia Tests
4750
uses: lando/run-leia-action@v2
4851
with:

.github/workflows/pr-unit-tests.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- ubuntu-22.04
1414
- macos-12
1515
node-version:
16-
- '16'
16+
- '18'
1717
steps:
1818
# Install deps and cache
1919
- name: Checkout code
@@ -22,10 +22,10 @@ jobs:
2222
uses: actions/setup-node@v3
2323
with:
2424
node-version: ${{ matrix.node-version }}
25-
cache: yarn
26-
- name: Install Yarn dependencies
27-
run: yarn install --prefer-offline --frozen-lockfile
25+
cache: npm
26+
- name: Install dependencies
27+
run: npm clean-install --prefer-offline --frozen-lockfile
2828

2929
# Run unit tests
3030
- name: Run unit tests
31-
run: yarn test:unit
31+
run: npm run test:unit

.github/workflows/release.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
os:
1818
- ubuntu-22.04
1919
node-version:
20-
- '16'
20+
- '18'
2121
steps:
2222
# Install deps and cache
2323
- name: Checkout code
@@ -27,19 +27,19 @@ jobs:
2727
with:
2828
node-version: ${{ matrix.node-version }}
2929
registry-url: https://registry.npmjs.org
30-
cache: yarn
31-
- name: Install Yarn dependencies
32-
run: yarn install --prefer-offline --frozen-lockfile
30+
cache: npm
31+
- name: Install dependencies
32+
run: npm clean-install --prefer-offline --frozen-lockfile
3333

3434
# Let's do tests rq just to make sure we dont push something that is fundamentally broken
3535
- name: Lint code
36-
run: yarn lint
36+
run: npm run lint
3737
- name: Run unit tests
38-
run: yarn test:unit
38+
run: npm run test:unit
3939

4040
# Prepare release.
4141
- name: Prepare release
42-
uses: lando/prepare-release-action@v2
42+
uses: lando/prepare-release-action@v3
4343
with:
4444
lando-plugin: true
4545

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ coverage/
3939
_site
4040
docs/.vuepress/.cache
4141
docs/.vuepress/.temp
42-
docs/.vuepress/dist
42+
docs/.vuepress/dist
43+
44+
# YARN
45+
yarn.lock

.lando.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: lando-mysql-plugin
22
services:
33
node:
4-
type: node:14
4+
type: node:18
55
build:
6-
- yarn install
6+
- npm install
77
scanner: false
88
ssl: false
99
sslExpose: false
1010
tooling:
1111
node:
1212
service: node
13-
yarn:
13+
npm:
1414
service: node

.node-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
18

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.github
2+
.nyc_output
3+
coverage
24
docs
35
examples
46
guides

.tool-versions

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 16
1+
nodejs 18

CHANGELOG.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1+
## v1.0.0 - [December 7, 2023](https://github.com/lando/mysql/releases/tag/v1.0.0)
2+
3+
* Dialed fully for `lando update`
4+
15
## v0.9.0 - [Oct 20, 2023](https://github.com/lando/mysql/releases/tag/v0.9.0)
6+
27
* Added a new healthcheck that better assesses service readiness. [#33](https://github.com/lando/mysql/pull/33)
38
* Restructured to use builders/mysql.js.
49

5-
610
## v0.8.0 - [July 3, 2023](https://github.com/lando/mysql/releases/tag/v0.8.0)
7-
* Removed bundle-dependencies and version-bump-prompt from plugin.
8-
* Updated package to use prepare-release-action.
9-
* Updated documentation to reflect new release process.
11+
12+
* Removed bundle-dependencies and version-bump-prompt from plugin.
13+
* Updated package to use prepare-release-action.
14+
* Updated documentation to reflect new release process.
1015

1116
## v0.7.0 - [December 12, 2022](https://github.com/lando/mysql/releases/tag/v0.7.0)
12-
* Added bundle-dependencies to release process.
13-
* Fixed bug in plugin dogfooding test.
1417

15-
## v0.6.0 - [September 7, 2022](https://github.com/lando/mysql/releases/tag/v0.6.0)
18+
* Added bundle-dependencies to release process.
19+
* Fixed bug in plugin dogfooding test.
1620

1721
## v0.5.1 - [April 21, 2022](https://github.com/lando/mysql/releases/tag/v0.5.1)
1822

builders/mysql.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ module.exports = {
3535
constructor(id, options = {}) {
3636
options = _.merge({}, config, options);
3737
// Force the auth plugin to be mysql_native_password on 5.7
38-
if (_.startsWith(options.version, '5.7')) {
39-
options.authentication = 'mysql_native_password';
40-
}
38+
if (_.startsWith(options.version, '5.7')) options.authentication = 'mysql_native_password';
4139

40+
// set a default health check if we dont already have one
4241
if (!options.healthcheck) options.healthcheck = require('../utils/get-default-healthcheck')(options);
4342

4443
// Ensure the non-root backup perm sweep runs
File renamed without changes.

docs/development.md

+14-16
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ At the very least you will need to have the following installed:
1414
* [Lando 3.5.0+](https://docs.lando.dev/basics/installation.html), preferably installed [from source](https://docs.lando.dev/basics/installation.html#from-source).
1515
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
1616

17-
While not a hard requirement it's also probably a good idea to install both `node` 14 and `yarn`
18-
19-
* [Node 14](https://nodejs.org/dist/latest-v14.x/)
20-
* [Yarn](https://classic.yarnpkg.com/lang/en/docs/install)
17+
While not a hard requirement it's also probably a good idea to install `node` 18
18+
* [Node 18](https://nodejs.org/dist/latest-v18.x/)
2119

2220
## Installation
2321

@@ -28,8 +26,8 @@ git clone https://github.com/lando/mysql.git && cd mysql
2826
# Install dependencies with lando
2927
lando start
3028

31-
# Or install them with yarn
32-
yarn
29+
# Or install them with npm
30+
npm install
3331
```
3432

3533
## Working
@@ -60,10 +58,10 @@ If you want to help with contributing documentation here are some useful command
6058

6159
```bash
6260
# launch local docs site
63-
yarn docs:dev
61+
npm run docs:dev
6462
6563
# build docs locally
66-
yarn docs:build
64+
npm run docs:build
6765
```
6866

6967
If you are more interested in the internals of the docs they use [VuePress2](https://v2.vuepress.vuejs.org/) and our [Special theme](https://vuepress-theme-default-plus.lando.dev).
@@ -88,7 +86,7 @@ And then you can run the tests with the below.
8886

8987
```bash
9088
# Run unit tests
91-
yarn test:unit
89+
npm run test:unit
9290
```
9391

9492
### Leia Tests
@@ -115,21 +113,21 @@ Destroy tests
115113
lando destroy -y
116114
```
117115

118-
Note that the headers here are important and are defined in our `yarn generate:tests` script. The _Start up tests_ header specifies things that should run before the main series of tests. _Verification commands_ is the main body of tests and is required. _Destroy tests_ specifies any needed clean up commands to run.
116+
Note that the headers here are important and are defined in our `npm run generate:tests` script. The _Start up tests_ header specifies things that should run before the main series of tests. _Verification commands_ is the main body of tests and is required. _Destroy tests_ specifies any needed clean up commands to run.
119117

120118
If you check out the various READMEs in our [examples](https://github.com/lando/mysql/tree/main/examples) you will notice that they are all Leia tests.
121119

122120
Before running all or some of the tests you will need to generate them.
123121

124122
```bash
125123
# Generate tests
126-
yarn generate:tests
124+
npm run generate:tests
127125
128126
# Run ALL the tests, this will likely take a long time
129-
yarn test:leia
127+
npm run test:leia
130128
131129
# Run the tests for a single example
132-
yarn leia examples/mariadb-10.2/README.md -c 'Destroy tests'
130+
npm run leia examples/mariadb-10.2/README.md -c 'Destroy tests'
133131
```
134132

135133
If you've created new testable examples then you will also need to let GitHub Actions know so they can run on pull requests.
@@ -145,7 +143,7 @@ jobs:
145143
matrix:
146144
leia-tests:
147145
# This should be the filename, without .leia.js extension in the test directory
148-
# NOTE that you will need to run yarn generate:tests to see these
146+
# NOTE that you will need to run npm run generate:tests to see these
149147
- test: platform-sh-maria-db-10-1-example
150148
# This should be the directory that the test was generated from
151149
source: examples/mariadb-10.2
@@ -165,9 +163,9 @@ Also note that if you create a "pre-release" it will tag the `npm` package with
165163

166164
```bash
167165
# Will pull the most recent GitHub release
168-
yarn add @lando/mysql
166+
npm install @lando/mysql
169167
# Will pull the most recent GitHub pre-release
170-
yarn add @lando/mysql@edge
168+
npm install @lando/mysql@edge
171169
```
172170

173171
## Contribution

docs/index.md

+18-12
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,37 @@ This plugin is included with Lando by default. That means if you have Lando vers
4545
However if you would like to manually install the plugin, update it to the bleeding edge or install a particular version then use the below. Note that this installation method requires Lando `3.5.0+`.
4646

4747
:::: code-group
48+
::: code-group-item LANDO 3.21+
49+
```bash:no-line-numbers
50+
lando plugin-add @lando/mysql
51+
```
52+
:::
53+
::: code-group-item HYPERDRIVE
54+
```bash:no-line-numbers
55+
# @TODO
56+
# @NOTE: This doesn't actaully work yet
57+
hyperdrive install @lando/mysql
58+
```
59+
:::
4860
::: code-group-item DOCKER
4961
```bash:no-line-numbers
5062
# Ensure you have a global plugins directory
5163
mkdir -p ~/.lando/plugins
5264
5365
# Install plugin
54-
# NOTE: Modify the "yarn add @lando/mysql" line to install a particular version eg
55-
# yarn add @lando/[email protected]
56-
docker run --rm -it -v ${HOME}/.lando/plugins:/plugins -w /tmp node:14-alpine sh -c \
57-
"yarn init -y \
58-
&& yarn add @lando/mysql --production --flat --no-default-rc --no-lockfile --link-duplicates \
59-
&& yarn install --production --cwd /tmp/node_modules/@lando/mysql \
66+
# NOTE: Modify the "npm install @lando/mysql" line to install a particular version eg
67+
# npm install @lando/[email protected]
68+
docker run --rm -it -v ${HOME}/.lando/plugins:/plugins -w /tmp node:18-alpine sh -c \
69+
"npm init -y \
70+
&& npm install @lando/mysql --production --flat --no-default-rc --no-lockfile --link-duplicates \
71+
&& npm install --production --cwd /tmp/node_modules/@lando/mysql \
6072
&& mkdir -p /plugins/@lando \
6173
&& mv --force /tmp/node_modules/@lando/mysql /plugins/@lando/mysql"
6274
6375
# Rebuild the plugin cache
6476
lando --clear
6577
```
6678
:::
67-
::: code-group-item HYPERDRIVE
68-
```bash:no-line-numbers
69-
# @TODO
70-
# @NOTE: This doesn't actaully work yet
71-
hyperdrive install @lando/mysql
72-
```
7379
::::
7480

7581
You should be able to verify the plugin is installed by running `lando config --path plugins` and checking for `@lando/mysql`. This command will also show you _where_ the plugin is being loaded from.

examples/5.7/.lando.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ services:
88
# This is important because it lets lando know to test against the plugin in this repo
99
# DO NOT REMOVE THIS!
1010
plugins:
11-
"@lando/mysql": ./../../
11+
"@lando/mysql": ../..

examples/5.7/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ lando ssh -s defaults -c "mysql -umysql -pmysql database -e quit"
3333

3434
# Should still be running even after a restart
3535
lando restart
36-
lando ssh -s defaults -c "mysql -umysql -pmysql database -e quit"
3736
```
3837

3938
Destroy tests

0 commit comments

Comments
 (0)