Skip to content

Commit ac3a2b7

Browse files
committed
dry-run - GA
feat: enhance dry-run functionality and documentation feat: enhance dry-run functionality and documentation feat: enhance dry-run functionality and documentation feat: enhance dry-run functionality for tenant assets feat: enhance dry-run functionality and tests feat: improve precision in hoursToMinutes function - src/sessionDurationsToMinutes.ts: update return value to include 4 decimal places feat: update dependencies in package.json - package.json: upgrade @clack/prompts to 1.1.0 - package.json: upgrade chalk to 5.6.2 - package.json: add @types/chai to devDependencies feat: enhance dry-run functionality in userAttributeProfiles handler and tests - src/tools/auth0/handlers/default.ts: add 'riskAssessment' type to settings - src/tools/auth0/handlers/userAttributeProfiles.ts: implement dry run check for changes - test/tools/auth0/handlers/userAttributeProfiles.tests.js: add test for dry run short-circuit behavior feat: enhance dry-run functionality and tests feat: enhance dry-run functionality and tests - src/tools/calculateChanges.ts: add normalizeArrayValues function to handle array normalization - src/tools/calculateChanges.ts: update getObjectDifferences to use normalized arrays for comparison - test/tools/calculateChanges.test.ts: add tests to validate dry-run comparisons ignoring array order - test/tools/calculateChanges.test.ts: add tests for real differences after normalizing array order feat: enhance dry-run functionality and tests - src/tools/calculateChanges.ts: add normalizeArrayValues function to handle array normalization - src/tools/calculateChanges.ts: update getObjectDifferences to use normalized arrays for comparison - test/tools/calculateChanges.test.ts: add tests to validate dry-run comparisons ignoring array order - test/tools/calculateChanges.test.ts: add tests for real differences after normalizing array order fix(src/tools/calculateChanges.ts): update regex for array path matching to improve log clarity refactor: add dry-run change calculation utilities feat: Enhance APIHandler and Auth0 logging
1 parent 5bac35b commit ac3a2b7

34 files changed

Lines changed: 2227 additions & 986 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ CLAUDE.md
2222
.github/agents/*
2323
.github/skills/*
2424
package-lock.json
25+
.github/hooks/*

docs/using-dry-run.md

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ The Auth0 Deploy CLI supports a "dry run" mode that allows you to preview all po
88

99
### Command Line Interface
1010

11-
Add the `--dry_run` flag to your import command:
11+
Add the `--dry-run` flag to your import command:
1212

1313
```bash
14-
a0deploy import --config_file=config.json --input_file=./tenant.yaml --dry_run
14+
a0deploy import --config_file=config.json --input_file=./tenant.yaml --dry-run
1515
```
1616

1717
Or use the shorter form:
1818

1919
```bash
20-
a0deploy import -c config.json -i ./tenant-directory --dry_run
20+
a0deploy import -c config.json -i ./tenant-directory --dry-run
2121
```
2222

2323
### Node Module
@@ -44,7 +44,9 @@ deploy({
4444
});
4545
```
4646

47-
**Note**: Using `AUTH0_DRY_RUN` will present an interactive prompt to select options after displaying the dry run preview.
47+
**Note**: To get the interactive menu when using the Node module, also set `AUTH0_DRY_RUN_INTERACTIVE: true`.
48+
49+
To show the preview and then apply without prompting when using the Node module, set `AUTH0_DRY_RUN_APPLY: true` alongside `AUTH0_DRY_RUN: true`.
4850

4951
### Environment Variable
5052

@@ -55,6 +57,41 @@ export AUTH0_DRY_RUN=true
5557
a0deploy import -c config.json -i ./tenant.yaml
5658
```
5759

60+
## CI/CD Usage
61+
62+
By default, `--dry-run` is non-interactive and safe for CI pipelines.
63+
64+
### Preview Only
65+
66+
Shows the plan and exits without applying changes:
67+
68+
```bash
69+
a0deploy import -c config.json -i tenant.yaml --dry-run
70+
```
71+
72+
GitHub Actions:
73+
74+
```yaml
75+
- name: Preview Auth0 changes
76+
run: a0deploy import -c config.json -i tenant.yaml --dry-run
77+
```
78+
79+
### Deployment with Visibility
80+
81+
Show the plan and apply without prompting:
82+
83+
```bash
84+
a0deploy import -c config.json -i tenant.yaml --dry-run --apply
85+
```
86+
87+
### Interactive Review (Manual Deployments)
88+
89+
Add `--interactive` to get the menu (apply / export to file / exit):
90+
91+
```bash
92+
a0deploy import -c config.json -i tenant.yaml --dry-run --interactive
93+
```
94+
5895
## Understanding the Output
5996

6097
Dry run mode provides a detailed preview of all proposed changes in a table format:
@@ -67,14 +104,16 @@ Input: local/tenant.yaml
67104
68105
Simulating deployment... The following changes are proposed:
69106
70-
| Resource | Status | Name / Identifier |
71-
|---------------|---------|----------------------------------|
72-
| Actions | CREATE | Post-Login User Enrichment |
73-
| | CREATE | Pre-Registration Validation |
74-
| | DELETE* | Deprecated Action |
75-
| Clients | CREATE | New SPA Application |
76-
| | UPDATE | Existing M2M Application |
77-
| Connections | UPDATE | Username-Password-Authentication |
107+
┌─────────────┬─────────┬──────────────────────────────────┐
108+
│ Resource │ Status │ Name / Identifier │
109+
├─────────────┼─────────┼──────────────────────────────────┤
110+
│ Actions │ CREATE │ Post-Login User Enrichment │
111+
│ │ CREATE │ Pre-Registration Validation │
112+
│ │ DELETE* │ Deprecated Action │
113+
│ Clients │ CREATE │ New SPA Application │
114+
│ │ UPDATE │ Existing M2M Application │
115+
│ Connections │ UPDATE │ Username-Password-Authentication │
116+
└─────────────┴─────────┴──────────────────────────────────┘
78117
79118
* Requires AUTH0_ALLOW_DELETE to be enabled
80119
@@ -104,7 +143,7 @@ When `AUTH0_ALLOW_DELETE` is enabled, dry run will show which resources would be
104143
```bash
105144
# Enable deletions in your config
106145
export AUTH0_ALLOW_DELETE=true
107-
a0deploy import -c config.json -i ./tenant.yaml --dry_run
146+
a0deploy import -c config.json -i ./tenant.yaml --dry-run
108147
```
109148

110149
Resources marked for deletion will appear in the output with `DELETE*` status, and the asterisk note will explain that `AUTH0_ALLOW_DELETE` must be enabled for deletions to occur.

dry-run-ga-plan.md

Lines changed: 0 additions & 236 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
"readme": "README.md",
3333
"homepage": "https://github.com/auth0/auth0-deploy-cli#readme",
3434
"dependencies": {
35-
"@clack/prompts": "0.11.0",
35+
"@clack/prompts": "1.1.0",
3636
"ajv": "^6.12.6",
3737
"auth0": "^5.4.0",
38+
"chalk": "5.6.2",
3839
"dot-prop": "^5.3.0",
3940
"fs-extra": "^10.1.0",
4041
"js-yaml": "^4.1.1",
@@ -49,6 +50,7 @@
4950
},
5051
"devDependencies": {
5152
"@eslint/js": "^9.39.2",
53+
"@types/chai": "^5.2.3",
5254
"@types/fs-extra": "^9.0.13",
5355
"@types/lodash": "^4.17.24",
5456
"@types/mocha": "^10.0.10",

0 commit comments

Comments
 (0)