Skip to content

Commit ef92f08

Browse files
feat: optionally skip specific validation operations (#22)
1 parent 6e9e81d commit ef92f08

29 files changed

+1905
-836
lines changed

.changeset/skip-validate-flags.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'powersync': patch
3+
---
4+
5+
Add `--skip-validations` and `--validate-only` flags to `deploy` and `validate` commands.
6+
7+
These mutually exclusive flags accept a comma-separated list of validation tests (`configuration`, `connections`, `sync-config`) and allow users to skip or isolate specific validation checks. This is useful when deploying behind VPC endpoints, dealing with transient sync config timeouts, or bypassing schema validation for older configs.

cli/README.md

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,15 @@ _See code: [src/commands/configure/ide.ts](https://github.com/powersync-ja/power
397397
```
398398
USAGE
399399
$ powersync deploy [--deploy-timeout <value>] [--directory <value>] [--instance-id <value> --project-id
400-
<value>] [--org-id <value>]
400+
<value>] [--org-id <value>] [--skip-validations <value> | --validate-only <value>]
401401

402402
FLAGS
403-
--deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while polling
404-
status (default 300 seconds).
403+
--deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while polling
404+
status (default 300 seconds).
405+
--skip-validations=<value> Comma-separated list of validation tests to skip. Options: configuration, connections,
406+
sync-config. Example: --skip-validations="configuration"
407+
--validate-only=<value> Comma-separated list of validation tests to run, skipping all others. Options:
408+
configuration, connections, sync-config. Example: --validate-only="configuration"
405409

406410
PROJECT FLAGS
407411
--directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
@@ -436,12 +440,16 @@ _See code: [src/commands/deploy/index.ts](https://github.com/powersync-ja/powers
436440
437441
```
438442
USAGE
439-
$ powersync deploy service-config [--deploy-timeout <value>] [--directory <value>] [--instance-id <value> --project-id
440-
<value>] [--org-id <value>]
443+
$ powersync deploy service-config [--skip-validations <value> | --validate-only <value>] [--deploy-timeout <value>]
444+
[--directory <value>] [--instance-id <value> --project-id <value>] [--org-id <value>]
441445

442446
FLAGS
443-
--deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while polling
444-
status (default 300 seconds).
447+
--deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while polling
448+
status (default 300 seconds).
449+
--skip-validations=<value> Comma-separated list of validation tests to skip. Options: configuration, connections.
450+
Example: --skip-validations="configuration"
451+
--validate-only=<value> Comma-separated list of validation tests to run, skipping all others. Options:
452+
configuration, connections. Example: --validate-only="configuration"
445453

446454
PROJECT FLAGS
447455
--directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
@@ -474,11 +482,13 @@ _See code: [src/commands/deploy/service-config.ts](https://github.com/powersync-
474482
```
475483
USAGE
476484
$ powersync deploy sync-config [--deploy-timeout <value>] [--directory <value>] [--instance-id <value> --project-id
477-
<value>] [--org-id <value>] [--sync-config-file-path <value>]
485+
<value>] [--org-id <value>] [--skip-validations <value> | ] [--sync-config-file-path <value>]
478486

479487
FLAGS
480488
--deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while
481489
polling status (default 300 seconds).
490+
--skip-validations=<value> Comma-separated list of validation tests to skip. Options: sync-config. Example:
491+
--skip-validations="sync-config"
482492
--sync-config-file-path=<value> Path to a sync config file. If provided, this file will be validated and deployed
483493
instead of the default sync-config.yaml.
484494

@@ -1437,6 +1447,12 @@ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/
14371447
```
14381448
USAGE
14391449
$ powersync pull instance [--directory <value>] [--instance-id <value> --project-id <value>] [--org-id <value>]
1450+
[--overwrite]
1451+
1452+
FLAGS
1453+
--overwrite Overwrite existing service.yaml and sync-config.yaml if they exist. By default, if these files already
1454+
exist, the fetched configs will be written to service-fetched.yaml and sync-fetched.yaml to avoid
1455+
overwriting local changes.
14401456

14411457
PROJECT FLAGS
14421458
--directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
@@ -1554,12 +1570,16 @@ Validate config schema, connections, and sync config before deploy.
15541570
15551571
```
15561572
USAGE
1557-
$ powersync validate [--output human|json|yaml] [--api-url <value> | --instance-id <value> | --org-id
1558-
<value> | --project-id <value>] [--directory <value>]
1573+
$ powersync validate [--output human|json|yaml] [--skip-validations <value> | --validate-only <value>]
1574+
[--api-url <value> | --instance-id <value> | --org-id <value> | --project-id <value>] [--directory <value>]
15591575

15601576
FLAGS
1561-
--output=<option> [default: human] Output format: human-readable, json, or yaml.
1562-
<options: human|json|yaml>
1577+
--output=<option> [default: human] Output format: human-readable, json, or yaml.
1578+
<options: human|json|yaml>
1579+
--skip-validations=<value> Comma-separated list of validation tests to skip. Options: configuration, connections,
1580+
sync-config. Example: --skip-validations="configuration"
1581+
--validate-only=<value> Comma-separated list of validation tests to run, skipping all others. Options:
1582+
configuration, connections, sync-config. Example: --validate-only="configuration"
15631583

15641584
SELF_HOSTED_PROJECT FLAGS
15651585
--api-url=<value> [Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with

cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"dependencies": {
1111
"@fastify/cors": "^10.0.0",
1212
"@inquirer/prompts": "^7.2.0",
13+
"@journeyapps-labs/common-utils": "^1.0.1",
1314
"@oclif/core": "^4",
1415
"@oclif/plugin-autocomplete": "^3.2.40",
1516
"@oclif/plugin-commands": "^4.1.40",

0 commit comments

Comments
 (0)