@wpmoo/toolkit 0.9.27 → 0.9.28
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/README.md +4 -0
- package/docs/1-0-readiness.md +129 -0
- package/docs/command-reference.md +110 -0
- package/docs/handoff.md +11 -0
- package/docs/lifecycle-recipes.md +190 -0
- package/docs/troubleshooting.md +225 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -222,8 +222,12 @@ warning while keeping the scoped package release valid.
|
|
|
222
222
|
|
|
223
223
|
## Documentation
|
|
224
224
|
|
|
225
|
+
- [Command Reference](docs/command-reference.md)
|
|
225
226
|
- [External Resources](docs/external-resources.md)
|
|
226
227
|
- [Generated Environment Verification](docs/generated-environment-verification.md)
|
|
228
|
+
- [Lifecycle Recipes](docs/lifecycle-recipes.md)
|
|
229
|
+
- [Troubleshooting](docs/troubleshooting.md)
|
|
230
|
+
- [1.0 Readiness](docs/1-0-readiness.md)
|
|
227
231
|
- Public documentation site: <https://wpmoo.org>
|
|
228
232
|
|
|
229
233
|
## License
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# 1.0 Readiness
|
|
2
|
+
|
|
3
|
+
This checklist tracks what must stay stable before WPMoo Toolkit can be
|
|
4
|
+
released as `1.0.0`.
|
|
5
|
+
|
|
6
|
+
## Stable Command Names
|
|
7
|
+
|
|
8
|
+
Ready:
|
|
9
|
+
|
|
10
|
+
- `npx @wpmoo/toolkit` is the official package entrypoint.
|
|
11
|
+
- Generated environments use local `./moo` for daily commands.
|
|
12
|
+
- Direct commands cover create, status, doctor, source, repository, module,
|
|
13
|
+
service, database, snapshot, restore, lint, and POT workflows.
|
|
14
|
+
- Deprecated package aliases remain compatibility paths:
|
|
15
|
+
`npx @wpmoo/odoo` and `npx @wpmoo/odoo-dev`.
|
|
16
|
+
|
|
17
|
+
Remaining decision:
|
|
18
|
+
|
|
19
|
+
- Whether the optional unscoped `npx wpmoo` short alias should be promoted,
|
|
20
|
+
kept best-effort, or removed from public examples before `1.0.0`.
|
|
21
|
+
|
|
22
|
+
## Stable JSON Contracts
|
|
23
|
+
|
|
24
|
+
Ready:
|
|
25
|
+
|
|
26
|
+
- `status --json` uses `schemaVersion: 1`.
|
|
27
|
+
- `source list --json` and `source sync --json` use `schemaVersion: 1`.
|
|
28
|
+
- `doctor --json` uses `schemaVersion: 1`.
|
|
29
|
+
- `doctor --json --postgres` exposes a versioned `postgres` payload with
|
|
30
|
+
`contractVersion` and diagnostics `schemaVersion`.
|
|
31
|
+
- PostgreSQL diagnostics treat unavailable optional metrics as optional fields.
|
|
32
|
+
|
|
33
|
+
Remaining decision:
|
|
34
|
+
|
|
35
|
+
- Document a compatibility policy for future JSON schema changes, including
|
|
36
|
+
whether minor additive fields are allowed without a major release.
|
|
37
|
+
|
|
38
|
+
## Deprecated Alias Policy
|
|
39
|
+
|
|
40
|
+
Ready:
|
|
41
|
+
|
|
42
|
+
- `@wpmoo/toolkit` is the supported package.
|
|
43
|
+
- `@wpmoo/odoo` and `@wpmoo/odoo-dev` are required compatibility artifacts in
|
|
44
|
+
releases.
|
|
45
|
+
- The optional `wpmoo` short alias is warning-only and does not determine
|
|
46
|
+
release validity.
|
|
47
|
+
|
|
48
|
+
Remaining decision:
|
|
49
|
+
|
|
50
|
+
- Set an explicit deprecation horizon for compatibility aliases after `1.0.0`,
|
|
51
|
+
or commit to maintaining them indefinitely.
|
|
52
|
+
|
|
53
|
+
## Generated File Compatibility
|
|
54
|
+
|
|
55
|
+
Ready:
|
|
56
|
+
|
|
57
|
+
- Generated environments keep product source repositories under
|
|
58
|
+
`odoo/custom/src/private`, `odoo/custom/src/oca`, and
|
|
59
|
+
`odoo/custom/src/external`.
|
|
60
|
+
- `safe reset` refreshes generated files while preserving source repositories.
|
|
61
|
+
- PostgreSQL 18 mount compatibility is documented and doctor can apply safe
|
|
62
|
+
mount-target fixes.
|
|
63
|
+
- Generated `./moo` delegates daily commands and keeps local guard behavior.
|
|
64
|
+
|
|
65
|
+
Remaining decision:
|
|
66
|
+
|
|
67
|
+
- Define a generated-file migration policy for environments created by older
|
|
68
|
+
pre-1.0 releases.
|
|
69
|
+
|
|
70
|
+
## Stage And Production Policy
|
|
71
|
+
|
|
72
|
+
Ready:
|
|
73
|
+
|
|
74
|
+
- Stage `install` and `update` require `WPMOO_ALLOW_STAGE_LIFECYCLE=1`.
|
|
75
|
+
- Production `install`, `update`, and `test` require
|
|
76
|
+
`WPMOO_ALLOW_PROD_LIFECYCLE=1`.
|
|
77
|
+
- Destructive database commands require `WPMOO_ALLOW_DESTRUCTIVE=1` in stage
|
|
78
|
+
and production.
|
|
79
|
+
- `restore-snapshot --dry-run`, `doctor`, and `doctor --postgres` remain safe
|
|
80
|
+
preview/read-only paths.
|
|
81
|
+
- Migration-risk lifecycle commands can require `WPMOO_ALLOW_MIGRATIONS=1`.
|
|
82
|
+
|
|
83
|
+
Remaining decision:
|
|
84
|
+
|
|
85
|
+
- Decide whether stage/prod approvals should gain a timestamped confirmation
|
|
86
|
+
file or continue to rely on environment variables only.
|
|
87
|
+
|
|
88
|
+
## Release Artifact Policy
|
|
89
|
+
|
|
90
|
+
Ready:
|
|
91
|
+
|
|
92
|
+
- Required release artifacts are `@wpmoo/toolkit`, `@wpmoo/odoo`, and
|
|
93
|
+
`@wpmoo/odoo-dev`.
|
|
94
|
+
- Publishing is handled by GitHub Actions Trusted Publishing after a `v<version>`
|
|
95
|
+
tag is pushed.
|
|
96
|
+
- `npm run release:check` verifies package state and bumps patch versions when
|
|
97
|
+
the current version already exists.
|
|
98
|
+
- `npm run smoke:published -- "$VERSION"` is the preferred published package
|
|
99
|
+
smoke check.
|
|
100
|
+
|
|
101
|
+
Remaining decision:
|
|
102
|
+
|
|
103
|
+
- Decide whether release smoke should include a generated-environment acceptance
|
|
104
|
+
run by default for `1.0.0` tags.
|
|
105
|
+
|
|
106
|
+
## Current Audit
|
|
107
|
+
|
|
108
|
+
Last updated: 2026-05-21.
|
|
109
|
+
|
|
110
|
+
Completed checks:
|
|
111
|
+
|
|
112
|
+
- Full local gate for Train 8 passed on 2026-05-21:
|
|
113
|
+
`npm run typecheck`, `npm test`, `npm run build`, and `git diff --check`.
|
|
114
|
+
- Coverage passed on 2026-05-21: 72 test files, 682 tests, 92.32%
|
|
115
|
+
statements, 87.56% branches, 96.74% functions, and 92.32% lines.
|
|
116
|
+
- Published CLI smoke passed against `@wpmoo/toolkit@0.9.27` with `npm exec`
|
|
117
|
+
for `wpmoo --version`, `wpmoo --help`, and `wpmoo doctor --help`.
|
|
118
|
+
- Placeholder review found no `TODO`, `FIXME`, `TBD`, or `coming soon`
|
|
119
|
+
markers in `README.md`, `docs`, or `src`.
|
|
120
|
+
- Local markdown link review passed across `README.md` and `docs/*.md`.
|
|
121
|
+
|
|
122
|
+
Final gap list:
|
|
123
|
+
|
|
124
|
+
- Define JSON compatibility rules for post-1.0 additive fields.
|
|
125
|
+
- Decide the long-term compatibility alias policy.
|
|
126
|
+
- Decide generated-environment migration support for older pre-1.0 outputs.
|
|
127
|
+
- Decide whether stage/prod approvals need timestamped confirmation files.
|
|
128
|
+
- Decide whether generated-environment published smoke should be mandatory for
|
|
129
|
+
`1.0.0` tags.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Command Reference
|
|
2
|
+
|
|
3
|
+
Use `npx @wpmoo/toolkit ...` for package/operator commands. Use `./moo ...`
|
|
4
|
+
inside a generated environment for daily local commands. The deprecated
|
|
5
|
+
compatibility aliases `npx @wpmoo/odoo` and `npx @wpmoo/odoo-dev` redirect to
|
|
6
|
+
the toolkit package; new automation should use `@wpmoo/toolkit`.
|
|
7
|
+
|
|
8
|
+
## Package Commands
|
|
9
|
+
|
|
10
|
+
| Command | Cockpit Equivalent | JSON | Notes |
|
|
11
|
+
| --- | --- | --- | --- |
|
|
12
|
+
| `npx @wpmoo/toolkit` | Open cockpit or create wizard | No | Opens the create wizard outside an environment and the cockpit inside one. |
|
|
13
|
+
| `npx @wpmoo/toolkit create ...` | Create wizard | No | Creates a generated environment. Use `--target <path>` for a custom folder. |
|
|
14
|
+
| `npx @wpmoo/toolkit status` | Diagnostics -> Environment status | Yes, `--json` | Fast local metadata and file check. |
|
|
15
|
+
| `npx @wpmoo/toolkit doctor [--fix] [--postgres]` | Diagnostics -> Run doctor | Yes, `--json` | Deeper health checks. `--postgres` is read-only and advisory. |
|
|
16
|
+
| `npx @wpmoo/toolkit source list` | Repositories | Yes, `--json` | Lists known source repositories. |
|
|
17
|
+
| `npx @wpmoo/toolkit source sync` | Repositories | Yes, `--json` | Refreshes source manifest data. |
|
|
18
|
+
| `npx @wpmoo/toolkit add-repo --repo-url <url>` | Repositories -> Add source repo | No | Adds a source repository category entry. |
|
|
19
|
+
| `npx @wpmoo/toolkit remove-repo --repo <name>` | Repositories -> Remove source repo | No | Removes a source repository from the environment. |
|
|
20
|
+
| `npx @wpmoo/toolkit add-module --repo <repo> --module <name>` | Modules -> Add module | No | Creates an Odoo module skeleton in a source repository. |
|
|
21
|
+
| `npx @wpmoo/toolkit remove-module --repo <repo> --module <name>` | Modules -> Remove module | No | Removes module metadata; pass `--delete-files` to delete module files after dirty checks. |
|
|
22
|
+
| `npx @wpmoo/toolkit reset [--dry-run]` | Maintenance -> Safe reset environment | No | Refreshes generated files while preserving source repositories. |
|
|
23
|
+
|
|
24
|
+
## Generated Environment Commands
|
|
25
|
+
|
|
26
|
+
Run these from the generated environment root:
|
|
27
|
+
|
|
28
|
+
| Command | Cockpit Equivalent | Guarded In Stage/Prod | Notes |
|
|
29
|
+
| --- | --- | --- | --- |
|
|
30
|
+
| `./moo start` | Services -> Start services | No | Starts local Odoo services. Disabled in cockpit when already running. |
|
|
31
|
+
| `./moo stop` | Services -> Stop services | No | Stops local services. Disabled in cockpit when services are stopped. |
|
|
32
|
+
| `./moo restart` | Services -> Restart services | No | Restarts services. |
|
|
33
|
+
| `./moo logs [service] [tail-lines]` | Services -> View logs | No | Streams or tails service logs. |
|
|
34
|
+
| `./moo shell` | Services -> Open shell | No | Opens a shell in the Odoo service container. |
|
|
35
|
+
| `./moo psql [db]` | Database -> Open psql | No | Opens a PostgreSQL prompt. |
|
|
36
|
+
| `./moo install <module[,module]> [db]` | Modules -> Install module | Yes | Installs one or more modules. |
|
|
37
|
+
| `./moo update <module[,module]> [db]` | Modules -> Update module | Yes | Updates one or more modules. |
|
|
38
|
+
| `./moo test <module[,module]> --db <db>` | Modules -> Run tests | Yes in prod | Runs Odoo tests for modules. |
|
|
39
|
+
| `./moo lint` | Modules -> Run environment lint | No | Runs configured environment lint checks. |
|
|
40
|
+
| `./moo pot <module[,module]> [db] [output]` | Modules -> Generate POT | No | Generates translation template files. |
|
|
41
|
+
| `./moo snapshot [db] [name]` | Database -> Create snapshot | No | Creates a database and filestore snapshot. |
|
|
42
|
+
| `./moo restore-snapshot --dry-run <name> [db]` | Database -> Restore snapshot | Preview only | Prints a restore preview without changing data. |
|
|
43
|
+
| `./moo restore-snapshot <name> [db]` | Database -> Restore snapshot | Yes | Restores database and filestore from a snapshot. |
|
|
44
|
+
| `./moo resetdb [db] [module[,module]]` | Database -> Reset database | Yes | Destructive database reset. |
|
|
45
|
+
| `./moo doctor [--fix] [--postgres]` | Diagnostics -> Run doctor | No | Local health checks. |
|
|
46
|
+
| `./moo status` | Diagnostics -> Environment status | No | Local environment status. |
|
|
47
|
+
|
|
48
|
+
## JSON Output
|
|
49
|
+
|
|
50
|
+
Machine-readable output is available for automation:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx @wpmoo/toolkit status --json
|
|
54
|
+
npx @wpmoo/toolkit source list --json
|
|
55
|
+
npx @wpmoo/toolkit source sync --json
|
|
56
|
+
npx @wpmoo/toolkit doctor --json
|
|
57
|
+
npx @wpmoo/toolkit doctor --json --postgres
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Current JSON contract notes:
|
|
61
|
+
|
|
62
|
+
- `status --json` uses `schemaVersion: 1`.
|
|
63
|
+
- `source list --json` and `source sync --json` use `schemaVersion: 1`.
|
|
64
|
+
- `doctor --json` uses `schemaVersion: 1`.
|
|
65
|
+
- `doctor --json --postgres` adds `postgres.contractVersion` and a PostgreSQL
|
|
66
|
+
diagnostics object with its own `schemaVersion`.
|
|
67
|
+
- PostgreSQL fields are optional when a metric is unavailable.
|
|
68
|
+
|
|
69
|
+
## Environment Variables
|
|
70
|
+
|
|
71
|
+
| Variable | Purpose |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| `WPMOO_ENV=dev|stage|prod` | Selects environment safety policy. Missing value behaves like development for local workflows. |
|
|
74
|
+
| `WPMOO_ALLOW_STAGE_LIFECYCLE=1` | Allows `install` and `update` in stage. |
|
|
75
|
+
| `WPMOO_ALLOW_PROD_LIFECYCLE=1` | Allows `install`, `update`, and `test` in production. |
|
|
76
|
+
| `WPMOO_ALLOW_DESTRUCTIVE=1` | Allows destructive database commands in stage/prod. |
|
|
77
|
+
| `WPMOO_ALLOW_NO_RECENT_SNAPSHOT=1` | Allows destructive commands without a recent snapshot when that extra guard applies. |
|
|
78
|
+
| `WPMOO_ALLOW_MIGRATIONS=1` | Allows lifecycle commands when migration scripts are detected. |
|
|
79
|
+
| `WPMOO_NODE_BIN`, `WPMOO_NPX_BIN`, `WPMOO_GIT_BIN` | Override binaries used by release smoke scripts. |
|
|
80
|
+
|
|
81
|
+
Process environment values take precedence over `.env` values for safety flags.
|
|
82
|
+
|
|
83
|
+
## Exit Behavior
|
|
84
|
+
|
|
85
|
+
- Successful commands exit `0`.
|
|
86
|
+
- Invalid arguments, missing environment metadata, refused guard checks, dirty
|
|
87
|
+
deletion, and failed subprocesses exit non-zero.
|
|
88
|
+
- `--json` commands still use process exit codes; automation should check both
|
|
89
|
+
the exit status and the `ok` field when present.
|
|
90
|
+
- Guard failures are intentional failures. Do not silence them unless the named
|
|
91
|
+
`WPMOO_ALLOW_*` flag has been reviewed.
|
|
92
|
+
|
|
93
|
+
## Stage And Production Restrictions
|
|
94
|
+
|
|
95
|
+
| Command Family | Stage | Production |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `install`, `update` | Requires `WPMOO_ALLOW_STAGE_LIFECYCLE=1` | Requires `WPMOO_ALLOW_PROD_LIFECYCLE=1` |
|
|
98
|
+
| `test` | Allowed | Requires `WPMOO_ALLOW_PROD_LIFECYCLE=1` |
|
|
99
|
+
| `resetdb`, real `restore-snapshot` | Requires `WPMOO_ALLOW_DESTRUCTIVE=1` | Requires `WPMOO_ALLOW_DESTRUCTIVE=1` |
|
|
100
|
+
| `restore-snapshot --dry-run` | Allowed | Allowed |
|
|
101
|
+
| Commands with detected migration scripts | May require `WPMOO_ALLOW_MIGRATIONS=1` | May require `WPMOO_ALLOW_MIGRATIONS=1` |
|
|
102
|
+
|
|
103
|
+
Prefer read-only and dry-run commands first:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
./moo doctor
|
|
107
|
+
./moo doctor --postgres
|
|
108
|
+
./moo restore-snapshot --dry-run before-change devel
|
|
109
|
+
```
|
|
110
|
+
|
package/docs/handoff.md
CHANGED
|
@@ -64,3 +64,14 @@ Current command standard:
|
|
|
64
64
|
|
|
65
65
|
- Use `npx @wpmoo/toolkit ...` for package/operator commands.
|
|
66
66
|
- Use generated environment `./moo ...` for local compose daily commands.
|
|
67
|
+
|
|
68
|
+
1.0 readiness references:
|
|
69
|
+
|
|
70
|
+
- [Command Reference](command-reference.md)
|
|
71
|
+
- [Lifecycle Recipes](lifecycle-recipes.md)
|
|
72
|
+
- [Troubleshooting](troubleshooting.md)
|
|
73
|
+
- [1.0 Readiness](1-0-readiness.md)
|
|
74
|
+
|
|
75
|
+
Before a `1.0.0` tag, review the readiness gap list and decide whether the next
|
|
76
|
+
milestone is "ship 1.0" or "finish named gaps." Do not treat the gap list as an
|
|
77
|
+
open-ended cleanup queue.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Lifecycle Recipes
|
|
2
|
+
|
|
3
|
+
These recipes show WPMoo Toolkit as a sequence of Dev, Stage, and Production
|
|
4
|
+
workflows. Replace repository names, module names, and database names with your
|
|
5
|
+
project values.
|
|
6
|
+
|
|
7
|
+
## Local Development Setup
|
|
8
|
+
|
|
9
|
+
Create a generated environment from a workspace directory:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @wpmoo/toolkit create \
|
|
13
|
+
--product odoo_sample_module \
|
|
14
|
+
--odoo-version 19.0 \
|
|
15
|
+
--target ./odoo_sample_module_dev \
|
|
16
|
+
--dev-repo-url https://github.com/example-org/odoo_sample_module_dev.git \
|
|
17
|
+
--source-repo-url https://github.com/example-org/odoo_sample_module.git
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Enter the environment and start daily work:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
cd odoo_sample_module_dev
|
|
24
|
+
./moo start
|
|
25
|
+
./moo status
|
|
26
|
+
./moo doctor
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Use the cockpit for interactive workflows:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
./moo
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Add A Source Repository
|
|
36
|
+
|
|
37
|
+
Add a private source repository:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx @wpmoo/toolkit add-repo \
|
|
41
|
+
--repo-url https://github.com/example-org/odoo-addons.git \
|
|
42
|
+
--source-type private
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Refresh the source manifest:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx @wpmoo/toolkit source sync
|
|
49
|
+
npx @wpmoo/toolkit source list
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use `--source-type oca` for OCA repositories and `--source-type external` for
|
|
53
|
+
third-party repositories.
|
|
54
|
+
|
|
55
|
+
## Add A Module
|
|
56
|
+
|
|
57
|
+
Create a module skeleton:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx @wpmoo/toolkit add-module \
|
|
61
|
+
--repo odoo-addons \
|
|
62
|
+
--module moo_test \
|
|
63
|
+
--source-type private
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Verify the generated module:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
./moo status
|
|
70
|
+
./moo lint
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Expected module files include `__manifest__.py`, model imports, security access
|
|
74
|
+
CSV, views, menus, and a post-install TransactionCase smoke test.
|
|
75
|
+
|
|
76
|
+
## Install And Update A Module
|
|
77
|
+
|
|
78
|
+
Start services and install the module into the development database:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
./moo start
|
|
82
|
+
./moo install moo_test devel
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
After code changes, update the module:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
./moo update moo_test devel
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
If the cockpit shows module actions as disabled, run:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
./moo status
|
|
95
|
+
npx @wpmoo/toolkit source list
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Then add or sync source repositories until installable modules are detected.
|
|
99
|
+
|
|
100
|
+
## Run Tests
|
|
101
|
+
|
|
102
|
+
Run module tests in development:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
./moo test moo_test --db devel
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Use explicit test mode when needed:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
./moo test moo_test --db devel --mode update --tags /moo_test
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
For production, test execution is guarded:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
WPMOO_ENV=prod WPMOO_ALLOW_PROD_LIFECYCLE=1 ./moo test moo_test --db devel
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Snapshot And Restore
|
|
121
|
+
|
|
122
|
+
Take a snapshot before risky changes:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
./moo snapshot devel before-moo-test-update
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Preview a restore:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
./moo restore-snapshot --dry-run before-moo-test-update devel
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Restore intentionally:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
WPMOO_ENV=stage WPMOO_ALLOW_DESTRUCTIVE=1 ./moo restore-snapshot before-moo-test-update devel
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
When the no-recent-snapshot guard applies to a destructive command, either make
|
|
141
|
+
a fresh snapshot or set `WPMOO_ALLOW_NO_RECENT_SNAPSHOT=1` after review.
|
|
142
|
+
|
|
143
|
+
## Stage Dry-Run Validation
|
|
144
|
+
|
|
145
|
+
Use stage for preview-first validation:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
WPMOO_ENV=stage ./moo doctor
|
|
149
|
+
WPMOO_ENV=stage ./moo doctor --postgres
|
|
150
|
+
WPMOO_ENV=stage ./moo restore-snapshot --dry-run before-moo-test-update devel
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Run lifecycle commands only after review:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
WPMOO_ENV=stage WPMOO_ALLOW_STAGE_LIFECYCLE=1 ./moo update moo_test devel
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
If migration scripts are detected, WPMoo may also require:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
WPMOO_ENV=stage WPMOO_ALLOW_STAGE_LIFECYCLE=1 WPMOO_ALLOW_MIGRATIONS=1 ./moo update moo_test devel
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Production-Safe Preview
|
|
166
|
+
|
|
167
|
+
Production workflows should start with read-only checks:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
WPMOO_ENV=prod ./moo status
|
|
171
|
+
WPMOO_ENV=prod ./moo doctor
|
|
172
|
+
WPMOO_ENV=prod ./moo doctor --postgres
|
|
173
|
+
WPMOO_ENV=prod ./moo restore-snapshot --dry-run before-change devel
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Production lifecycle commands require explicit approval flags:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
WPMOO_ENV=prod WPMOO_ALLOW_PROD_LIFECYCLE=1 ./moo update moo_test devel
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Destructive production commands require a separate flag and a rollback plan:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
WPMOO_ENV=prod WPMOO_ALLOW_DESTRUCTIVE=1 ./moo restore-snapshot before-change devel
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Do not set production flags globally in a shell profile. Prefer one-command
|
|
189
|
+
environment variable prefixes so intent is visible in shell history.
|
|
190
|
+
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
This cookbook lists common WPMoo Toolkit failure states and the safest next
|
|
4
|
+
step for each one. Run commands from the generated environment root unless the
|
|
5
|
+
example explicitly starts with `npx @wpmoo/toolkit`.
|
|
6
|
+
|
|
7
|
+
## Docker Is Missing Or Stopped
|
|
8
|
+
|
|
9
|
+
Symptoms:
|
|
10
|
+
|
|
11
|
+
- The create wizard stops before writing files.
|
|
12
|
+
- `./moo start`, `./moo status`, or `./moo doctor` reports Docker or Docker
|
|
13
|
+
Compose as unavailable.
|
|
14
|
+
|
|
15
|
+
Check:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
docker version
|
|
19
|
+
docker compose version
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Next steps:
|
|
23
|
+
|
|
24
|
+
1. Install Docker Desktop or another Docker Engine distribution.
|
|
25
|
+
2. Start Docker Desktop and wait until the engine is ready.
|
|
26
|
+
3. Open a new terminal if Docker was added to `PATH`.
|
|
27
|
+
4. Run the WPMoo command again.
|
|
28
|
+
|
|
29
|
+
The create wizard intentionally stops before setup questions when required
|
|
30
|
+
runtime tools are missing. That protects the workspace from half-created
|
|
31
|
+
environments.
|
|
32
|
+
|
|
33
|
+
## No Modules Found
|
|
34
|
+
|
|
35
|
+
Symptoms:
|
|
36
|
+
|
|
37
|
+
- The cockpit disables module actions.
|
|
38
|
+
- `List modules`, `Install module`, `Update module`, `Run tests`, `Run
|
|
39
|
+
environment lint`, `Generate POT`, or `Remove module` says no modules are
|
|
40
|
+
available.
|
|
41
|
+
|
|
42
|
+
Check the source inventory:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
./moo status
|
|
46
|
+
npx @wpmoo/toolkit source list
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Next steps:
|
|
50
|
+
|
|
51
|
+
1. Add or sync a source repository.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx @wpmoo/toolkit add-repo --repo-url https://github.com/example-org/odoo-addons.git --source-type private
|
|
55
|
+
npx @wpmoo/toolkit source sync
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
2. Add a new module skeleton if the repository exists but has no installable
|
|
59
|
+
module yet.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npx @wpmoo/toolkit add-module --repo odoo-addons --module moo_test --source-type private
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
3. Reopen the cockpit or run `./moo status` again.
|
|
66
|
+
|
|
67
|
+
Expected result:
|
|
68
|
+
|
|
69
|
+
- Module actions become selectable once at least one installable module is
|
|
70
|
+
detected.
|
|
71
|
+
- If a module has no actionable Odoo menu, `status` reports it so you can fix
|
|
72
|
+
the generated menu/action metadata.
|
|
73
|
+
|
|
74
|
+
## No Source Repositories
|
|
75
|
+
|
|
76
|
+
Symptoms:
|
|
77
|
+
|
|
78
|
+
- `source list` is empty.
|
|
79
|
+
- Module actions cannot find a target repository.
|
|
80
|
+
- The generated environment exists but `odoo/custom/src/private`,
|
|
81
|
+
`odoo/custom/src/oca`, and `odoo/custom/src/external` contain no usable
|
|
82
|
+
source checkout.
|
|
83
|
+
|
|
84
|
+
Check:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npx @wpmoo/toolkit source list --json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Next steps:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npx @wpmoo/toolkit add-repo --repo-url https://github.com/example-org/odoo-addons.git --source-type private
|
|
94
|
+
npx @wpmoo/toolkit source sync
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Use `--source-type oca` or `--source-type external` when the repository belongs
|
|
98
|
+
outside the private source category.
|
|
99
|
+
|
|
100
|
+
## Dirty Module Deletion Is Refused
|
|
101
|
+
|
|
102
|
+
Symptoms:
|
|
103
|
+
|
|
104
|
+
- `remove-module` refuses to delete module files.
|
|
105
|
+
- The command reports local changes or an unsafe module worktree.
|
|
106
|
+
|
|
107
|
+
Check the source repository directly:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
git -C odoo/custom/src/private/<repo> status --short
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Next steps:
|
|
114
|
+
|
|
115
|
+
1. Commit, stash, or intentionally discard the local module changes from inside
|
|
116
|
+
the source repository.
|
|
117
|
+
2. Re-run the removal.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npx @wpmoo/toolkit remove-module --repo <repo> --module <module> --source-type private --delete-files
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
WPMoo refuses dirty deletion because module repositories are product source
|
|
124
|
+
code, not disposable generated files.
|
|
125
|
+
|
|
126
|
+
## Optional `wpmoo` Alias Reports E404
|
|
127
|
+
|
|
128
|
+
Symptoms:
|
|
129
|
+
|
|
130
|
+
- Release checks or manual npm checks report `wpmoo@<version>` as missing.
|
|
131
|
+
- Scoped packages are available.
|
|
132
|
+
|
|
133
|
+
Required packages:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npm view @wpmoo/toolkit@<version> version
|
|
137
|
+
npm view @wpmoo/odoo@<version> version
|
|
138
|
+
npm view @wpmoo/odoo-dev@<version> version
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Interpretation:
|
|
142
|
+
|
|
143
|
+
- `@wpmoo/toolkit`, `@wpmoo/odoo`, and `@wpmoo/odoo-dev` are the supported
|
|
144
|
+
release artifacts.
|
|
145
|
+
- The unscoped `wpmoo` short alias is best-effort. An E404 for `wpmoo` does not
|
|
146
|
+
invalidate a release when the three scoped packages verify.
|
|
147
|
+
|
|
148
|
+
Use the supported package path in automation:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npx @wpmoo/toolkit --version
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## PostgreSQL Diagnostics Are Unavailable
|
|
155
|
+
|
|
156
|
+
Symptoms:
|
|
157
|
+
|
|
158
|
+
- `./moo doctor --postgres` prints an advisory warning.
|
|
159
|
+
- `./moo doctor --json --postgres` includes `postgres.available: false`.
|
|
160
|
+
|
|
161
|
+
Check that services are running:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
./moo status
|
|
165
|
+
./moo start
|
|
166
|
+
./moo doctor --postgres
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Next steps:
|
|
170
|
+
|
|
171
|
+
1. Confirm the database service is running and reachable.
|
|
172
|
+
2. Run the JSON form to inspect the structured reason.
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
./moo doctor --json --postgres
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
3. Treat PostgreSQL diagnostics as advisory. WPMoo only runs read-only checks
|
|
179
|
+
and does not tune PostgreSQL automatically.
|
|
180
|
+
|
|
181
|
+
Expected result when available:
|
|
182
|
+
|
|
183
|
+
- The JSON payload includes `postgres.contractVersion`.
|
|
184
|
+
- The diagnostics object includes `schemaVersion`.
|
|
185
|
+
- Missing or malformed metric rows are reported as unavailable diagnostics
|
|
186
|
+
instead of being treated as success.
|
|
187
|
+
|
|
188
|
+
## Stage Or Production Guard Failure
|
|
189
|
+
|
|
190
|
+
Symptoms:
|
|
191
|
+
|
|
192
|
+
- `install`, `update`, `test`, `resetdb`, or `restore-snapshot` is refused in
|
|
193
|
+
`WPMOO_ENV=stage` or `WPMOO_ENV=prod`.
|
|
194
|
+
- The message names a required `WPMOO_ALLOW_*` flag.
|
|
195
|
+
|
|
196
|
+
Safe preview commands:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
./moo restore-snapshot --dry-run <snapshot-name> devel
|
|
200
|
+
./moo doctor
|
|
201
|
+
./moo doctor --postgres
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Intentional stage lifecycle command:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
WPMOO_ENV=stage WPMOO_ALLOW_STAGE_LIFECYCLE=1 ./moo update <module> devel
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Intentional production lifecycle command:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
WPMOO_ENV=prod WPMOO_ALLOW_PROD_LIFECYCLE=1 ./moo test <module> --db devel
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Intentional destructive command:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
WPMOO_ENV=stage WPMOO_ALLOW_DESTRUCTIVE=1 WPMOO_ALLOW_NO_RECENT_SNAPSHOT=1 ./moo resetdb devel
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Use the guard flag only when the command is intentional, reviewed, and has an
|
|
223
|
+
appropriate rollback path. Migration-risk lifecycle commands may also require
|
|
224
|
+
`WPMOO_ALLOW_MIGRATIONS=1`.
|
|
225
|
+
|