Commit 4dad6e0
authored
New command:
#### Description
This PR adds a new dummy command called `check`. It will run the
preflight checks before `run`/`snapshot`.
The actual checks will come in multiple follow-up PRs.
When invoking `check` all checks are executed. If you want to run a only
a portion of the checks, you will be able to provide flags to filter.
```
$ pgstream check --connectivity
```
```
$ pgstream check --replication
```
```
$ pgstream check --access
```
```
$ pgstream check --connectivity --replication
```
##### Help
```
$ pgstream check --help
Runs pre-migration checks to catch blocking issues before snapshot/run
Usage:
pgstream check [flags]
Examples:
pgstream check -c pg2pg.env
pgstream check -c pg2pg.yaml --json
Flags:
-h, --help help for check
--json Output the check report in JSON format
--postgres-url string Source postgres URL to run checks against
--target-url string Target URL to run checks against
```
##### Example outputs
```
# Run against a config file
$ pgstream check -c pg2pg.yaml
SUCCESS no checks to run
# Run with env-var-driven config
$ PGSTREAM_POSTGRES_LISTENER_URL="postgres://user:pw@source:5432/app" pgstream check
SUCCESS no checks to run
# Run with flags
$ pgstream check \
--postgres-url "postgres://user:pw@source:5432/app" \
--target-url "postgres://user:pw@target:5432/app"
SUCCESS no checks to run
# JSON output (no findings to report yet)
$ pgstream check -c pg2pg.yaml --json
SUCCESS no checks to run
```
#### Related Issue(s)
- Related to #897
#### Type of Change
Please select the relevant option(s):
- [ ] 🐛 Bug fix (non-breaking change that fixes an issue)
- [x] ✨ New feature (non-breaking change that adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 📚 Documentation update
- [ ] 🔧 Refactoring (no functional changes)
- [ ] ⚡ Performance improvement
- [ ] 🧪 Test coverage improvement
- [ ] 🔨 Build/CI changes
- [ ] 🧹 Code cleanup
#### Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [x] Manual testing performed
- [x] All existing tests pass
#### Checklist
- [x] Code follows project style guidelines
- [x] Self-review completed
- [x] Code is well-commented
- [x] Documentation updated where necessary
#### Additional Notes
<!-- Any context or special instructions for reviewers -->check (#901)1 parent 6f0a550 commit 4dad6e0
3 files changed
Lines changed: 89 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
4 | 29 | | |
5 | 30 | | |
6 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
118 | 123 | | |
119 | 124 | | |
120 | 125 | | |
| |||
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| 134 | + | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
| |||
0 commit comments